From be18d6d6865a5c148457794800ec2588fa5288d2 Mon Sep 17 00:00:00 2001 From: xiaofeicao Date: Fri, 2 Aug 2024 11:11:54 +0800 Subject: [PATCH 01/19] api-specs.json keyvault config authorization config msi config containerregistry config containerservice config containerinstance dns config privatedns config eventhubs config trafficmanager config search config --- sdk/resourcemanager/api-specs.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json index c430ade280ace..61dfcfd085b52 100644 --- a/sdk/resourcemanager/api-specs.json +++ b/sdk/resourcemanager/api-specs.json @@ -22,7 +22,7 @@ "dir": "azure-resourcemanager-authorization", "source": "specification/authorization/resource-manager/readme.md", "package": "com.azure.resourcemanager.authorization", - "args": "--tag=package-2022-04-01 --stream-style-serialization=false" + "args": "--tag=package-2022-04-01 --stream-style-serialization=true" }, "authorization-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-authorization", @@ -52,13 +52,13 @@ "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 --stream-style-serialization=false" + "args": "--tag=package-2023-05 --remove-inner=Container,Operation,CachedImages,Capabilities --rename-model=ContainerGroupPropertiesProperties:ContainerGroupProperties,UserAssignedIdentities:ContainerGroupIdentityUserAssignedIdentities" }, "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 --stream-style-serialization=false" + "args": "--tag=package-2023-07 --modelerfour.lenient-model-deduplication=true" }, "containerregistry-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-containerregistry", @@ -70,7 +70,7 @@ "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 --stream-style-serialization=false" + "args": "--tag=package-2024-05 --modelerfour.lenient-model-deduplication --preserve-model=ContainerServiceVMSizeTypes --rename-model=Ossku:OSSku" }, "containerservice-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-containerservice", @@ -94,7 +94,7 @@ "dir": "azure-resourcemanager-dns", "source": "specification/dns/resource-manager/readme.md", "package": "com.azure.resourcemanager.dns", - "args": "--tag=package-2018-05 --stream-style-serialization=false" + "args": "--tag=package-2018-05" }, "dns-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-dns", @@ -106,7 +106,7 @@ "dir": "azure-resourcemanager-eventhubs", "source": "specification/eventhub/resource-manager/readme.md", "package": "com.azure.resourcemanager.eventhubs", - "args": "--tag=package-2024-01 --stream-style-serialization=false" + "args": "--tag=package-2024-01" }, "eventhubs-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-eventhubs", @@ -131,7 +131,7 @@ "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 --stream-style-serialization=false" + "args": "--tag=v1.0 --graalvm-config-suffix=msgraph --title=MicrosoftGraphClient --models-subpackage=fluent.models" }, "msgraph-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-authorization", @@ -143,7 +143,7 @@ "dir": "azure-resourcemanager-keyvault", "source": "specification/keyvault/resource-manager/readme.md", "package": "com.azure.resourcemanager.keyvault", - "args": "--tag=package-2023-07 --stream-style-serialization=false", + "args": "--tag=package-2023-07", "note": "use local azure-rest-api-specs and remove keys.json, secrets.json and keysManagedHsm.json in README.md tag" }, "keyvault-hybrid": { @@ -207,7 +207,7 @@ "dir": "azure-resourcemanager-privatedns", "source": "specification/privatedns/resource-manager/readme.md", "package": "com.azure.resourcemanager.privatedns", - "args": "--tag=package-2020-06 --stream-style-serialization=false" + "args": "--tag=package-2020-06" }, "redis": { "dir": "azure-resourcemanager-redis", @@ -238,7 +238,7 @@ "dir": "azure-resourcemanager-search", "source": "specification/search/resource-manager/readme.md", "package": "com.azure.resourcemanager.search", - "args": "--tag=package-2023-11 --remove-inner=CheckNameAvailabilityOutput --stream-style-serialization=false" + "args": "--tag=package-2023-11 --remove-inner=CheckNameAvailabilityOutput" }, "servicebus": { "dir": "azure-resourcemanager-servicebus", @@ -258,7 +258,7 @@ "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 --stream-style-serialization=false" + "args": "--tag=package-2023-05 --modelerfour.lenient-model-deduplication --rename-model=AllowedMethods:CorsRuleAllowedMethodsItem,AccountType:ActiveDirectoryPropertiesAccountType --property-include-always=EncryptionIdentity.encryptionUserAssignedIdentity" }, "storage-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-storage", @@ -282,13 +282,13 @@ "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 --stream-style-serialization=false" + "args": "--tag=package-2022-04 --rename-model=EndpointType:EndpointTypes" }, "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 --stream-style-serialization=false" + "args": "--tag=package-2023-01-31 --add-client-flatten=Identity" }, "changes": { "dir": "azure-resourcemanager-resources", From bf6b4bfc7f5f24445c3247c64670ecc6b36f7bbc Mon Sep 17 00:00:00 2001 From: xiaofeicao Date: Fri, 2 Aug 2024 11:12:01 +0800 Subject: [PATCH 02/19] regen storage --- .../storage/fluent/BlobContainersClient.java | 96 +- .../fluent/models/BlobContainerInner.java | 111 +- .../models/BlobInventoryPolicyInner.java | 98 +- .../models/BlobInventoryPolicyProperties.java | 52 +- .../fluent/models/BlobRestoreStatusInner.java | 54 +- .../models/BlobServicePropertiesInner.java | 98 +- .../BlobServicePropertiesProperties.java | 84 +- .../CheckNameAvailabilityResultInner.java | 52 +- .../fluent/models/ContainerProperties.java | 113 +- .../fluent/models/DeletedAccountInner.java | 94 +- .../models/DeletedAccountProperties.java | 56 +- .../fluent/models/EncryptionScopeInner.java | 95 +- .../models/EncryptionScopeProperties.java | 68 +- .../fluent/models/FileServiceItemsInner.java | 46 +- .../models/FileServicePropertiesInner.java | 98 +- .../FileServicePropertiesProperties.java | 55 +- .../storage/fluent/models/FileShareInner.java | 111 +- .../fluent/models/FileShareItemInner.java | 111 +- .../fluent/models/FileShareProperties.java | 113 +- .../models/ImmutabilityPolicyInner.java | 111 +- .../models/ImmutabilityPolicyProperty.java | 61 +- .../models/LeaseContainerResponseInner.java | 49 +- .../models/LeaseShareResponseInner.java | 49 +- .../storage/fluent/models/LegalHoldInner.java | 55 +- .../models/ListAccountSasResponseInner.java | 44 +- .../fluent/models/ListContainerItemInner.java | 111 +- .../storage/fluent/models/ListQueueInner.java | 94 +- .../fluent/models/ListQueueProperties.java | 48 +- .../fluent/models/ListQueueServicesInner.java | 46 +- .../models/ListServiceSasResponseInner.java | 44 +- .../fluent/models/ListTableServicesInner.java | 46 +- .../storage/fluent/models/LocalUserInner.java | 97 +- .../fluent/models/LocalUserKeysInner.java | 50 +- .../fluent/models/LocalUserProperties.java | 94 +- ...ocalUserRegeneratePasswordResultInner.java | 46 +- .../fluent/models/ManagementPolicyInner.java | 94 +- .../models/ManagementPolicyProperties.java | 51 +- ...rkSecurityPerimeterConfigurationInner.java | 98 +- ...urityPerimeterConfigurationProperties.java | 64 +- .../models/ObjectReplicationPolicyInner.java | 95 +- .../ObjectReplicationPolicyProperties.java | 65 +- .../storage/fluent/models/OperationInner.java | 57 +- .../fluent/models/OperationProperties.java | 45 +- .../PrivateEndpointConnectionInner.java | 96 +- .../PrivateEndpointConnectionProperties.java | 57 +- .../PrivateLinkResourceListResultInner.java | 48 +- .../models/PrivateLinkResourceProperties.java | 55 +- .../fluent/models/QueueProperties.java | 51 +- .../models/QueueServicePropertiesInner.java | 95 +- .../QueueServicePropertiesProperties.java | 46 +- .../fluent/models/SkuInformationInner.java | 68 +- .../fluent/models/StorageAccountInner.java | 115 +- .../StorageAccountListKeysResultInner.java | 46 +- .../models/StorageAccountMigrationInner.java | 58 +- .../StorageAccountMigrationProperties.java | 58 +- ...rageAccountPropertiesCreateParameters.java | 164 +- .../models/StorageAccountPropertiesInner.java | 218 ++- ...rageAccountPropertiesUpdateParameters.java | 154 +- .../fluent/models/StorageQueueInner.java | 94 +- .../models/StorageTaskAssignmentInner.java | 95 +- .../StorageTaskReportInstanceInner.java | 96 +- .../storage/fluent/models/TableInner.java | 94 +- .../fluent/models/TableProperties.java | 51 +- .../models/TableServicePropertiesInner.java | 95 +- .../TableServicePropertiesProperties.java | 46 +- .../storage/fluent/models/UsageInner.java | 53 +- .../BlobContainersClientImpl.java | 126 +- .../storage/models/AccessPolicy.java | 59 +- .../storage/models/AccessTier.java | 5 - .../AccountImmutabilityPolicyProperties.java | 59 +- .../AccountImmutabilityPolicyState.java | 2 - .../storage/models/AccountSasParameters.java | 85 +- .../storage/models/AccountStatus.java | 5 - .../storage/models/Action.java | 5 - .../models/ActiveDirectoryProperties.java | 75 +- .../ActiveDirectoryPropertiesAccountType.java | 2 - .../storage/models/AllowedCopyScope.java | 2 - .../storage/models/AzureEntityResource.java | 104 +- ...AzureFilesIdentityBasedAuthentication.java | 61 +- ...eateOrUpdateImmutabilityPolicyHeaders.java | 2 - ...ainersDeleteImmutabilityPolicyHeaders.java | 2 - ...ainersExtendImmutabilityPolicyHeaders.java | 2 - ...ontainersGetImmutabilityPolicyHeaders.java | 2 - ...ntainersLockImmutabilityPolicyHeaders.java | 2 - .../models/BlobInventoryCreationTime.java | 45 +- .../models/BlobInventoryPolicyDefinition.java | 64 +- .../models/BlobInventoryPolicyFilter.java | 74 +- .../models/BlobInventoryPolicyName.java | 2 - .../models/BlobInventoryPolicyRule.java | 58 +- .../models/BlobInventoryPolicySchema.java | 59 +- .../storage/models/BlobRestoreParameters.java | 55 +- .../models/BlobRestoreProgressStatus.java | 2 - .../storage/models/BlobRestoreRange.java | 50 +- .../storage/models/BlobServiceItems.java | 46 +- .../storage/models/Bypass.java | 2 - .../storage/models/ChangeFeed.java | 49 +- .../storage/models/CorsRule.java | 71 +- .../models/CorsRuleAllowedMethodsItem.java | 2 - .../storage/models/CorsRules.java | 46 +- .../storage/models/CustomDomain.java | 50 +- .../storage/models/DateAfterCreation.java | 51 +- .../storage/models/DateAfterModification.java | 61 +- .../storage/models/DefaultAction.java | 5 - .../models/DefaultSharePermission.java | 2 - .../storage/models/DeleteRetentionPolicy.java | 53 +- .../models/DeletedAccountListResult.java | 49 +- .../storage/models/DeletedShare.java | 50 +- .../storage/models/Dimension.java | 49 +- .../models/DirectoryServiceOptions.java | 2 - .../storage/models/DnsEndpointType.java | 2 - .../storage/models/EnabledProtocols.java | 2 - .../storage/models/Encryption.java | 61 +- .../storage/models/EncryptionIdentity.java | 51 +- .../EncryptionScopeKeyVaultProperties.java | 54 +- .../models/EncryptionScopeListResult.java | 49 +- .../storage/models/EncryptionScopeSource.java | 2 - .../storage/models/EncryptionScopeState.java | 2 - .../storage/models/EncryptionService.java | 54 +- .../storage/models/EncryptionServices.java | 57 +- .../storage/models/Endpoints.java | 67 +- .../storage/models/ExecutionTarget.java | 52 +- .../storage/models/ExecutionTrigger.java | 50 +- .../models/ExecutionTriggerUpdate.java | 49 +- .../storage/models/ExpirationAction.java | 2 - .../storage/models/ExtendedLocation.java | 49 +- .../storage/models/ExtendedLocationTypes.java | 2 - .../storage/models/FailoverType.java | 5 - .../storage/models/FileShareItems.java | 48 +- .../models/FileSharesLeaseHeaders.java | 2 - .../storage/models/Format.java | 2 - .../storage/models/GeoReplicationStats.java | 63 +- .../storage/models/GeoReplicationStatus.java | 2 - .../storage/models/HttpProtocol.java | 5 - .../storage/models/Identity.java | 61 +- .../storage/models/IdentityType.java | 2 - .../models/ImmutabilityPolicyProperties.java | 54 +- .../models/ImmutabilityPolicyState.java | 2 - .../models/ImmutabilityPolicyUpdateType.java | 2 - .../models/ImmutableStorageAccount.java | 50 +- .../ImmutableStorageWithVersioning.java | 55 +- .../storage/models/IntervalUnit.java | 5 - .../storage/models/InventoryRuleType.java | 2 - .../storage/models/IpRule.java | 50 +- .../storage/models/IssueType.java | 2 - .../storage/models/KeyCreationTime.java | 55 +- .../storage/models/KeyPermission.java | 5 - .../storage/models/KeyPolicy.java | 46 +- .../storage/models/KeySource.java | 2 - .../storage/models/KeyType.java | 2 - .../storage/models/KeyVaultProperties.java | 65 +- .../resourcemanager/storage/models/Kind.java | 2 - .../storage/models/LargeFileSharesState.java | 2 - .../models/LastAccessTimeTrackingPolicy.java | 60 +- .../storage/models/LeaseContainerRequest.java | 63 +- .../models/LeaseContainerRequestAction.java | 2 - .../storage/models/LeaseDuration.java | 2 - .../storage/models/LeaseShareAction.java | 2 - .../storage/models/LeaseShareRequest.java | 62 +- .../storage/models/LeaseState.java | 2 - .../storage/models/LeaseStatus.java | 2 - .../storage/models/LegalHoldProperties.java | 54 +- .../models/ListBlobInventoryPolicy.java | 46 +- .../storage/models/ListContainerItems.java | 49 +- .../storage/models/ListContainersInclude.java | 2 - .../models/ListEncryptionScopesInclude.java | 2 - .../storage/models/ListKeyExpand.java | 5 - .../models/ListLocalUserIncludeParam.java | 2 - .../storage/models/ListQueueResource.java | 48 +- .../storage/models/ListTableResource.java | 48 +- .../storage/models/LocalUsers.java | 49 +- .../models/ManagementPolicyAction.java | 53 +- .../models/ManagementPolicyBaseBlob.java | 66 +- .../models/ManagementPolicyDefinition.java | 50 +- .../models/ManagementPolicyFilter.java | 58 +- .../storage/models/ManagementPolicyName.java | 2 - .../storage/models/ManagementPolicyRule.java | 58 +- .../models/ManagementPolicySchema.java | 48 +- .../models/ManagementPolicySnapShot.java | 61 +- .../models/ManagementPolicyVersion.java | 61 +- .../storage/models/MetricSpecification.java | 78 +- .../storage/models/MigrationName.java | 2 - .../storage/models/MigrationState.java | 2 - .../storage/models/MigrationStatus.java | 2 - .../storage/models/MinimumTlsVersion.java | 2 - .../storage/models/Multichannel.java | 45 +- .../resourcemanager/storage/models/Name.java | 2 - .../storage/models/NetworkRuleSet.java | 69 +- .../models/NetworkSecurityPerimeter.java | 53 +- ...orkSecurityPerimeterConfigurationList.java | 52 +- ...rimeterConfigurationPropertiesProfile.java | 70 +- ...gurationPropertiesResourceAssociation.java | 55 +- ...rimeterConfigurationProvisioningState.java | 2 - .../storage/models/NspAccessRule.java | 48 +- .../models/NspAccessRuleDirection.java | 2 - .../models/NspAccessRuleProperties.java | 67 +- ...AccessRulePropertiesSubscriptionsItem.java | 47 +- .../models/ObjectReplicationPolicies.java | 47 +- .../models/ObjectReplicationPolicyFilter.java | 51 +- .../models/ObjectReplicationPolicyRule.java | 58 +- .../storage/models/ObjectType.java | 2 - .../storage/models/OperationDisplay.java | 57 +- .../storage/models/OperationListResult.java | 46 +- .../storage/models/PermissionScope.java | 54 +- .../storage/models/Permissions.java | 2 - .../models/PostFailoverRedundancy.java | 2 - .../models/PostPlannedFailoverRedundancy.java | 2 - .../storage/models/PrivateEndpoint.java | 44 +- .../PrivateEndpointConnectionListResult.java | 49 +- ...teEndpointConnectionProvisioningState.java | 2 - ...rivateEndpointServiceConnectionStatus.java | 2 - .../storage/models/PrivateLinkResource.java | 94 +- .../PrivateLinkServiceConnectionState.java | 55 +- .../models/ProtectedAppendWritesHistory.java | 51 +- .../storage/models/ProtocolSettings.java | 45 +- .../storage/models/ProvisioningIssue.java | 48 +- .../models/ProvisioningIssueProperties.java | 53 +- .../storage/models/ProvisioningState.java | 5 - .../storage/models/PublicAccess.java | 5 - .../storage/models/PublicNetworkAccess.java | 2 - .../storage/models/Reason.java | 5 - .../storage/models/ReasonCode.java | 2 - .../storage/models/ResourceAccessRule.java | 49 +- .../models/ResourceAssociationAccessMode.java | 2 - .../models/RestorePolicyProperties.java | 59 +- .../storage/models/Restriction.java | 52 +- .../storage/models/RootSquashType.java | 2 - .../storage/models/RoutingChoice.java | 2 - .../storage/models/RoutingPreference.java | 54 +- .../storage/models/RuleType.java | 2 - .../storage/models/RunResult.java | 2 - .../storage/models/RunStatusEnum.java | 2 - .../storage/models/SasPolicy.java | 51 +- .../storage/models/Schedule.java | 2 - .../storage/models/ServiceSasParameters.java | 124 +- .../storage/models/ServiceSpecification.java | 48 +- .../storage/models/Services.java | 2 - .../storage/models/Severity.java | 2 - .../storage/models/ShareAccessTier.java | 2 - .../storage/models/SignedIdentifier.java | 49 +- .../storage/models/SignedResource.java | 2 - .../storage/models/SignedResourceTypes.java | 2 - .../resourcemanager/storage/models/Sku.java | 49 +- .../storage/models/SkuCapability.java | 47 +- .../storage/models/SkuConversionStatus.java | 2 - .../storage/models/SkuName.java | 2 - .../storage/models/SkuTier.java | 5 - .../storage/models/SmbSetting.java | 61 +- .../storage/models/SshPublicKey.java | 49 +- .../resourcemanager/storage/models/State.java | 2 - ...ccountCheckNameAvailabilityParameters.java | 50 +- .../StorageAccountCreateParameters.java | 75 +- .../storage/models/StorageAccountExpand.java | 5 - .../StorageAccountInternetEndpoints.java | 54 +- .../storage/models/StorageAccountKey.java | 55 +- .../models/StorageAccountListResult.java | 49 +- .../StorageAccountMicrosoftEndpoints.java | 60 +- ...StorageAccountRegenerateKeyParameters.java | 48 +- .../StorageAccountSkuConversionStatus.java | 57 +- .../StorageAccountUpdateParameters.java | 66 +- .../storage/models/StorageSkuListResult.java | 46 +- ...StorageTaskAssignmentExecutionContext.java | 52 +- .../StorageTaskAssignmentProperties.java | 73 +- .../models/StorageTaskAssignmentReport.java | 46 +- ...eTaskAssignmentUpdateExecutionContext.java | 52 +- ...StorageTaskAssignmentUpdateParameters.java | 48 +- ...StorageTaskAssignmentUpdateProperties.java | 74 +- .../StorageTaskAssignmentUpdateReport.java | 46 +- .../models/StorageTaskAssignmentsList.java | 49 +- .../models/StorageTaskReportProperties.java | 84 +- .../models/StorageTaskReportSummary.java | 49 +- .../storage/models/TableAccessPolicy.java | 60 +- .../storage/models/TableSignedIdentifier.java | 50 +- .../storage/models/TagFilter.java | 54 +- .../storage/models/TagProperty.java | 58 +- .../storage/models/TriggerParameters.java | 69 +- .../models/TriggerParametersUpdate.java | 69 +- .../storage/models/TriggerType.java | 5 - .../storage/models/UpdateHistoryProperty.java | 73 +- .../storage/models/UsageListResult.java | 46 +- .../storage/models/UsageName.java | 47 +- .../storage/models/UsageUnit.java | 5 - .../storage/models/UserAssignedIdentity.java | 47 +- .../storage/models/VirtualNetworkRule.java | 54 +- .../proxy-config.json | 2 +- .../reflect-config.json | 1407 +---------------- 285 files changed, 11403 insertions(+), 2811 deletions(-) diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java index cb2950aaf714c..820b347c0d37e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java @@ -613,9 +613,9 @@ LegalHoldInner clearLegalHold(String resourceGroupName, String accountName, Stri * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -660,9 +660,9 @@ Mono createOrUpdateImmutabilityPolicyAsync(String resou * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -705,9 +705,9 @@ ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy(String resourceGroupNam * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -748,9 +748,9 @@ Mono getImmutabilityPolicyAsync(String resourceGroupNam * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -791,9 +791,9 @@ BlobContainersGetImmutabilityPolicyResponse getImmutabilityPolicyWithResponse(St * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -816,9 +816,9 @@ Mono deleteImmutabilityPolicyWit * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -841,9 +841,9 @@ Mono deleteImmutabilityPolicyAsync(String resourceGroup * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -866,9 +866,9 @@ BlobContainersDeleteImmutabilityPolicyResponse deleteImmutabilityPolicyWithRespo * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -889,9 +889,9 @@ ImmutabilityPolicyInner deleteImmutabilityPolicy(String resourceGroupName, Strin * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -913,9 +913,9 @@ Mono lockImmutabilityPolicyWithRes * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -937,9 +937,9 @@ Mono lockImmutabilityPolicyAsync(String resourceGroupNa * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -961,9 +961,9 @@ BlobContainersLockImmutabilityPolicyResponse lockImmutabilityPolicyWithResponse( * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -984,9 +984,9 @@ ImmutabilityPolicyInner lockImmutabilityPolicy(String resourceGroupName, String * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -1010,9 +1010,9 @@ Mono extendImmutabilityPolicyWit * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -1034,9 +1034,9 @@ Mono extendImmutabilityPolicyAsync(String resourceGroup * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1059,9 +1059,9 @@ BlobContainersExtendImmutabilityPolicyResponse extendImmutabilityPolicyWithRespo * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobContainerInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobContainerInner.java index 9dd6997bde46c..c548bbcd26f5d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobContainerInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobContainerInner.java @@ -5,6 +5,9 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.storage.models.AzureEntityResource; import com.azure.resourcemanager.storage.models.ImmutabilityPolicyProperties; import com.azure.resourcemanager.storage.models.ImmutableStorageWithVersioning; @@ -13,7 +16,7 @@ import com.azure.resourcemanager.storage.models.LeaseStatus; import com.azure.resourcemanager.storage.models.LegalHoldProperties; import com.azure.resourcemanager.storage.models.PublicAccess; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; @@ -25,9 +28,28 @@ public final class BlobContainerInner extends AzureEntityResource { /* * Properties of the blob container. */ - @JsonProperty(value = "properties") private ContainerProperties innerContainerProperties; + /* + * 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; + + /* + * Resource Etag. + */ + private String etag; + /** * Creates an instance of BlobContainerInner class. */ @@ -43,6 +65,46 @@ private ContainerProperties innerContainerProperties() { return this.innerContainerProperties; } + /** + * 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 etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + /** * Get the version property: The version of the deleted blob container. * @@ -344,4 +406,49 @@ public void validate() { innerContainerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerContainerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobContainerInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobContainerInner 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 BlobContainerInner. + */ + public static BlobContainerInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobContainerInner deserializedBlobContainerInner = new BlobContainerInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBlobContainerInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBlobContainerInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBlobContainerInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedBlobContainerInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBlobContainerInner.innerContainerProperties = ContainerProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobContainerInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyInner.java index cdbb6169626e3..122d8bf22a66c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyInner.java @@ -7,8 +7,11 @@ 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.storage.models.BlobInventoryPolicySchema; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -19,15 +22,28 @@ public final class BlobInventoryPolicyInner extends ProxyResource { /* * Returns the storage account blob inventory policy rules. */ - @JsonProperty(value = "properties") private BlobInventoryPolicyProperties innerProperties; /* * Metadata pertaining to creation and last modification of the 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 BlobInventoryPolicyInner class. */ @@ -52,6 +68,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 lastModifiedTime property: Returns the last modified date and time of the blob inventory policy. * @@ -94,4 +140,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 BlobInventoryPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicyInner 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 BlobInventoryPolicyInner. + */ + public static BlobInventoryPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicyInner deserializedBlobInventoryPolicyInner = new BlobInventoryPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBlobInventoryPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBlobInventoryPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBlobInventoryPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBlobInventoryPolicyInner.innerProperties + = BlobInventoryPolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBlobInventoryPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicyInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyProperties.java index eb9b9b1685373..163f55655c80c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyProperties.java @@ -5,26 +5,29 @@ package com.azure.resourcemanager.storage.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.storage.models.BlobInventoryPolicySchema; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** * The storage account blob inventory policy properties. */ @Fluent -public final class BlobInventoryPolicyProperties { +public final class BlobInventoryPolicyProperties implements JsonSerializable { /* * Returns the last modified date and time of the blob inventory policy. */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastModifiedTime; /* * The storage account blob inventory policy object. It is composed of policy rules. */ - @JsonProperty(value = "policy", required = true) private BlobInventoryPolicySchema policy; /** @@ -78,4 +81,45 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicyProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("policy", this.policy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicyProperties 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 BlobInventoryPolicyProperties. + */ + public static BlobInventoryPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicyProperties deserializedBlobInventoryPolicyProperties + = new BlobInventoryPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policy".equals(fieldName)) { + deserializedBlobInventoryPolicyProperties.policy = BlobInventoryPolicySchema.fromJson(reader); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedBlobInventoryPolicyProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicyProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobRestoreStatusInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobRestoreStatusInner.java index 096661bdda477..8735a4ce8bdc2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobRestoreStatusInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobRestoreStatusInner.java @@ -5,39 +5,39 @@ package com.azure.resourcemanager.storage.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.storage.models.BlobRestoreParameters; import com.azure.resourcemanager.storage.models.BlobRestoreProgressStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Blob restore status. */ @Immutable -public final class BlobRestoreStatusInner { +public final class BlobRestoreStatusInner implements JsonSerializable { /* * The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - * Complete: Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is * failed. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private BlobRestoreProgressStatus status; /* * Failure reason when blob restore is failed. */ - @JsonProperty(value = "failureReason", access = JsonProperty.Access.WRITE_ONLY) private String failureReason; /* * Id for tracking blob restore request. */ - @JsonProperty(value = "restoreId", access = JsonProperty.Access.WRITE_ONLY) private String restoreId; /* * Blob restore request parameters. */ - @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) private BlobRestoreParameters parameters; /** @@ -94,4 +94,46 @@ public void validate() { parameters().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobRestoreStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobRestoreStatusInner 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 BlobRestoreStatusInner. + */ + public static BlobRestoreStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobRestoreStatusInner deserializedBlobRestoreStatusInner = new BlobRestoreStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedBlobRestoreStatusInner.status + = BlobRestoreProgressStatus.fromString(reader.getString()); + } else if ("failureReason".equals(fieldName)) { + deserializedBlobRestoreStatusInner.failureReason = reader.getString(); + } else if ("restoreId".equals(fieldName)) { + deserializedBlobRestoreStatusInner.restoreId = reader.getString(); + } else if ("parameters".equals(fieldName)) { + deserializedBlobRestoreStatusInner.parameters = BlobRestoreParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobRestoreStatusInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesInner.java index 7e0b308f033c9..9ca50ef4dbe62 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesInner.java @@ -6,13 +6,16 @@ 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.storage.models.ChangeFeed; import com.azure.resourcemanager.storage.models.CorsRules; import com.azure.resourcemanager.storage.models.DeleteRetentionPolicy; import com.azure.resourcemanager.storage.models.LastAccessTimeTrackingPolicy; import com.azure.resourcemanager.storage.models.RestorePolicyProperties; import com.azure.resourcemanager.storage.models.Sku; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of a storage account’s Blob service. @@ -22,15 +25,28 @@ public final class BlobServicePropertiesInner extends ProxyResource { /* * The properties of a storage account’s Blob service. */ - @JsonProperty(value = "properties") private BlobServicePropertiesProperties innerBlobServiceProperties; /* * Sku name and tier. */ - @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) private Sku sku; + /* + * 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 BlobServicePropertiesInner class. */ @@ -55,6 +71,36 @@ public Sku sku() { return this.sku; } + /** + * 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 cors property: Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS @@ -299,4 +345,50 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerBlobServiceProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobServicePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobServicePropertiesInner 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 BlobServicePropertiesInner. + */ + public static BlobServicePropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobServicePropertiesInner deserializedBlobServicePropertiesInner = new BlobServicePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBlobServicePropertiesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBlobServicePropertiesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBlobServicePropertiesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBlobServicePropertiesInner.innerBlobServiceProperties + = BlobServicePropertiesProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedBlobServicePropertiesInner.sku = Sku.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobServicePropertiesInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesProperties.java index 89a1dc261d230..b3a6c7b017a95 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesProperties.java @@ -5,73 +5,68 @@ package com.azure.resourcemanager.storage.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.storage.models.ChangeFeed; import com.azure.resourcemanager.storage.models.CorsRules; import com.azure.resourcemanager.storage.models.DeleteRetentionPolicy; import com.azure.resourcemanager.storage.models.LastAccessTimeTrackingPolicy; import com.azure.resourcemanager.storage.models.RestorePolicyProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of a storage account’s Blob service. */ @Fluent -public final class BlobServicePropertiesProperties { +public final class BlobServicePropertiesProperties implements JsonSerializable { /* * Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no * CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for * the Blob service. */ - @JsonProperty(value = "cors") private CorsRules cors; /* * DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming * request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions. */ - @JsonProperty(value = "defaultServiceVersion") private String defaultServiceVersion; /* * The blob service properties for blob soft delete. */ - @JsonProperty(value = "deleteRetentionPolicy") private DeleteRetentionPolicy deleteRetentionPolicy; /* * Versioning is enabled if set to true. */ - @JsonProperty(value = "isVersioningEnabled") private Boolean isVersioningEnabled; /* * Deprecated in favor of isVersioningEnabled property. */ - @JsonProperty(value = "automaticSnapshotPolicyEnabled") private Boolean automaticSnapshotPolicyEnabled; /* * The blob service properties for change feed events. */ - @JsonProperty(value = "changeFeed") private ChangeFeed changeFeed; /* * The blob service properties for blob restore policy. */ - @JsonProperty(value = "restorePolicy") private RestorePolicyProperties restorePolicy; /* * The blob service properties for container soft delete. */ - @JsonProperty(value = "containerDeleteRetentionPolicy") private DeleteRetentionPolicy containerDeleteRetentionPolicy; /* * The blob service property to configure last access time based tracking policy. */ - @JsonProperty(value = "lastAccessTimeTrackingPolicy") private LastAccessTimeTrackingPolicy lastAccessTimeTrackingPolicy; /** @@ -297,4 +292,71 @@ public void validate() { lastAccessTimeTrackingPolicy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cors", this.cors); + jsonWriter.writeStringField("defaultServiceVersion", this.defaultServiceVersion); + jsonWriter.writeJsonField("deleteRetentionPolicy", this.deleteRetentionPolicy); + jsonWriter.writeBooleanField("isVersioningEnabled", this.isVersioningEnabled); + jsonWriter.writeBooleanField("automaticSnapshotPolicyEnabled", this.automaticSnapshotPolicyEnabled); + jsonWriter.writeJsonField("changeFeed", this.changeFeed); + jsonWriter.writeJsonField("restorePolicy", this.restorePolicy); + jsonWriter.writeJsonField("containerDeleteRetentionPolicy", this.containerDeleteRetentionPolicy); + jsonWriter.writeJsonField("lastAccessTimeTrackingPolicy", this.lastAccessTimeTrackingPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobServicePropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobServicePropertiesProperties 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 BlobServicePropertiesProperties. + */ + public static BlobServicePropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobServicePropertiesProperties deserializedBlobServicePropertiesProperties + = new BlobServicePropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cors".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.cors = CorsRules.fromJson(reader); + } else if ("defaultServiceVersion".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.defaultServiceVersion = reader.getString(); + } else if ("deleteRetentionPolicy".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.deleteRetentionPolicy + = DeleteRetentionPolicy.fromJson(reader); + } else if ("isVersioningEnabled".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.isVersioningEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("automaticSnapshotPolicyEnabled".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.automaticSnapshotPolicyEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("changeFeed".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.changeFeed = ChangeFeed.fromJson(reader); + } else if ("restorePolicy".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.restorePolicy + = RestorePolicyProperties.fromJson(reader); + } else if ("containerDeleteRetentionPolicy".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.containerDeleteRetentionPolicy + = DeleteRetentionPolicy.fromJson(reader); + } else if ("lastAccessTimeTrackingPolicy".equals(fieldName)) { + deserializedBlobServicePropertiesProperties.lastAccessTimeTrackingPolicy + = LastAccessTimeTrackingPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobServicePropertiesProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/CheckNameAvailabilityResultInner.java index a8b7173ec2e12..841489cd0c34c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/CheckNameAvailabilityResultInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/CheckNameAvailabilityResultInner.java @@ -5,32 +5,33 @@ package com.azure.resourcemanager.storage.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.storage.models.Reason; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The CheckNameAvailability operation response. */ @Immutable -public final class CheckNameAvailabilityResultInner { +public final class CheckNameAvailabilityResultInner implements JsonSerializable { /* * Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. * If false, the name has already been taken or is invalid and cannot be used. */ - @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) private Boolean nameAvailable; /* * Gets the reason that a storage account name could not be used. The Reason element is only returned if * NameAvailable is false. */ - @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) private Reason reason; /* * Gets an error message explaining the Reason value in more detail. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; /** @@ -75,4 +76,45 @@ public String message() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityResultInner. + */ + public static CheckNameAvailabilityResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityResultInner deserializedCheckNameAvailabilityResultInner + = new CheckNameAvailabilityResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.reason = Reason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityResultInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ContainerProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ContainerProperties.java index e1e614af79bfa..a97770859c70c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ContainerProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ContainerProperties.java @@ -5,6 +5,11 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.storage.models.ImmutabilityPolicyProperties; import com.azure.resourcemanager.storage.models.ImmutableStorageWithVersioning; import com.azure.resourcemanager.storage.models.LeaseDuration; @@ -12,8 +17,7 @@ import com.azure.resourcemanager.storage.models.LeaseStatus; import com.azure.resourcemanager.storage.models.LegalHoldProperties; import com.azure.resourcemanager.storage.models.PublicAccess; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; @@ -21,90 +25,75 @@ * The properties of a container. */ @Fluent -public final class ContainerProperties { +public final class ContainerProperties implements JsonSerializable { /* * The version of the deleted blob container. */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) private String version; /* * Indicates whether the blob container was deleted. */ - @JsonProperty(value = "deleted", access = JsonProperty.Access.WRITE_ONLY) private Boolean deleted; /* * Blob container deletion time. */ - @JsonProperty(value = "deletedTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime deletedTime; /* * Remaining retention days for soft deleted blob container. */ - @JsonProperty(value = "remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) private Integer remainingRetentionDays; /* * Default the container to use specified encryption scope for all writes. */ - @JsonProperty(value = "defaultEncryptionScope") private String defaultEncryptionScope; /* * Block override of encryption scope from the container default. */ - @JsonProperty(value = "denyEncryptionScopeOverride") private Boolean denyEncryptionScopeOverride; /* * Specifies whether data in the container may be accessed publicly and the level of access. */ - @JsonProperty(value = "publicAccess") private PublicAccess publicAccess; /* * Returns the date and time the container was last modified. */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastModifiedTime; /* * The lease status of the container. */ - @JsonProperty(value = "leaseStatus", access = JsonProperty.Access.WRITE_ONLY) private LeaseStatus leaseStatus; /* * Lease state of the container. */ - @JsonProperty(value = "leaseState", access = JsonProperty.Access.WRITE_ONLY) private LeaseState leaseState; /* * Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. */ - @JsonProperty(value = "leaseDuration", access = JsonProperty.Access.WRITE_ONLY) private LeaseDuration leaseDuration; /* * A name-value pair to associate with the container as metadata. */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map metadata; /* * The ImmutabilityPolicy property of the container. */ - @JsonProperty(value = "immutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) private ImmutabilityPolicyProperties immutabilityPolicy; /* * The LegalHold property of the container. */ - @JsonProperty(value = "legalHold", access = JsonProperty.Access.WRITE_ONLY) private LegalHoldProperties legalHold; /* @@ -112,7 +101,6 @@ public final class ContainerProperties { * public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of * 1000 blob containers with hasLegalHold=true for a given account. */ - @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) private Boolean hasLegalHold; /* @@ -120,26 +108,22 @@ public final class ContainerProperties { * container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been * created for this container. */ - @JsonProperty(value = "hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) private Boolean hasImmutabilityPolicy; /* * The object level immutability property of the container. The property is immutable and can only be set to true at * the container creation time. Existing containers must undergo a migration process. */ - @JsonProperty(value = "immutableStorageWithVersioning") private ImmutableStorageWithVersioning immutableStorageWithVersioning; /* * Enable NFSv3 root squash on blob container. */ - @JsonProperty(value = "enableNfsV3RootSquash") private Boolean enableNfsV3RootSquash; /* * Enable NFSv3 all squash on blob container. */ - @JsonProperty(value = "enableNfsV3AllSquash") private Boolean enableNfsV3AllSquash; /** @@ -424,4 +408,87 @@ public void validate() { immutableStorageWithVersioning().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultEncryptionScope", this.defaultEncryptionScope); + jsonWriter.writeBooleanField("denyEncryptionScopeOverride", this.denyEncryptionScopeOverride); + jsonWriter.writeStringField("publicAccess", this.publicAccess == null ? null : this.publicAccess.toString()); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("immutableStorageWithVersioning", this.immutableStorageWithVersioning); + jsonWriter.writeBooleanField("enableNfsV3RootSquash", this.enableNfsV3RootSquash); + jsonWriter.writeBooleanField("enableNfsV3AllSquash", this.enableNfsV3AllSquash); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContainerProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContainerProperties 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 ContainerProperties. + */ + public static ContainerProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ContainerProperties deserializedContainerProperties = new ContainerProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedContainerProperties.version = reader.getString(); + } else if ("deleted".equals(fieldName)) { + deserializedContainerProperties.deleted = reader.getNullable(JsonReader::getBoolean); + } else if ("deletedTime".equals(fieldName)) { + deserializedContainerProperties.deletedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("remainingRetentionDays".equals(fieldName)) { + deserializedContainerProperties.remainingRetentionDays = reader.getNullable(JsonReader::getInt); + } else if ("defaultEncryptionScope".equals(fieldName)) { + deserializedContainerProperties.defaultEncryptionScope = reader.getString(); + } else if ("denyEncryptionScopeOverride".equals(fieldName)) { + deserializedContainerProperties.denyEncryptionScopeOverride + = reader.getNullable(JsonReader::getBoolean); + } else if ("publicAccess".equals(fieldName)) { + deserializedContainerProperties.publicAccess = PublicAccess.fromString(reader.getString()); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedContainerProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("leaseStatus".equals(fieldName)) { + deserializedContainerProperties.leaseStatus = LeaseStatus.fromString(reader.getString()); + } else if ("leaseState".equals(fieldName)) { + deserializedContainerProperties.leaseState = LeaseState.fromString(reader.getString()); + } else if ("leaseDuration".equals(fieldName)) { + deserializedContainerProperties.leaseDuration = LeaseDuration.fromString(reader.getString()); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedContainerProperties.metadata = metadata; + } else if ("immutabilityPolicy".equals(fieldName)) { + deserializedContainerProperties.immutabilityPolicy = ImmutabilityPolicyProperties.fromJson(reader); + } else if ("legalHold".equals(fieldName)) { + deserializedContainerProperties.legalHold = LegalHoldProperties.fromJson(reader); + } else if ("hasLegalHold".equals(fieldName)) { + deserializedContainerProperties.hasLegalHold = reader.getNullable(JsonReader::getBoolean); + } else if ("hasImmutabilityPolicy".equals(fieldName)) { + deserializedContainerProperties.hasImmutabilityPolicy = reader.getNullable(JsonReader::getBoolean); + } else if ("immutableStorageWithVersioning".equals(fieldName)) { + deserializedContainerProperties.immutableStorageWithVersioning + = ImmutableStorageWithVersioning.fromJson(reader); + } else if ("enableNfsV3RootSquash".equals(fieldName)) { + deserializedContainerProperties.enableNfsV3RootSquash = reader.getNullable(JsonReader::getBoolean); + } else if ("enableNfsV3AllSquash".equals(fieldName)) { + deserializedContainerProperties.enableNfsV3AllSquash = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedContainerProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DeletedAccountInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DeletedAccountInner.java index 7c84244c6e57d..388cfe4a037a8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DeletedAccountInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DeletedAccountInner.java @@ -6,7 +6,10 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Deleted storage account. @@ -16,9 +19,23 @@ public final class DeletedAccountInner extends ProxyResource { /* * Properties of the deleted account. */ - @JsonProperty(value = "properties") private DeletedAccountProperties 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 DeletedAccountInner class. */ @@ -34,6 +51,36 @@ private DeletedAccountProperties 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 storageAccountResourceId property: Full resource id of the original storage account. * @@ -90,4 +137,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 DeletedAccountInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedAccountInner 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 DeletedAccountInner. + */ + public static DeletedAccountInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedAccountInner deserializedDeletedAccountInner = new DeletedAccountInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDeletedAccountInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDeletedAccountInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDeletedAccountInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeletedAccountInner.innerProperties = DeletedAccountProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedAccountInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DeletedAccountProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DeletedAccountProperties.java index 1a77638a10cea..5334eaf406e52 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DeletedAccountProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DeletedAccountProperties.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Attributes of a deleted storage account. */ @Immutable -public final class DeletedAccountProperties { +public final class DeletedAccountProperties implements JsonSerializable { /* * Full resource id of the original storage account. */ - @JsonProperty(value = "storageAccountResourceId", access = JsonProperty.Access.WRITE_ONLY) private String storageAccountResourceId; /* * Location of the deleted account. */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; /* * Can be used to attempt recovering this deleted account via PutStorageAccount API. */ - @JsonProperty(value = "restoreReference", access = JsonProperty.Access.WRITE_ONLY) private String restoreReference; /* * Creation time of the deleted account. */ - @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) private String creationTime; /* * Deletion time of the deleted account. */ - @JsonProperty(value = "deletionTime", access = JsonProperty.Access.WRITE_ONLY) private String deletionTime; /** @@ -101,4 +100,47 @@ public String deletionTime() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedAccountProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedAccountProperties 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 DeletedAccountProperties. + */ + public static DeletedAccountProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedAccountProperties deserializedDeletedAccountProperties = new DeletedAccountProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageAccountResourceId".equals(fieldName)) { + deserializedDeletedAccountProperties.storageAccountResourceId = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDeletedAccountProperties.location = reader.getString(); + } else if ("restoreReference".equals(fieldName)) { + deserializedDeletedAccountProperties.restoreReference = reader.getString(); + } else if ("creationTime".equals(fieldName)) { + deserializedDeletedAccountProperties.creationTime = reader.getString(); + } else if ("deletionTime".equals(fieldName)) { + deserializedDeletedAccountProperties.deletionTime = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedAccountProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeInner.java index 07213906b9249..857f3b4e2b4be 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeInner.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.storage.models.EncryptionScopeKeyVaultProperties; import com.azure.resourcemanager.storage.models.EncryptionScopeSource; import com.azure.resourcemanager.storage.models.EncryptionScopeState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -20,9 +23,23 @@ public final class EncryptionScopeInner extends ProxyResource { /* * Properties of the encryption scope. */ - @JsonProperty(value = "properties") private EncryptionScopeProperties innerEncryptionScopeProperties; + /* + * 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 EncryptionScopeInner class. */ @@ -38,6 +55,36 @@ private EncryptionScopeProperties innerEncryptionScopeProperties() { return this.innerEncryptionScopeProperties; } + /** + * 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 source property: The provider for the encryption scope. Possible values (case-insensitive): * Microsoft.Storage, Microsoft.KeyVault. @@ -172,4 +219,48 @@ public void validate() { innerEncryptionScopeProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerEncryptionScopeProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionScopeInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionScopeInner 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 EncryptionScopeInner. + */ + public static EncryptionScopeInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionScopeInner deserializedEncryptionScopeInner = new EncryptionScopeInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEncryptionScopeInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEncryptionScopeInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEncryptionScopeInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEncryptionScopeInner.innerEncryptionScopeProperties + = EncryptionScopeProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionScopeInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeProperties.java index da3b935102a0d..fca85188cc724 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeProperties.java @@ -5,53 +5,52 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.storage.models.EncryptionScopeKeyVaultProperties; import com.azure.resourcemanager.storage.models.EncryptionScopeSource; import com.azure.resourcemanager.storage.models.EncryptionScopeState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** * Properties of the encryption scope. */ @Fluent -public final class EncryptionScopeProperties { +public final class EncryptionScopeProperties implements JsonSerializable { /* * The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. */ - @JsonProperty(value = "source") private EncryptionScopeSource source; /* * The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. */ - @JsonProperty(value = "state") private EncryptionScopeState state; /* * Gets the creation date and time of the encryption scope in UTC. */ - @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime creationTime; /* * Gets the last modification date and time of the encryption scope in UTC. */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastModifiedTime; /* * The key vault properties for the encryption scope. This is a required field if encryption scope 'source' * attribute is set to 'Microsoft.KeyVault'. */ - @JsonProperty(value = "keyVaultProperties") private EncryptionScopeKeyVaultProperties keyVaultProperties; /* * A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed * keys for data at rest. */ - @JsonProperty(value = "requireInfrastructureEncryption") private Boolean requireInfrastructureEncryption; /** @@ -174,4 +173,57 @@ public void validate() { keyVaultProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeJsonField("keyVaultProperties", this.keyVaultProperties); + jsonWriter.writeBooleanField("requireInfrastructureEncryption", this.requireInfrastructureEncryption); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionScopeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionScopeProperties 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 EncryptionScopeProperties. + */ + public static EncryptionScopeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionScopeProperties deserializedEncryptionScopeProperties = new EncryptionScopeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("source".equals(fieldName)) { + deserializedEncryptionScopeProperties.source = EncryptionScopeSource.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedEncryptionScopeProperties.state = EncryptionScopeState.fromString(reader.getString()); + } else if ("creationTime".equals(fieldName)) { + deserializedEncryptionScopeProperties.creationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedEncryptionScopeProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("keyVaultProperties".equals(fieldName)) { + deserializedEncryptionScopeProperties.keyVaultProperties + = EncryptionScopeKeyVaultProperties.fromJson(reader); + } else if ("requireInfrastructureEncryption".equals(fieldName)) { + deserializedEncryptionScopeProperties.requireInfrastructureEncryption + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionScopeProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServiceItemsInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServiceItemsInner.java index 4d2ac88499bbf..3a3c82e5088cb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServiceItemsInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServiceItemsInner.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The FileServiceItems model. */ @Immutable -public final class FileServiceItemsInner { +public final class FileServiceItemsInner implements JsonSerializable { /* * List of file services returned. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /** @@ -44,4 +47,41 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileServiceItemsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileServiceItemsInner 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 FileServiceItemsInner. + */ + public static FileServiceItemsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileServiceItemsInner deserializedFileServiceItemsInner = new FileServiceItemsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FileServicePropertiesInner.fromJson(reader1)); + deserializedFileServiceItemsInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedFileServiceItemsInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesInner.java index 7a33183980f8c..6d8e9f77205e5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesInner.java @@ -6,11 +6,14 @@ 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.storage.models.CorsRules; import com.azure.resourcemanager.storage.models.DeleteRetentionPolicy; import com.azure.resourcemanager.storage.models.ProtocolSettings; import com.azure.resourcemanager.storage.models.Sku; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of File services in storage account. @@ -20,15 +23,28 @@ public final class FileServicePropertiesInner extends ProxyResource { /* * The properties of File services in storage account. */ - @JsonProperty(value = "properties") private FileServicePropertiesProperties innerFileServiceProperties; /* * Sku name and tier. */ - @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) private Sku sku; + /* + * 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 FileServicePropertiesInner class. */ @@ -53,6 +69,36 @@ public Sku sku() { return this.sku; } + /** + * 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 cors property: Specifies CORS rules for the File service. You can include up to five CorsRule elements in * the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS @@ -141,4 +187,50 @@ public void validate() { sku().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerFileServiceProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileServicePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileServicePropertiesInner 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 FileServicePropertiesInner. + */ + public static FileServicePropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileServicePropertiesInner deserializedFileServicePropertiesInner = new FileServicePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileServicePropertiesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileServicePropertiesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileServicePropertiesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFileServicePropertiesInner.innerFileServiceProperties + = FileServicePropertiesProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedFileServicePropertiesInner.sku = Sku.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileServicePropertiesInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesProperties.java index 0714936c3afdb..ac4e1b78c630e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesProperties.java @@ -5,34 +5,35 @@ package com.azure.resourcemanager.storage.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.storage.models.CorsRules; import com.azure.resourcemanager.storage.models.DeleteRetentionPolicy; import com.azure.resourcemanager.storage.models.ProtocolSettings; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of File services in storage account. */ @Fluent -public final class FileServicePropertiesProperties { +public final class FileServicePropertiesProperties implements JsonSerializable { /* * Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no * CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for * the File service. */ - @JsonProperty(value = "cors") private CorsRules cors; /* * The file service properties for share soft delete. */ - @JsonProperty(value = "shareDeleteRetentionPolicy") private DeleteRetentionPolicy shareDeleteRetentionPolicy; /* * Protocol settings for file service */ - @JsonProperty(value = "protocolSettings") private ProtocolSettings protocolSettings; /** @@ -122,4 +123,48 @@ public void validate() { protocolSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cors", this.cors); + jsonWriter.writeJsonField("shareDeleteRetentionPolicy", this.shareDeleteRetentionPolicy); + jsonWriter.writeJsonField("protocolSettings", this.protocolSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileServicePropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileServicePropertiesProperties 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 FileServicePropertiesProperties. + */ + public static FileServicePropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileServicePropertiesProperties deserializedFileServicePropertiesProperties + = new FileServicePropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cors".equals(fieldName)) { + deserializedFileServicePropertiesProperties.cors = CorsRules.fromJson(reader); + } else if ("shareDeleteRetentionPolicy".equals(fieldName)) { + deserializedFileServicePropertiesProperties.shareDeleteRetentionPolicy + = DeleteRetentionPolicy.fromJson(reader); + } else if ("protocolSettings".equals(fieldName)) { + deserializedFileServicePropertiesProperties.protocolSettings = ProtocolSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileServicePropertiesProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareInner.java index ca3ace73fa6df..beb2d2e3c1a38 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareInner.java @@ -5,6 +5,9 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.storage.models.AzureEntityResource; import com.azure.resourcemanager.storage.models.EnabledProtocols; import com.azure.resourcemanager.storage.models.LeaseDuration; @@ -13,7 +16,7 @@ import com.azure.resourcemanager.storage.models.RootSquashType; import com.azure.resourcemanager.storage.models.ShareAccessTier; import com.azure.resourcemanager.storage.models.SignedIdentifier; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -26,9 +29,28 @@ public final class FileShareInner extends AzureEntityResource { /* * Properties of the file share. */ - @JsonProperty(value = "properties") private FileShareProperties innerFileShareProperties; + /* + * 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; + + /* + * Resource Etag. + */ + private String etag; + /** * Creates an instance of FileShareInner class. */ @@ -44,6 +66,46 @@ private FileShareProperties innerFileShareProperties() { return this.innerFileShareProperties; } + /** + * 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 etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + /** * Get the lastModifiedTime property: Returns the date and time the share was last modified. * @@ -313,4 +375,49 @@ public void validate() { innerFileShareProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerFileShareProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareInner 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 FileShareInner. + */ + public static FileShareInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareInner deserializedFileShareInner = new FileShareInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileShareInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileShareInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileShareInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedFileShareInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFileShareInner.innerFileShareProperties = FileShareProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareItemInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareItemInner.java index eab1786d5f15d..e3a6fc91ba44e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareItemInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareItemInner.java @@ -5,6 +5,9 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.storage.models.AzureEntityResource; import com.azure.resourcemanager.storage.models.EnabledProtocols; import com.azure.resourcemanager.storage.models.LeaseDuration; @@ -13,7 +16,7 @@ import com.azure.resourcemanager.storage.models.RootSquashType; import com.azure.resourcemanager.storage.models.ShareAccessTier; import com.azure.resourcemanager.storage.models.SignedIdentifier; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -26,9 +29,28 @@ public final class FileShareItemInner extends AzureEntityResource { /* * The file share properties be listed out. */ - @JsonProperty(value = "properties") private FileShareProperties 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; + + /* + * Resource Etag. + */ + private String etag; + /** * Creates an instance of FileShareItemInner class. */ @@ -44,6 +66,46 @@ private FileShareProperties 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 etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + /** * Get the lastModifiedTime property: Returns the date and time the share was last modified. * @@ -311,4 +373,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 FileShareItemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareItemInner 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 FileShareItemInner. + */ + public static FileShareItemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareItemInner deserializedFileShareItemInner = new FileShareItemInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFileShareItemInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFileShareItemInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileShareItemInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedFileShareItemInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFileShareItemInner.innerProperties = FileShareProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareItemInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareProperties.java index 44ad1b781b170..fa35729b14b0e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareProperties.java @@ -5,6 +5,11 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.storage.models.EnabledProtocols; import com.azure.resourcemanager.storage.models.LeaseDuration; import com.azure.resourcemanager.storage.models.LeaseState; @@ -12,8 +17,7 @@ import com.azure.resourcemanager.storage.models.RootSquashType; import com.azure.resourcemanager.storage.models.ShareAccessTier; import com.azure.resourcemanager.storage.models.SignedIdentifier; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -22,117 +26,98 @@ * The properties of the file share. */ @Fluent -public final class FileShareProperties { +public final class FileShareProperties implements JsonSerializable { /* * Returns the date and time the share was last modified. */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastModifiedTime; /* * A name-value pair to associate with the share as metadata. */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map metadata; /* * The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For * Large File Shares, the maximum size is 102400. */ - @JsonProperty(value = "shareQuota") private Integer shareQuota; /* * The authentication protocol that is used for the file share. Can only be specified when creating a share. */ - @JsonProperty(value = "enabledProtocols") private EnabledProtocols enabledProtocols; /* * The property is for NFS share only. The default is NoRootSquash. */ - @JsonProperty(value = "rootSquash") private RootSquashType rootSquash; /* * The version of the share. */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) private String version; /* * Indicates whether the share was deleted. */ - @JsonProperty(value = "deleted", access = JsonProperty.Access.WRITE_ONLY) private Boolean deleted; /* * The deleted time if the share was deleted. */ - @JsonProperty(value = "deletedTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime deletedTime; /* * Remaining retention days for share that was soft deleted. */ - @JsonProperty(value = "remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) private Integer remainingRetentionDays; /* * Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. * FileStorage account can choose Premium. */ - @JsonProperty(value = "accessTier") private ShareAccessTier accessTier; /* * Indicates the last modification time for share access tier. */ - @JsonProperty(value = "accessTierChangeTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime accessTierChangeTime; /* * Indicates if there is a pending transition for access tier. */ - @JsonProperty(value = "accessTierStatus", access = JsonProperty.Access.WRITE_ONLY) private String accessTierStatus; /* * The approximate size of the data stored on the share. Note that this value may not include all recently created * or recently resized files. */ - @JsonProperty(value = "shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) private Long shareUsageBytes; /* * The lease status of the share. */ - @JsonProperty(value = "leaseStatus", access = JsonProperty.Access.WRITE_ONLY) private LeaseStatus leaseStatus; /* * Lease state of the share. */ - @JsonProperty(value = "leaseState", access = JsonProperty.Access.WRITE_ONLY) private LeaseState leaseState; /* * Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. */ - @JsonProperty(value = "leaseDuration", access = JsonProperty.Access.WRITE_ONLY) private LeaseDuration leaseDuration; /* * List of stored access policies specified on the share. */ - @JsonProperty(value = "signedIdentifiers") private List signedIdentifiers; /* * Creation time of share snapshot returned in the response of list shares with expand param "snapshots". */ - @JsonProperty(value = "snapshotTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime snapshotTime; /** @@ -388,4 +373,88 @@ public void validate() { signedIdentifiers().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("shareQuota", this.shareQuota); + jsonWriter.writeStringField("enabledProtocols", + this.enabledProtocols == null ? null : this.enabledProtocols.toString()); + jsonWriter.writeStringField("rootSquash", this.rootSquash == null ? null : this.rootSquash.toString()); + jsonWriter.writeStringField("accessTier", this.accessTier == null ? null : this.accessTier.toString()); + jsonWriter.writeArrayField("signedIdentifiers", this.signedIdentifiers, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareProperties 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 FileShareProperties. + */ + public static FileShareProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareProperties deserializedFileShareProperties = new FileShareProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastModifiedTime".equals(fieldName)) { + deserializedFileShareProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedFileShareProperties.metadata = metadata; + } else if ("shareQuota".equals(fieldName)) { + deserializedFileShareProperties.shareQuota = reader.getNullable(JsonReader::getInt); + } else if ("enabledProtocols".equals(fieldName)) { + deserializedFileShareProperties.enabledProtocols = EnabledProtocols.fromString(reader.getString()); + } else if ("rootSquash".equals(fieldName)) { + deserializedFileShareProperties.rootSquash = RootSquashType.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedFileShareProperties.version = reader.getString(); + } else if ("deleted".equals(fieldName)) { + deserializedFileShareProperties.deleted = reader.getNullable(JsonReader::getBoolean); + } else if ("deletedTime".equals(fieldName)) { + deserializedFileShareProperties.deletedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("remainingRetentionDays".equals(fieldName)) { + deserializedFileShareProperties.remainingRetentionDays = reader.getNullable(JsonReader::getInt); + } else if ("accessTier".equals(fieldName)) { + deserializedFileShareProperties.accessTier = ShareAccessTier.fromString(reader.getString()); + } else if ("accessTierChangeTime".equals(fieldName)) { + deserializedFileShareProperties.accessTierChangeTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("accessTierStatus".equals(fieldName)) { + deserializedFileShareProperties.accessTierStatus = reader.getString(); + } else if ("shareUsageBytes".equals(fieldName)) { + deserializedFileShareProperties.shareUsageBytes = reader.getNullable(JsonReader::getLong); + } else if ("leaseStatus".equals(fieldName)) { + deserializedFileShareProperties.leaseStatus = LeaseStatus.fromString(reader.getString()); + } else if ("leaseState".equals(fieldName)) { + deserializedFileShareProperties.leaseState = LeaseState.fromString(reader.getString()); + } else if ("leaseDuration".equals(fieldName)) { + deserializedFileShareProperties.leaseDuration = LeaseDuration.fromString(reader.getString()); + } else if ("signedIdentifiers".equals(fieldName)) { + List signedIdentifiers + = reader.readArray(reader1 -> SignedIdentifier.fromJson(reader1)); + deserializedFileShareProperties.signedIdentifiers = signedIdentifiers; + } else if ("snapshotTime".equals(fieldName)) { + deserializedFileShareProperties.snapshotTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyInner.java index ddcc1e611205e..496f7301f5384 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyInner.java @@ -6,9 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.storage.models.AzureEntityResource; import com.azure.resourcemanager.storage.models.ImmutabilityPolicyState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. @@ -18,9 +21,28 @@ public final class ImmutabilityPolicyInner extends AzureEntityResource { /* * The properties of an ImmutabilityPolicy of a blob container. */ - @JsonProperty(value = "properties", required = true) private ImmutabilityPolicyProperty innerProperties = new ImmutabilityPolicyProperty(); + /* + * 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; + + /* + * Resource Etag. + */ + private String etag; + /** * Creates an instance of ImmutabilityPolicyInner class. */ @@ -36,6 +58,46 @@ private ImmutabilityPolicyProperty 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 etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + /** * Get the immutabilityPeriodSinceCreationInDays property: The immutability period for the blobs in the container * since the policy creation, in days. @@ -150,4 +212,49 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ImmutabilityPolicyInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutabilityPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutabilityPolicyInner 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 ImmutabilityPolicyInner. + */ + public static ImmutabilityPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutabilityPolicyInner deserializedImmutabilityPolicyInner = new ImmutabilityPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedImmutabilityPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedImmutabilityPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedImmutabilityPolicyInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedImmutabilityPolicyInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedImmutabilityPolicyInner.innerProperties = ImmutabilityPolicyProperty.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImmutabilityPolicyInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyProperty.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyProperty.java index c8823eae82ef5..c62e9f262a900 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyProperty.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyProperty.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.storage.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.storage.models.ImmutabilityPolicyState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of an ImmutabilityPolicy of a blob container. */ @Fluent -public final class ImmutabilityPolicyProperty { +public final class ImmutabilityPolicyProperty implements JsonSerializable { /* * The immutability period for the blobs in the container since the policy creation, in days. */ - @JsonProperty(value = "immutabilityPeriodSinceCreationInDays") private Integer immutabilityPeriodSinceCreationInDays; /* * The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private ImmutabilityPolicyState state; /* @@ -31,7 +33,6 @@ public final class ImmutabilityPolicyProperty { * and any existing blocks cannot be modified or deleted. This property cannot be changed with * ExtendImmutabilityPolicy API. */ - @JsonProperty(value = "allowProtectedAppendWrites") private Boolean allowProtectedAppendWrites; /* @@ -41,7 +42,6 @@ public final class ImmutabilityPolicyProperty { * ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are * mutually exclusive. */ - @JsonProperty(value = "allowProtectedAppendWritesAll") private Boolean allowProtectedAppendWritesAll; /** @@ -144,4 +144,53 @@ public ImmutabilityPolicyProperty withAllowProtectedAppendWritesAll(Boolean allo */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("immutabilityPeriodSinceCreationInDays", + this.immutabilityPeriodSinceCreationInDays); + jsonWriter.writeBooleanField("allowProtectedAppendWrites", this.allowProtectedAppendWrites); + jsonWriter.writeBooleanField("allowProtectedAppendWritesAll", this.allowProtectedAppendWritesAll); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutabilityPolicyProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutabilityPolicyProperty 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 ImmutabilityPolicyProperty. + */ + public static ImmutabilityPolicyProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutabilityPolicyProperty deserializedImmutabilityPolicyProperty = new ImmutabilityPolicyProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("immutabilityPeriodSinceCreationInDays".equals(fieldName)) { + deserializedImmutabilityPolicyProperty.immutabilityPeriodSinceCreationInDays + = reader.getNullable(JsonReader::getInt); + } else if ("state".equals(fieldName)) { + deserializedImmutabilityPolicyProperty.state + = ImmutabilityPolicyState.fromString(reader.getString()); + } else if ("allowProtectedAppendWrites".equals(fieldName)) { + deserializedImmutabilityPolicyProperty.allowProtectedAppendWrites + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowProtectedAppendWritesAll".equals(fieldName)) { + deserializedImmutabilityPolicyProperty.allowProtectedAppendWritesAll + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedImmutabilityPolicyProperty; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseContainerResponseInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseContainerResponseInner.java index 6795794b4496d..a0a252642041e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseContainerResponseInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseContainerResponseInner.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.storage.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; /** * Lease Container response schema. */ @Fluent -public final class LeaseContainerResponseInner { +public final class LeaseContainerResponseInner implements JsonSerializable { /* * Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or * release the lease. */ - @JsonProperty(value = "leaseId") private String leaseId; /* * Approximate time remaining in the lease period, in seconds. */ - @JsonProperty(value = "leaseTimeSeconds") private String leaseTimeSeconds; /** @@ -80,4 +82,43 @@ public LeaseContainerResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("leaseId", this.leaseId); + jsonWriter.writeStringField("leaseTimeSeconds", this.leaseTimeSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LeaseContainerResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LeaseContainerResponseInner 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 LeaseContainerResponseInner. + */ + public static LeaseContainerResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LeaseContainerResponseInner deserializedLeaseContainerResponseInner = new LeaseContainerResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("leaseId".equals(fieldName)) { + deserializedLeaseContainerResponseInner.leaseId = reader.getString(); + } else if ("leaseTimeSeconds".equals(fieldName)) { + deserializedLeaseContainerResponseInner.leaseTimeSeconds = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLeaseContainerResponseInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseShareResponseInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseShareResponseInner.java index b7f7834f357c4..82fcdeb03bcb3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseShareResponseInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseShareResponseInner.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.storage.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; /** * Lease Share response schema. */ @Fluent -public final class LeaseShareResponseInner { +public final class LeaseShareResponseInner implements JsonSerializable { /* * Returned unique lease ID that must be included with any request to delete the share, or to renew, change, or * release the lease. */ - @JsonProperty(value = "leaseId") private String leaseId; /* * Approximate time remaining in the lease period, in seconds. */ - @JsonProperty(value = "leaseTimeSeconds") private String leaseTimeSeconds; /** @@ -80,4 +82,43 @@ public LeaseShareResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("leaseId", this.leaseId); + jsonWriter.writeStringField("leaseTimeSeconds", this.leaseTimeSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LeaseShareResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LeaseShareResponseInner 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 LeaseShareResponseInner. + */ + public static LeaseShareResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LeaseShareResponseInner deserializedLeaseShareResponseInner = new LeaseShareResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("leaseId".equals(fieldName)) { + deserializedLeaseShareResponseInner.leaseId = reader.getString(); + } else if ("leaseTimeSeconds".equals(fieldName)) { + deserializedLeaseShareResponseInner.leaseTimeSeconds = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLeaseShareResponseInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LegalHoldInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LegalHoldInner.java index e8b1fbf471018..341f9625859a1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LegalHoldInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LegalHoldInner.java @@ -6,33 +6,34 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The LegalHold property of a blob container. */ @Fluent -public final class LegalHoldInner { +public final class LegalHoldInner implements JsonSerializable { /* * The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold * public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of * 1000 blob containers with hasLegalHold=true for a given account. */ - @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) private Boolean hasLegalHold; /* * Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. */ - @JsonProperty(value = "tags", required = true) private List tags; /* * When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection * and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. */ - @JsonProperty(value = "allowProtectedAppendWritesAll") private Boolean allowProtectedAppendWritesAll; /** @@ -109,4 +110,48 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(LegalHoldInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("allowProtectedAppendWritesAll", this.allowProtectedAppendWritesAll); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LegalHoldInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LegalHoldInner 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 LegalHoldInner. + */ + public static LegalHoldInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LegalHoldInner deserializedLegalHoldInner = new LegalHoldInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> reader1.getString()); + deserializedLegalHoldInner.tags = tags; + } else if ("hasLegalHold".equals(fieldName)) { + deserializedLegalHoldInner.hasLegalHold = reader.getNullable(JsonReader::getBoolean); + } else if ("allowProtectedAppendWritesAll".equals(fieldName)) { + deserializedLegalHoldInner.allowProtectedAppendWritesAll + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedLegalHoldInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListAccountSasResponseInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListAccountSasResponseInner.java index 48c7216693fbb..5a8ae80965d71 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListAccountSasResponseInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListAccountSasResponseInner.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The List SAS credentials operation response. */ @Immutable -public final class ListAccountSasResponseInner { +public final class ListAccountSasResponseInner implements JsonSerializable { /* * List SAS credentials of storage account. */ - @JsonProperty(value = "accountSasToken", access = JsonProperty.Access.WRITE_ONLY) private String accountSasToken; /** @@ -40,4 +43,39 @@ public String accountSasToken() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListAccountSasResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListAccountSasResponseInner 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 ListAccountSasResponseInner. + */ + public static ListAccountSasResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListAccountSasResponseInner deserializedListAccountSasResponseInner = new ListAccountSasResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountSasToken".equals(fieldName)) { + deserializedListAccountSasResponseInner.accountSasToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListAccountSasResponseInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListContainerItemInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListContainerItemInner.java index 79b3acfb722e8..935c8720eb36f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListContainerItemInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListContainerItemInner.java @@ -5,6 +5,9 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.storage.models.AzureEntityResource; import com.azure.resourcemanager.storage.models.ImmutabilityPolicyProperties; import com.azure.resourcemanager.storage.models.ImmutableStorageWithVersioning; @@ -13,7 +16,7 @@ import com.azure.resourcemanager.storage.models.LeaseStatus; import com.azure.resourcemanager.storage.models.LegalHoldProperties; import com.azure.resourcemanager.storage.models.PublicAccess; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; @@ -25,9 +28,28 @@ public final class ListContainerItemInner extends AzureEntityResource { /* * The blob container properties be listed out. */ - @JsonProperty(value = "properties") private ContainerProperties 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; + + /* + * Resource Etag. + */ + private String etag; + /** * Creates an instance of ListContainerItemInner class. */ @@ -43,6 +65,46 @@ private ContainerProperties 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 etag property: Resource Etag. + * + * @return the etag value. + */ + @Override + public String etag() { + return this.etag; + } + /** * Get the version property: The version of the deleted blob container. * @@ -336,4 +398,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 ListContainerItemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListContainerItemInner 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 ListContainerItemInner. + */ + public static ListContainerItemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListContainerItemInner deserializedListContainerItemInner = new ListContainerItemInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedListContainerItemInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedListContainerItemInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedListContainerItemInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedListContainerItemInner.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedListContainerItemInner.innerProperties = ContainerProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedListContainerItemInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueInner.java index 62b6ecdfac7a1..01ddcea0a50f8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueInner.java @@ -6,7 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** @@ -17,9 +20,23 @@ public final class ListQueueInner extends ProxyResource { /* * List Queue resource properties. */ - @JsonProperty(value = "properties") private ListQueueProperties innerQueueProperties; + /* + * 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 ListQueueInner class. */ @@ -35,6 +52,36 @@ private ListQueueProperties innerQueueProperties() { return this.innerQueueProperties; } + /** + * 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 metadata property: A name-value pair that represents queue metadata. * @@ -68,4 +115,47 @@ public void validate() { innerQueueProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerQueueProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListQueueInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListQueueInner 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 ListQueueInner. + */ + public static ListQueueInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListQueueInner deserializedListQueueInner = new ListQueueInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedListQueueInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedListQueueInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedListQueueInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedListQueueInner.innerQueueProperties = ListQueueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedListQueueInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueProperties.java index f5add423b4a9e..69d685dd4f8ac 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueProperties.java @@ -5,20 +5,21 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * The ListQueueProperties model. */ @Fluent -public final class ListQueueProperties { +public final class ListQueueProperties implements JsonSerializable { /* * A name-value pair that represents queue metadata. */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map metadata; /** @@ -54,4 +55,41 @@ public ListQueueProperties withMetadata(Map metadata) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListQueueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListQueueProperties 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 ListQueueProperties. + */ + public static ListQueueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListQueueProperties deserializedListQueueProperties = new ListQueueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedListQueueProperties.metadata = metadata; + } else { + reader.skipChildren(); + } + } + + return deserializedListQueueProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueServicesInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueServicesInner.java index 93de6a373e95b..f9676963daf5a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueServicesInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueServicesInner.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The ListQueueServices model. */ @Immutable -public final class ListQueueServicesInner { +public final class ListQueueServicesInner implements JsonSerializable { /* * List of queue services returned. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /** @@ -44,4 +47,41 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListQueueServicesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListQueueServicesInner 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 ListQueueServicesInner. + */ + public static ListQueueServicesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListQueueServicesInner deserializedListQueueServicesInner = new ListQueueServicesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> QueueServicePropertiesInner.fromJson(reader1)); + deserializedListQueueServicesInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedListQueueServicesInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListServiceSasResponseInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListServiceSasResponseInner.java index 89cf119f77a0f..269c2eb4a468f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListServiceSasResponseInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListServiceSasResponseInner.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The List service SAS credentials operation response. */ @Immutable -public final class ListServiceSasResponseInner { +public final class ListServiceSasResponseInner implements JsonSerializable { /* * List service SAS credentials of specific resource. */ - @JsonProperty(value = "serviceSasToken", access = JsonProperty.Access.WRITE_ONLY) private String serviceSasToken; /** @@ -40,4 +43,39 @@ public String serviceSasToken() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListServiceSasResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListServiceSasResponseInner 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 ListServiceSasResponseInner. + */ + public static ListServiceSasResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListServiceSasResponseInner deserializedListServiceSasResponseInner = new ListServiceSasResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSasToken".equals(fieldName)) { + deserializedListServiceSasResponseInner.serviceSasToken = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListServiceSasResponseInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListTableServicesInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListTableServicesInner.java index 5f91608f48a19..a05f06cc6926b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListTableServicesInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListTableServicesInner.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The ListTableServices model. */ @Immutable -public final class ListTableServicesInner { +public final class ListTableServicesInner implements JsonSerializable { /* * List of table services returned. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /** @@ -44,4 +47,41 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListTableServicesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListTableServicesInner 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 ListTableServicesInner. + */ + public static ListTableServicesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListTableServicesInner deserializedListTableServicesInner = new ListTableServicesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TableServicePropertiesInner.fromJson(reader1)); + deserializedListTableServicesInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedListTableServicesInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserInner.java index 3a541135b9bb5..f238d1f3211c4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserInner.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.storage.models.PermissionScope; import com.azure.resourcemanager.storage.models.SshPublicKey; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -20,15 +23,28 @@ public final class LocalUserInner extends ProxyResource { /* * Storage account local user properties. */ - @JsonProperty(value = "properties") private LocalUserProperties innerProperties; /* * Metadata pertaining to creation and last modification of the 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 LocalUserInner 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 permissionScopes property: The permission scopes of the local user. * @@ -319,4 +365,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 LocalUserInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalUserInner 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 LocalUserInner. + */ + public static LocalUserInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalUserInner deserializedLocalUserInner = new LocalUserInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedLocalUserInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedLocalUserInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLocalUserInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedLocalUserInner.innerProperties = LocalUserProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLocalUserInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalUserInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserKeysInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserKeysInner.java index e74feea2c6c45..5ae5e5ddbaf86 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserKeysInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserKeysInner.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.storage.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.storage.models.SshPublicKey; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The Storage Account Local User keys. */ @Fluent -public final class LocalUserKeysInner { +public final class LocalUserKeysInner implements JsonSerializable { /* * Optional, local user ssh authorized keys for SFTP. */ - @JsonProperty(value = "sshAuthorizedKeys") private List sshAuthorizedKeys; /* * Auto generated by the server for SMB authentication. */ - @JsonProperty(value = "sharedKey", access = JsonProperty.Access.WRITE_ONLY) private String sharedKey; /** @@ -71,4 +73,44 @@ public void validate() { sshAuthorizedKeys().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sshAuthorizedKeys", this.sshAuthorizedKeys, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalUserKeysInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalUserKeysInner 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 LocalUserKeysInner. + */ + public static LocalUserKeysInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalUserKeysInner deserializedLocalUserKeysInner = new LocalUserKeysInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sshAuthorizedKeys".equals(fieldName)) { + List sshAuthorizedKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedLocalUserKeysInner.sshAuthorizedKeys = sshAuthorizedKeys; + } else if ("sharedKey".equals(fieldName)) { + deserializedLocalUserKeysInner.sharedKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalUserKeysInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserProperties.java index f338212ad8d5d..615c0a706f6ab 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserProperties.java @@ -5,87 +5,79 @@ package com.azure.resourcemanager.storage.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.storage.models.PermissionScope; import com.azure.resourcemanager.storage.models.SshPublicKey; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The Storage Account Local User properties. */ @Fluent -public final class LocalUserProperties { +public final class LocalUserProperties implements JsonSerializable { /* * The permission scopes of the local user. */ - @JsonProperty(value = "permissionScopes") private List permissionScopes; /* * Optional, local user home directory. */ - @JsonProperty(value = "homeDirectory") private String homeDirectory; /* * Optional, local user ssh authorized keys for SFTP. */ - @JsonProperty(value = "sshAuthorizedKeys") private List sshAuthorizedKeys; /* * A unique Security Identifier that is generated by the server. */ - @JsonProperty(value = "sid", access = JsonProperty.Access.WRITE_ONLY) private String sid; /* * Indicates whether shared key exists. Set it to false to remove existing shared key. */ - @JsonProperty(value = "hasSharedKey") private Boolean hasSharedKey; /* * Indicates whether ssh key exists. Set it to false to remove existing SSH key. */ - @JsonProperty(value = "hasSshKey") private Boolean hasSshKey; /* * Indicates whether ssh password exists. Set it to false to remove existing SSH password. */ - @JsonProperty(value = "hasSshPassword") private Boolean hasSshPassword; /* * A unique Identifier that is generated by the server. */ - @JsonProperty(value = "userId", access = JsonProperty.Access.WRITE_ONLY) private Integer userId; /* * An identifier for associating a group of users. */ - @JsonProperty(value = "groupId") private Integer groupId; /* * Indicates whether ACL authorization is allowed for this user. Set it to false to disallow using ACL * authorization. */ - @JsonProperty(value = "allowAclAuthorization") private Boolean allowAclAuthorization; /* * Supplementary group membership. Only applicable for local users enabled for NFSv3 access. */ - @JsonProperty(value = "extendedGroups") private List extendedGroups; /* * Indicates if the local user is enabled for access with NFSv3 protocol. */ - @JsonProperty(value = "isNFSv3Enabled") private Boolean isNFSv3Enabled; /** @@ -333,4 +325,78 @@ public void validate() { sshAuthorizedKeys().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("permissionScopes", this.permissionScopes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("homeDirectory", this.homeDirectory); + jsonWriter.writeArrayField("sshAuthorizedKeys", this.sshAuthorizedKeys, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("hasSharedKey", this.hasSharedKey); + jsonWriter.writeBooleanField("hasSshKey", this.hasSshKey); + jsonWriter.writeBooleanField("hasSshPassword", this.hasSshPassword); + jsonWriter.writeNumberField("groupId", this.groupId); + jsonWriter.writeBooleanField("allowAclAuthorization", this.allowAclAuthorization); + jsonWriter.writeArrayField("extendedGroups", this.extendedGroups, + (writer, element) -> writer.writeInt(element)); + jsonWriter.writeBooleanField("isNFSv3Enabled", this.isNFSv3Enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalUserProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalUserProperties 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 LocalUserProperties. + */ + public static LocalUserProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalUserProperties deserializedLocalUserProperties = new LocalUserProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("permissionScopes".equals(fieldName)) { + List permissionScopes + = reader.readArray(reader1 -> PermissionScope.fromJson(reader1)); + deserializedLocalUserProperties.permissionScopes = permissionScopes; + } else if ("homeDirectory".equals(fieldName)) { + deserializedLocalUserProperties.homeDirectory = reader.getString(); + } else if ("sshAuthorizedKeys".equals(fieldName)) { + List sshAuthorizedKeys = reader.readArray(reader1 -> SshPublicKey.fromJson(reader1)); + deserializedLocalUserProperties.sshAuthorizedKeys = sshAuthorizedKeys; + } else if ("sid".equals(fieldName)) { + deserializedLocalUserProperties.sid = reader.getString(); + } else if ("hasSharedKey".equals(fieldName)) { + deserializedLocalUserProperties.hasSharedKey = reader.getNullable(JsonReader::getBoolean); + } else if ("hasSshKey".equals(fieldName)) { + deserializedLocalUserProperties.hasSshKey = reader.getNullable(JsonReader::getBoolean); + } else if ("hasSshPassword".equals(fieldName)) { + deserializedLocalUserProperties.hasSshPassword = reader.getNullable(JsonReader::getBoolean); + } else if ("userId".equals(fieldName)) { + deserializedLocalUserProperties.userId = reader.getNullable(JsonReader::getInt); + } else if ("groupId".equals(fieldName)) { + deserializedLocalUserProperties.groupId = reader.getNullable(JsonReader::getInt); + } else if ("allowAclAuthorization".equals(fieldName)) { + deserializedLocalUserProperties.allowAclAuthorization = reader.getNullable(JsonReader::getBoolean); + } else if ("extendedGroups".equals(fieldName)) { + List extendedGroups = reader.readArray(reader1 -> reader1.getInt()); + deserializedLocalUserProperties.extendedGroups = extendedGroups; + } else if ("isNFSv3Enabled".equals(fieldName)) { + deserializedLocalUserProperties.isNFSv3Enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalUserProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserRegeneratePasswordResultInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserRegeneratePasswordResultInner.java index 947377fb6817b..590810f180323 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserRegeneratePasswordResultInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserRegeneratePasswordResultInner.java @@ -5,18 +5,22 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The secrets of Storage Account Local User. */ @Immutable -public final class LocalUserRegeneratePasswordResultInner { +public final class LocalUserRegeneratePasswordResultInner + implements JsonSerializable { /* * Auto generated password by the server for SSH authentication if hasSshPassword is set to true on the creation of * local user. */ - @JsonProperty(value = "sshPassword", access = JsonProperty.Access.WRITE_ONLY) private String sshPassword; /** @@ -42,4 +46,40 @@ public String sshPassword() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalUserRegeneratePasswordResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalUserRegeneratePasswordResultInner 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 LocalUserRegeneratePasswordResultInner. + */ + public static LocalUserRegeneratePasswordResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalUserRegeneratePasswordResultInner deserializedLocalUserRegeneratePasswordResultInner + = new LocalUserRegeneratePasswordResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sshPassword".equals(fieldName)) { + deserializedLocalUserRegeneratePasswordResultInner.sshPassword = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalUserRegeneratePasswordResultInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyInner.java index cd46163013e42..f60f4d12e9e8d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyInner.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.storage.models.ManagementPolicySchema; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -18,9 +21,23 @@ public final class ManagementPolicyInner extends ProxyResource { /* * Returns the Storage Account Data Policies Rules. */ - @JsonProperty(value = "properties") private ManagementPolicyProperties 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 ManagementPolicyInner class. */ @@ -36,6 +53,36 @@ private ManagementPolicyProperties 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 lastModifiedTime property: Returns the date and time the ManagementPolicies was last modified. * @@ -80,4 +127,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 ManagementPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyInner 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 ManagementPolicyInner. + */ + public static ManagementPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyInner deserializedManagementPolicyInner = new ManagementPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagementPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagementPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagementPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedManagementPolicyInner.innerProperties = ManagementPolicyProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyProperties.java index d362fe9107d2e..fbd75c3ad158b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyProperties.java @@ -5,27 +5,30 @@ package com.azure.resourcemanager.storage.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.storage.models.ManagementPolicySchema; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; /** * The Storage Account ManagementPolicy properties. */ @Fluent -public final class ManagementPolicyProperties { +public final class ManagementPolicyProperties implements JsonSerializable { /* * Returns the date and time the ManagementPolicies was last modified. */ - @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastModifiedTime; /* * The Storage Account ManagementPolicy, in JSON format. See more details in: * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. */ - @JsonProperty(value = "policy", required = true) private ManagementPolicySchema policy; /** @@ -81,4 +84,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("policy", this.policy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyProperties 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 ManagementPolicyProperties. + */ + public static ManagementPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyProperties deserializedManagementPolicyProperties = new ManagementPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policy".equals(fieldName)) { + deserializedManagementPolicyProperties.policy = ManagementPolicySchema.fromJson(reader); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedManagementPolicyProperties.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/NetworkSecurityPerimeterConfigurationInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/NetworkSecurityPerimeterConfigurationInner.java index d7a0f305a1b1e..68cc83fc8d6c7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/NetworkSecurityPerimeterConfigurationInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/NetworkSecurityPerimeterConfigurationInner.java @@ -7,12 +7,15 @@ import com.azure.core.annotation.Immutable; 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.storage.models.NetworkSecurityPerimeter; import com.azure.resourcemanager.storage.models.NetworkSecurityPerimeterConfigurationPropertiesProfile; import com.azure.resourcemanager.storage.models.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation; import com.azure.resourcemanager.storage.models.NetworkSecurityPerimeterConfigurationProvisioningState; import com.azure.resourcemanager.storage.models.ProvisioningIssue; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -23,15 +26,28 @@ public final class NetworkSecurityPerimeterConfigurationInner extends ProxyResou /* * Properties of the Network Security Perimeter Configuration */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private NetworkSecurityPerimeterConfigurationProperties innerProperties; /* * 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 NetworkSecurityPerimeterConfigurationInner 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 provisioningState property: Provisioning state of Network Security Perimeter configuration propagation. * @@ -111,4 +157,50 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationInner 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 NetworkSecurityPerimeterConfigurationInner. + */ + public static NetworkSecurityPerimeterConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationInner deserializedNetworkSecurityPerimeterConfigurationInner + = new NetworkSecurityPerimeterConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.innerProperties + = NetworkSecurityPerimeterConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/NetworkSecurityPerimeterConfigurationProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/NetworkSecurityPerimeterConfigurationProperties.java index efc757de6f5f0..28e14a0f4d86a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/NetworkSecurityPerimeterConfigurationProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/NetworkSecurityPerimeterConfigurationProperties.java @@ -5,47 +5,47 @@ package com.azure.resourcemanager.storage.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.storage.models.NetworkSecurityPerimeter; import com.azure.resourcemanager.storage.models.NetworkSecurityPerimeterConfigurationPropertiesProfile; import com.azure.resourcemanager.storage.models.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation; import com.azure.resourcemanager.storage.models.NetworkSecurityPerimeterConfigurationProvisioningState; import com.azure.resourcemanager.storage.models.ProvisioningIssue; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Properties of the Network Security Perimeter Configuration. */ @Immutable -public final class NetworkSecurityPerimeterConfigurationProperties { +public final class NetworkSecurityPerimeterConfigurationProperties + implements JsonSerializable { /* * Provisioning state of Network Security Perimeter configuration propagation */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private NetworkSecurityPerimeterConfigurationProvisioningState provisioningState; /* * List of Provisioning Issues if any */ - @JsonProperty(value = "provisioningIssues", access = JsonProperty.Access.WRITE_ONLY) private List provisioningIssues; /* * NetworkSecurityPerimeter related information */ - @JsonProperty(value = "networkSecurityPerimeter", access = JsonProperty.Access.WRITE_ONLY) private NetworkSecurityPerimeter networkSecurityPerimeter; /* * Information about resource association */ - @JsonProperty(value = "resourceAssociation", access = JsonProperty.Access.WRITE_ONLY) private NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation resourceAssociation; /* * Network Security Perimeter profile */ - @JsonProperty(value = "profile", access = JsonProperty.Access.WRITE_ONLY) private NetworkSecurityPerimeterConfigurationPropertiesProfile profile; /** @@ -118,4 +118,54 @@ public void validate() { profile().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationProperties 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 NetworkSecurityPerimeterConfigurationProperties. + */ + public static NetworkSecurityPerimeterConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationProperties deserializedNetworkSecurityPerimeterConfigurationProperties + = new NetworkSecurityPerimeterConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.provisioningState + = NetworkSecurityPerimeterConfigurationProvisioningState.fromString(reader.getString()); + } else if ("provisioningIssues".equals(fieldName)) { + List provisioningIssues + = reader.readArray(reader1 -> ProvisioningIssue.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationProperties.provisioningIssues = provisioningIssues; + } else if ("networkSecurityPerimeter".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.networkSecurityPerimeter + = NetworkSecurityPerimeter.fromJson(reader); + } else if ("resourceAssociation".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.resourceAssociation + = NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.fromJson(reader); + } else if ("profile".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.profile + = NetworkSecurityPerimeterConfigurationPropertiesProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyInner.java index a544f05c1f920..a2cb454b78d04 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyInner.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.storage.models.ObjectReplicationPolicyRule; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -19,9 +22,23 @@ public final class ObjectReplicationPolicyInner extends ProxyResource { /* * Returns the Storage Account Object Replication Policy. */ - @JsonProperty(value = "properties") private ObjectReplicationPolicyProperties 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 ObjectReplicationPolicyInner class. */ @@ -37,6 +54,36 @@ private ObjectReplicationPolicyProperties 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 policyId property: A unique id for object replication policy. * @@ -138,4 +185,48 @@ 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 ObjectReplicationPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicyInner 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 ObjectReplicationPolicyInner. + */ + public static ObjectReplicationPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicyInner deserializedObjectReplicationPolicyInner = new ObjectReplicationPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedObjectReplicationPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedObjectReplicationPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedObjectReplicationPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedObjectReplicationPolicyInner.innerProperties + = ObjectReplicationPolicyProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicyInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyProperties.java index ead8f766c94b1..3ac79178a733f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyProperties.java @@ -5,9 +5,14 @@ package com.azure.resourcemanager.storage.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.storage.models.ObjectReplicationPolicyRule; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -15,35 +20,30 @@ * The Storage Account ObjectReplicationPolicy properties. */ @Fluent -public final class ObjectReplicationPolicyProperties { +public final class ObjectReplicationPolicyProperties implements JsonSerializable { /* * A unique id for object replication policy. */ - @JsonProperty(value = "policyId", access = JsonProperty.Access.WRITE_ONLY) private String policyId; /* * Indicates when the policy is enabled on the source account. */ - @JsonProperty(value = "enabledTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime enabledTime; /* * Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. */ - @JsonProperty(value = "sourceAccount", required = true) private String sourceAccount; /* * Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. */ - @JsonProperty(value = "destinationAccount", required = true) private String destinationAccount; /* * The storage account object replication rules. */ - @JsonProperty(value = "rules") private List rules; /** @@ -156,4 +156,55 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ObjectReplicationPolicyProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceAccount", this.sourceAccount); + jsonWriter.writeStringField("destinationAccount", this.destinationAccount); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReplicationPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicyProperties 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 ObjectReplicationPolicyProperties. + */ + public static ObjectReplicationPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicyProperties deserializedObjectReplicationPolicyProperties + = new ObjectReplicationPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceAccount".equals(fieldName)) { + deserializedObjectReplicationPolicyProperties.sourceAccount = reader.getString(); + } else if ("destinationAccount".equals(fieldName)) { + deserializedObjectReplicationPolicyProperties.destinationAccount = reader.getString(); + } else if ("policyId".equals(fieldName)) { + deserializedObjectReplicationPolicyProperties.policyId = reader.getString(); + } else if ("enabledTime".equals(fieldName)) { + deserializedObjectReplicationPolicyProperties.enabledTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> ObjectReplicationPolicyRule.fromJson(reader1)); + deserializedObjectReplicationPolicyProperties.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicyProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationInner.java index 0c9e6b3b24286..ad8cd2bbcb248 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationInner.java @@ -5,37 +5,37 @@ package com.azure.resourcemanager.storage.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.storage.models.OperationDisplay; import com.azure.resourcemanager.storage.models.ServiceSpecification; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Storage REST API operation definition. */ @Fluent -public final class OperationInner { +public final class OperationInner implements JsonSerializable { /* * Operation name: {provider}/{resource}/{operation} */ - @JsonProperty(value = "name") private String name; /* * Display metadata associated with the operation. */ - @JsonProperty(value = "display") private OperationDisplay display; /* * The origin of operations. */ - @JsonProperty(value = "origin") private String origin; /* * Properties of operation, include metric specifications. */ - @JsonProperty(value = "properties") private OperationProperties innerOperationProperties; /** @@ -149,4 +149,49 @@ public void validate() { innerOperationProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeStringField("origin", this.origin); + jsonWriter.writeJsonField("properties", this.innerOperationProperties); + 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 if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOperationInner.innerOperationProperties = OperationProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationProperties.java index 9b4ee5c41c110..6bf11042f46ef 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationProperties.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.storage.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.storage.models.ServiceSpecification; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Properties of operation, include metric specifications. */ @Fluent -public final class OperationProperties { +public final class OperationProperties implements JsonSerializable { /* * One property of operation, include metric specifications. */ - @JsonProperty(value = "serviceSpecification") private ServiceSpecification serviceSpecification; /** @@ -55,4 +58,40 @@ public void validate() { serviceSpecification().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationProperties 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 OperationProperties. + */ + public static OperationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationProperties deserializedOperationProperties = new OperationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSpecification".equals(fieldName)) { + deserializedOperationProperties.serviceSpecification = ServiceSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionInner.java index aa340982c9290..3115b0fce8f61 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionInner.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.storage.models.PrivateEndpoint; import com.azure.resourcemanager.storage.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.storage.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The Private Endpoint Connection resource. @@ -19,9 +22,23 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { /* * Resource properties. */ - @JsonProperty(value = "properties") private PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionInner class. */ @@ -37,6 +54,36 @@ private PrivateEndpointConnectionProperties 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 privateEndpoint property: The resource of private end point. * @@ -105,4 +152,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 PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionProperties.java index cadaee72f5b21..5aa224bdb7fb2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionProperties.java @@ -6,32 +6,34 @@ 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.storage.models.PrivateEndpoint; import com.azure.resourcemanager.storage.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.storage.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Properties of the PrivateEndpointConnectProperties. */ @Fluent -public final class PrivateEndpointConnectionProperties { +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { /* * The resource of private end point. */ - @JsonProperty(value = "privateEndpoint") private PrivateEndpoint privateEndpoint; /* * A collection of information about the state of the connection between service consumer and provider. */ - @JsonProperty(value = "privateLinkServiceConnectionState", required = true) private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; /* * The provisioning state of the private endpoint connection resource. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private PrivateEndpointConnectionProvisioningState provisioningState; /** @@ -111,4 +113,49 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceListResultInner.java index 2d076ca75293d..a61281548cc11 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceListResultInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceListResultInner.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.storage.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.storage.models.PrivateLinkResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * A list of private link resources. */ @Fluent -public final class PrivateLinkResourceListResultInner { +public final class PrivateLinkResourceListResultInner implements JsonSerializable { /* * Array of private link resources */ - @JsonProperty(value = "value") private List value; /** @@ -56,4 +59,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResultInner 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 PrivateLinkResourceListResultInner. + */ + public static PrivateLinkResourceListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResultInner deserializedPrivateLinkResourceListResultInner + = new PrivateLinkResourceListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResource.fromJson(reader1)); + deserializedPrivateLinkResourceListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResultInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceProperties.java index 1c280ac5a27bd..02698b7bce60f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceProperties.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.storage.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; import java.util.List; /** * Properties of a private link resource. */ @Fluent -public final class PrivateLinkResourceProperties { +public final class PrivateLinkResourceProperties implements JsonSerializable { /* * The private link resource group id. */ - @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) private String groupId; /* * The private link resource required member names. */ - @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) private List requiredMembers; /* * The private link resource Private link DNS zone name. */ - @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; /** @@ -82,4 +83,48 @@ public PrivateLinkResourceProperties withRequiredZoneNames(List required */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueProperties.java index 234d16bae75de..85909359dd6b9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueProperties.java @@ -5,27 +5,27 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * The QueueProperties model. */ @Fluent -public final class QueueProperties { +public final class QueueProperties implements JsonSerializable { /* * A name-value pair that represents queue metadata. */ - @JsonProperty(value = "metadata") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map metadata; /* * Integer indicating an approximate number of messages in the queue. This number is not lower than the actual * number of messages in the queue, but could be higher. */ - @JsonProperty(value = "approximateMessageCount", access = JsonProperty.Access.WRITE_ONLY) private Integer approximateMessageCount; /** @@ -71,4 +71,43 @@ public Integer approximateMessageCount() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueueProperties 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 QueueProperties. + */ + public static QueueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueueProperties deserializedQueueProperties = new QueueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metadata".equals(fieldName)) { + Map metadata = reader.readMap(reader1 -> reader1.getString()); + deserializedQueueProperties.metadata = metadata; + } else if ("approximateMessageCount".equals(fieldName)) { + deserializedQueueProperties.approximateMessageCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedQueueProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesInner.java index 47bc8a09f1822..8bdd2d0bb8d76 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesInner.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.storage.models.CorsRules; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of a storage account’s Queue service. @@ -17,9 +20,23 @@ public final class QueueServicePropertiesInner extends ProxyResource { /* * The properties of a storage account’s Queue service. */ - @JsonProperty(value = "properties") private QueueServicePropertiesProperties innerQueueServiceProperties; + /* + * 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 QueueServicePropertiesInner class. */ @@ -35,6 +52,36 @@ private QueueServicePropertiesProperties innerQueueServiceProperties() { return this.innerQueueServiceProperties; } + /** + * 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 cors property: Specifies CORS rules for the Queue service. You can include up to five CorsRule elements * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and @@ -72,4 +119,48 @@ public void validate() { innerQueueServiceProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerQueueServiceProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueueServicePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueueServicePropertiesInner 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 QueueServicePropertiesInner. + */ + public static QueueServicePropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueueServicePropertiesInner deserializedQueueServicePropertiesInner = new QueueServicePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedQueueServicePropertiesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedQueueServicePropertiesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedQueueServicePropertiesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedQueueServicePropertiesInner.innerQueueServiceProperties + = QueueServicePropertiesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedQueueServicePropertiesInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesProperties.java index ee98acf12d534..26309a020f31f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesProperties.java @@ -5,20 +5,23 @@ package com.azure.resourcemanager.storage.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.storage.models.CorsRules; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of a storage account’s Queue service. */ @Fluent -public final class QueueServicePropertiesProperties { +public final class QueueServicePropertiesProperties implements JsonSerializable { /* * Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no * CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for * the Queue service. */ - @JsonProperty(value = "cors") private CorsRules cors; /** @@ -61,4 +64,41 @@ public void validate() { cors().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cors", this.cors); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QueueServicePropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QueueServicePropertiesProperties 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 QueueServicePropertiesProperties. + */ + public static QueueServicePropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QueueServicePropertiesProperties deserializedQueueServicePropertiesProperties + = new QueueServicePropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cors".equals(fieldName)) { + deserializedQueueServicePropertiesProperties.cors = CorsRules.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedQueueServicePropertiesProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/SkuInformationInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/SkuInformationInner.java index 595972dd87a19..d5951b834406e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/SkuInformationInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/SkuInformationInner.java @@ -6,62 +6,59 @@ 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.storage.models.Kind; import com.azure.resourcemanager.storage.models.Restriction; import com.azure.resourcemanager.storage.models.SkuCapability; import com.azure.resourcemanager.storage.models.SkuName; import com.azure.resourcemanager.storage.models.SkuTier; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Storage SKU and its properties. */ @Fluent -public final class SkuInformationInner { +public final class SkuInformationInner implements JsonSerializable { /* * The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was * called accountType. */ - @JsonProperty(value = "name", required = true) private SkuName name; /* * The SKU tier. This is based on the SKU name. */ - @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) private SkuTier tier; /* * The type of the resource, usually it is 'storageAccounts'. */ - @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) private String resourceType; /* * Indicates the type of storage account. */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) private Kind kind; /* * The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. * West US, East US, Southeast Asia, etc.). */ - @JsonProperty(value = "locations", access = JsonProperty.Access.WRITE_ONLY) private List locations; /* * The capability information in the specified SKU, including file encryption, network ACLs, change notification, * etc. */ - @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) private List capabilities; /* * The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. */ - @JsonProperty(value = "restrictions") private List restrictions; /** @@ -180,4 +177,57 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(SkuInformationInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeArrayField("restrictions", this.restrictions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuInformationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuInformationInner 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 SkuInformationInner. + */ + public static SkuInformationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuInformationInner deserializedSkuInformationInner = new SkuInformationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSkuInformationInner.name = SkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedSkuInformationInner.tier = SkuTier.fromString(reader.getString()); + } else if ("resourceType".equals(fieldName)) { + deserializedSkuInformationInner.resourceType = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedSkuInformationInner.kind = Kind.fromString(reader.getString()); + } else if ("locations".equals(fieldName)) { + List locations = reader.readArray(reader1 -> reader1.getString()); + deserializedSkuInformationInner.locations = locations; + } else if ("capabilities".equals(fieldName)) { + List capabilities = reader.readArray(reader1 -> SkuCapability.fromJson(reader1)); + deserializedSkuInformationInner.capabilities = capabilities; + } else if ("restrictions".equals(fieldName)) { + List restrictions = reader.readArray(reader1 -> Restriction.fromJson(reader1)); + deserializedSkuInformationInner.restrictions = restrictions; + } else { + reader.skipChildren(); + } + } + + return deserializedSkuInformationInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountInner.java index 36de9ea733ae8..5259925bbecb2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountInner.java @@ -6,6 +6,9 @@ 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.storage.models.AccessTier; import com.azure.resourcemanager.storage.models.AccountStatus; import com.azure.resourcemanager.storage.models.AllowedCopyScope; @@ -30,7 +33,7 @@ import com.azure.resourcemanager.storage.models.SasPolicy; import com.azure.resourcemanager.storage.models.Sku; import com.azure.resourcemanager.storage.models.StorageAccountSkuConversionStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -43,33 +46,43 @@ public final class StorageAccountInner extends Resource { /* * Gets the SKU. */ - @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) private Sku sku; /* * Gets the Kind. */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) private Kind kind; /* * The identity of the resource. */ - @JsonProperty(value = "identity") private Identity identity; /* * The extendedLocation of the resource. */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* * Properties of the storage account. */ - @JsonProperty(value = "properties") private StorageAccountPropertiesInner 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 StorageAccountInner class. */ @@ -143,6 +156,36 @@ private StorageAccountPropertiesInner 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; + } + /** * {@inheritDoc} */ @@ -868,4 +911,64 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountInner 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 StorageAccountInner. + */ + public static StorageAccountInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountInner deserializedStorageAccountInner = new StorageAccountInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageAccountInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageAccountInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageAccountInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedStorageAccountInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedStorageAccountInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedStorageAccountInner.sku = Sku.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedStorageAccountInner.kind = Kind.fromString(reader.getString()); + } else if ("identity".equals(fieldName)) { + deserializedStorageAccountInner.identity = Identity.fromJson(reader); + } else if ("extendedLocation".equals(fieldName)) { + deserializedStorageAccountInner.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedStorageAccountInner.innerProperties = StorageAccountPropertiesInner.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountListKeysResultInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountListKeysResultInner.java index 5458d6276bea9..7481d71dd52bc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountListKeysResultInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountListKeysResultInner.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.storage.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.storage.models.StorageAccountKey; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response from the ListKeys operation. */ @Immutable -public final class StorageAccountListKeysResultInner { +public final class StorageAccountListKeysResultInner implements JsonSerializable { /* * Gets the list of storage account keys and their properties for the specified storage account. */ - @JsonProperty(value = "keys", access = JsonProperty.Access.WRITE_ONLY) private List keys; /** @@ -46,4 +49,41 @@ public void validate() { keys().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountListKeysResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountListKeysResultInner 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 StorageAccountListKeysResultInner. + */ + public static StorageAccountListKeysResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountListKeysResultInner deserializedStorageAccountListKeysResultInner + = new StorageAccountListKeysResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keys".equals(fieldName)) { + List keys = reader.readArray(reader1 -> StorageAccountKey.fromJson(reader1)); + deserializedStorageAccountListKeysResultInner.keys = keys; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountListKeysResultInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountMigrationInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountMigrationInner.java index 19ad315a3159a..4bf641e4fe1f0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountMigrationInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountMigrationInner.java @@ -6,38 +6,38 @@ 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.storage.models.MigrationStatus; import com.azure.resourcemanager.storage.models.SkuName; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The parameters or status associated with an ongoing or enqueued storage account migration in order to update its * current SKU or region. */ @Fluent -public final class StorageAccountMigrationInner { +public final class StorageAccountMigrationInner implements JsonSerializable { /* * Migration Resource Id */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * current value is 'default' for customer initiated migration */ - @JsonProperty(value = "name") private String name; /* * SrpAccountMigrationType in ARM contract which is 'accountMigrations' */ - @JsonProperty(value = "type") private String type; /* * The properties of a storage account’s ongoing or enqueued migration. */ - @JsonProperty(value = "properties", required = true) private StorageAccountMigrationProperties innerStorageAccountMigrationDetails = new StorageAccountMigrationProperties(); @@ -180,4 +180,50 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(StorageAccountMigrationInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerStorageAccountMigrationDetails); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountMigrationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountMigrationInner 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 StorageAccountMigrationInner. + */ + public static StorageAccountMigrationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountMigrationInner deserializedStorageAccountMigrationInner = new StorageAccountMigrationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedStorageAccountMigrationInner.innerStorageAccountMigrationDetails + = StorageAccountMigrationProperties.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedStorageAccountMigrationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageAccountMigrationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageAccountMigrationInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountMigrationInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountMigrationProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountMigrationProperties.java index 5a85ccb6577d3..966cd55339d8d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountMigrationProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountMigrationProperties.java @@ -6,37 +6,37 @@ 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.storage.models.MigrationStatus; import com.azure.resourcemanager.storage.models.SkuName; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of a storage account’s ongoing or enqueued migration. */ @Fluent -public final class StorageAccountMigrationProperties { +public final class StorageAccountMigrationProperties implements JsonSerializable { /* * Target sku name for the account */ - @JsonProperty(value = "targetSkuName", required = true) private SkuName targetSkuName; /* * Current status of migration */ - @JsonProperty(value = "migrationStatus", access = JsonProperty.Access.WRITE_ONLY) private MigrationStatus migrationStatus; /* * Error code for migration failure */ - @JsonProperty(value = "migrationFailedReason", access = JsonProperty.Access.WRITE_ONLY) private String migrationFailedReason; /* * Reason for migration failure */ - @JsonProperty(value = "migrationFailedDetailedReason", access = JsonProperty.Access.WRITE_ONLY) private String migrationFailedDetailedReason; /** @@ -106,4 +106,50 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(StorageAccountMigrationProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetSkuName", this.targetSkuName == null ? null : this.targetSkuName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountMigrationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountMigrationProperties 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 StorageAccountMigrationProperties. + */ + public static StorageAccountMigrationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountMigrationProperties deserializedStorageAccountMigrationProperties + = new StorageAccountMigrationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("targetSkuName".equals(fieldName)) { + deserializedStorageAccountMigrationProperties.targetSkuName + = SkuName.fromString(reader.getString()); + } else if ("migrationStatus".equals(fieldName)) { + deserializedStorageAccountMigrationProperties.migrationStatus + = MigrationStatus.fromString(reader.getString()); + } else if ("migrationFailedReason".equals(fieldName)) { + deserializedStorageAccountMigrationProperties.migrationFailedReason = reader.getString(); + } else if ("migrationFailedDetailedReason".equals(fieldName)) { + deserializedStorageAccountMigrationProperties.migrationFailedDetailedReason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountMigrationProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesCreateParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesCreateParameters.java index c8f47e6c389c7..66596beff34fa 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesCreateParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesCreateParameters.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.storage.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.storage.models.AccessTier; import com.azure.resourcemanager.storage.models.AllowedCopyScope; import com.azure.resourcemanager.storage.models.AzureFilesIdentityBasedAuthentication; @@ -19,36 +23,33 @@ import com.azure.resourcemanager.storage.models.PublicNetworkAccess; import com.azure.resourcemanager.storage.models.RoutingPreference; import com.azure.resourcemanager.storage.models.SasPolicy; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The parameters used to create the storage account. */ @Fluent -public final class StorageAccountPropertiesCreateParameters { +public final class StorageAccountPropertiesCreateParameters + implements JsonSerializable { /* * Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. */ - @JsonProperty(value = "allowedCopyScope") private AllowedCopyScope allowedCopyScope; /* * Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage * Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; /* * SasPolicy assigned to the storage account. */ - @JsonProperty(value = "sasPolicy") private SasPolicy sasPolicy; /* * KeyPolicy assigned to the storage account. */ - @JsonProperty(value = "keyPolicy") private KeyPolicy keyPolicy; /* @@ -56,19 +57,16 @@ public final class StorageAccountPropertiesCreateParameters { * storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name * property. */ - @JsonProperty(value = "customDomain") private CustomDomain customDomain; /* * Encryption settings to be used for server-side encryption for the storage account. */ - @JsonProperty(value = "encryption") private Encryption encryption; /* * Network rule set */ - @JsonProperty(value = "networkAcls") private NetworkRuleSet networkRuleSet; /* @@ -76,70 +74,59 @@ public final class StorageAccountPropertiesCreateParameters { * tier is the default value for premium block blobs storage account type and it cannot be changed for the premium * block blobs storage account type. */ - @JsonProperty(value = "accessTier") private AccessTier accessTier; /* * Provides the identity based authentication settings for Azure Files. */ - @JsonProperty(value = "azureFilesIdentityBasedAuthentication") private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; /* * Allows https traffic only to storage service if sets to true. The default value is true since API version * 2019-04-01. */ - @JsonProperty(value = "supportsHttpsTrafficOnly") private Boolean enableHttpsTrafficOnly; /* * Enables Secure File Transfer Protocol, if set to true */ - @JsonProperty(value = "isSftpEnabled") private Boolean isSftpEnabled; /* * Enables local users feature, if set to true */ - @JsonProperty(value = "isLocalUserEnabled") private Boolean isLocalUserEnabled; /* * Enables extended group support with local users feature, if set to true */ - @JsonProperty(value = "enableExtendedGroups") private Boolean enableExtendedGroups; /* * Account HierarchicalNamespace enabled if sets to true. */ - @JsonProperty(value = "isHnsEnabled") private Boolean isHnsEnabled; /* * Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. */ - @JsonProperty(value = "largeFileSharesState") private LargeFileSharesState largeFileSharesState; /* * Maintains information about the network routing choice opted by the user for data transfer */ - @JsonProperty(value = "routingPreference") private RoutingPreference routingPreference; /* * Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is * false for this property. */ - @JsonProperty(value = "allowBlobPublicAccess") private Boolean allowBlobPublicAccess; /* * Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for * this property. */ - @JsonProperty(value = "minimumTlsVersion") private MinimumTlsVersion minimumTlsVersion; /* @@ -147,13 +134,11 @@ public final class StorageAccountPropertiesCreateParameters { * Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active * Directory (Azure AD). The default value is null, which is equivalent to true. */ - @JsonProperty(value = "allowSharedKeyAccess") private Boolean allowSharedKeyAccess; /* * NFS 3.0 protocol support enabled if set to true. */ - @JsonProperty(value = "isNfsV3Enabled") private Boolean enableNfsV3; /* @@ -161,21 +146,18 @@ public final class StorageAccountPropertiesCreateParameters { * only if object replication policies will involve storage accounts in different AAD tenants. The default * interpretation is false for new accounts to follow best security practices by default. */ - @JsonProperty(value = "allowCrossTenantReplication") private Boolean allowCrossTenantReplication; /* * A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is * false for this property. */ - @JsonProperty(value = "defaultToOAuthAuthentication") private Boolean defaultToOAuthAuthentication; /* * The property is immutable and can only be set to true at the account creation time. When set to true, it enables * object level immutability for all the new containers in the account by default. */ - @JsonProperty(value = "immutableStorageWithVersioning") private ImmutableStorageAccount immutableStorageWithVersioning; /* @@ -183,7 +165,6 @@ public final class StorageAccountPropertiesCreateParameters { * single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric * DNS Zone identifier. */ - @JsonProperty(value = "dnsEndpointType") private DnsEndpointType dnsEndpointType; /** @@ -754,4 +735,135 @@ public void validate() { immutableStorageWithVersioning().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("allowedCopyScope", + this.allowedCopyScope == null ? null : this.allowedCopyScope.toString()); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("sasPolicy", this.sasPolicy); + jsonWriter.writeJsonField("keyPolicy", this.keyPolicy); + jsonWriter.writeJsonField("customDomain", this.customDomain); + jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeJsonField("networkAcls", this.networkRuleSet); + jsonWriter.writeStringField("accessTier", this.accessTier == null ? null : this.accessTier.toString()); + jsonWriter.writeJsonField("azureFilesIdentityBasedAuthentication", this.azureFilesIdentityBasedAuthentication); + jsonWriter.writeBooleanField("supportsHttpsTrafficOnly", this.enableHttpsTrafficOnly); + jsonWriter.writeBooleanField("isSftpEnabled", this.isSftpEnabled); + jsonWriter.writeBooleanField("isLocalUserEnabled", this.isLocalUserEnabled); + jsonWriter.writeBooleanField("enableExtendedGroups", this.enableExtendedGroups); + jsonWriter.writeBooleanField("isHnsEnabled", this.isHnsEnabled); + jsonWriter.writeStringField("largeFileSharesState", + this.largeFileSharesState == null ? null : this.largeFileSharesState.toString()); + jsonWriter.writeJsonField("routingPreference", this.routingPreference); + jsonWriter.writeBooleanField("allowBlobPublicAccess", this.allowBlobPublicAccess); + jsonWriter.writeStringField("minimumTlsVersion", + this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString()); + jsonWriter.writeBooleanField("allowSharedKeyAccess", this.allowSharedKeyAccess); + jsonWriter.writeBooleanField("isNfsV3Enabled", this.enableNfsV3); + jsonWriter.writeBooleanField("allowCrossTenantReplication", this.allowCrossTenantReplication); + jsonWriter.writeBooleanField("defaultToOAuthAuthentication", this.defaultToOAuthAuthentication); + jsonWriter.writeJsonField("immutableStorageWithVersioning", this.immutableStorageWithVersioning); + jsonWriter.writeStringField("dnsEndpointType", + this.dnsEndpointType == null ? null : this.dnsEndpointType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountPropertiesCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountPropertiesCreateParameters 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 StorageAccountPropertiesCreateParameters. + */ + public static StorageAccountPropertiesCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountPropertiesCreateParameters deserializedStorageAccountPropertiesCreateParameters + = new StorageAccountPropertiesCreateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedCopyScope".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.allowedCopyScope + = AllowedCopyScope.fromString(reader.getString()); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("sasPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.sasPolicy = SasPolicy.fromJson(reader); + } else if ("keyPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.keyPolicy = KeyPolicy.fromJson(reader); + } else if ("customDomain".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.customDomain = CustomDomain.fromJson(reader); + } else if ("encryption".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.encryption = Encryption.fromJson(reader); + } else if ("networkAcls".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.networkRuleSet + = NetworkRuleSet.fromJson(reader); + } else if ("accessTier".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.accessTier + = AccessTier.fromString(reader.getString()); + } else if ("azureFilesIdentityBasedAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.azureFilesIdentityBasedAuthentication + = AzureFilesIdentityBasedAuthentication.fromJson(reader); + } else if ("supportsHttpsTrafficOnly".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.enableHttpsTrafficOnly + = reader.getNullable(JsonReader::getBoolean); + } else if ("isSftpEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.isSftpEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("isLocalUserEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.isLocalUserEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableExtendedGroups".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.enableExtendedGroups + = reader.getNullable(JsonReader::getBoolean); + } else if ("isHnsEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.isHnsEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("largeFileSharesState".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.largeFileSharesState + = LargeFileSharesState.fromString(reader.getString()); + } else if ("routingPreference".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.routingPreference + = RoutingPreference.fromJson(reader); + } else if ("allowBlobPublicAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.allowBlobPublicAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.minimumTlsVersion + = MinimumTlsVersion.fromString(reader.getString()); + } else if ("allowSharedKeyAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.allowSharedKeyAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("isNfsV3Enabled".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.enableNfsV3 + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowCrossTenantReplication".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.allowCrossTenantReplication + = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultToOAuthAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.defaultToOAuthAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("immutableStorageWithVersioning".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.immutableStorageWithVersioning + = ImmutableStorageAccount.fromJson(reader); + } else if ("dnsEndpointType".equals(fieldName)) { + deserializedStorageAccountPropertiesCreateParameters.dnsEndpointType + = DnsEndpointType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountPropertiesCreateParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesInner.java index f0fbd2b05f5e3..dbfbfca3a835a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesInner.java @@ -5,6 +5,11 @@ package com.azure.resourcemanager.storage.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.storage.models.AccessTier; import com.azure.resourcemanager.storage.models.AccountStatus; import com.azure.resourcemanager.storage.models.AllowedCopyScope; @@ -25,7 +30,7 @@ import com.azure.resourcemanager.storage.models.RoutingPreference; import com.azure.resourcemanager.storage.models.SasPolicy; import com.azure.resourcemanager.storage.models.StorageAccountSkuConversionStatus; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; @@ -33,30 +38,26 @@ * Properties of the storage account. */ @Fluent -public final class StorageAccountPropertiesInner { +public final class StorageAccountPropertiesInner implements JsonSerializable { /* * Gets the status of the storage account at the time the operation was called. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that * Standard_ZRS and Premium_LRS accounts only return the blob endpoint. */ - @JsonProperty(value = "primaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) private Endpoints primaryEndpoints; /* * Gets the location of the primary data center for the storage account. */ - @JsonProperty(value = "primaryLocation", access = JsonProperty.Access.WRITE_ONLY) private String primaryLocation; /* * Gets the status indicating whether the primary location of the storage account is available or unavailable. */ - @JsonProperty(value = "statusOfPrimary", access = JsonProperty.Access.WRITE_ONLY) private AccountStatus statusOfPrimary; /* @@ -64,64 +65,54 @@ public final class StorageAccountPropertiesInner { * timestamp is retained. This element is not returned if there has never been a failover instance. Only available * if the accountType is Standard_GRS or Standard_RAGRS. */ - @JsonProperty(value = "lastGeoFailoverTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastGeoFailoverTime; /* * Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is * Standard_GRS or Standard_RAGRS. */ - @JsonProperty(value = "secondaryLocation", access = JsonProperty.Access.WRITE_ONLY) private String secondaryLocation; /* * Gets the status indicating whether the secondary location of the storage account is available or unavailable. * Only available if the SKU name is Standard_GRS or Standard_RAGRS. */ - @JsonProperty(value = "statusOfSecondary", access = JsonProperty.Access.WRITE_ONLY) private AccountStatus statusOfSecondary; /* * Gets the creation date and time of the storage account in UTC. */ - @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime creationTime; /* * Gets the custom domain the user assigned to this storage account. */ - @JsonProperty(value = "customDomain", access = JsonProperty.Access.WRITE_ONLY) private CustomDomain customDomain; /* * SasPolicy assigned to the storage account. */ - @JsonProperty(value = "sasPolicy", access = JsonProperty.Access.WRITE_ONLY) private SasPolicy sasPolicy; /* * KeyPolicy assigned to the storage account. */ - @JsonProperty(value = "keyPolicy", access = JsonProperty.Access.WRITE_ONLY) private KeyPolicy keyPolicy; /* * Storage account keys creation time. */ - @JsonProperty(value = "keyCreationTime", access = JsonProperty.Access.WRITE_ONLY) private KeyCreationTime keyCreationTime; /* * Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary * location of the storage account. Only available if the SKU name is Standard_RAGRS. */ - @JsonProperty(value = "secondaryEndpoints", access = JsonProperty.Access.WRITE_ONLY) private Endpoints secondaryEndpoints; /* * Encryption settings to be used for server-side encryption for the storage account. */ - @JsonProperty(value = "encryption", access = JsonProperty.Access.WRITE_ONLY) private Encryption encryption; /* @@ -129,99 +120,83 @@ public final class StorageAccountPropertiesInner { * tier is the default value for premium block blobs storage account type and it cannot be changed for the premium * block blobs storage account type. */ - @JsonProperty(value = "accessTier", access = JsonProperty.Access.WRITE_ONLY) private AccessTier accessTier; /* * Provides the identity based authentication settings for Azure Files. */ - @JsonProperty(value = "azureFilesIdentityBasedAuthentication") private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; /* * Allows https traffic only to storage service if sets to true. */ - @JsonProperty(value = "supportsHttpsTrafficOnly") private Boolean enableHttpsTrafficOnly; /* * Network rule set */ - @JsonProperty(value = "networkAcls", access = JsonProperty.Access.WRITE_ONLY) private NetworkRuleSet networkRuleSet; /* * Enables Secure File Transfer Protocol, if set to true */ - @JsonProperty(value = "isSftpEnabled") private Boolean isSftpEnabled; /* * Enables local users feature, if set to true */ - @JsonProperty(value = "isLocalUserEnabled") private Boolean isLocalUserEnabled; /* * Enables extended group support with local users feature, if set to true */ - @JsonProperty(value = "enableExtendedGroups") private Boolean enableExtendedGroups; /* * Account HierarchicalNamespace enabled if sets to true. */ - @JsonProperty(value = "isHnsEnabled") private Boolean isHnsEnabled; /* * Geo Replication Stats */ - @JsonProperty(value = "geoReplicationStats", access = JsonProperty.Access.WRITE_ONLY) private GeoReplicationStats geoReplicationStats; /* * If the failover is in progress, the value will be true, otherwise, it will be null. */ - @JsonProperty(value = "failoverInProgress", access = JsonProperty.Access.WRITE_ONLY) private Boolean failoverInProgress; /* * Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. */ - @JsonProperty(value = "largeFileSharesState") private LargeFileSharesState largeFileSharesState; /* * List of private endpoint connection associated with the specified storage account */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; /* * Maintains information about the network routing choice opted by the user for data transfer */ - @JsonProperty(value = "routingPreference") private RoutingPreference routingPreference; /* * Blob restore status */ - @JsonProperty(value = "blobRestoreStatus", access = JsonProperty.Access.WRITE_ONLY) private BlobRestoreStatusInner blobRestoreStatus; /* * Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is * false for this property. */ - @JsonProperty(value = "allowBlobPublicAccess") private Boolean allowBlobPublicAccess; /* * Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for * this property. */ - @JsonProperty(value = "minimumTlsVersion") private MinimumTlsVersion minimumTlsVersion; /* @@ -229,13 +204,11 @@ public final class StorageAccountPropertiesInner { * Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active * Directory (Azure AD). The default value is null, which is equivalent to true. */ - @JsonProperty(value = "allowSharedKeyAccess") private Boolean allowSharedKeyAccess; /* * NFS 3.0 protocol support enabled if set to true. */ - @JsonProperty(value = "isNfsV3Enabled") private Boolean enableNfsV3; /* @@ -243,40 +216,34 @@ public final class StorageAccountPropertiesInner { * only if object replication policies will involve storage accounts in different AAD tenants. The default * interpretation is false for new accounts to follow best security practices by default. */ - @JsonProperty(value = "allowCrossTenantReplication") private Boolean allowCrossTenantReplication; /* * A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is * false for this property. */ - @JsonProperty(value = "defaultToOAuthAuthentication") private Boolean defaultToOAuthAuthentication; /* * Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage * Account. */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; /* * The property is immutable and can only be set to true at the account creation time. When set to true, it enables * object level immutability for all the containers in the account by default. */ - @JsonProperty(value = "immutableStorageWithVersioning") private ImmutableStorageAccount immutableStorageWithVersioning; /* * Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. */ - @JsonProperty(value = "allowedCopyScope") private AllowedCopyScope allowedCopyScope; /* * This property is readOnly and is set by server during asynchronous storage account sku conversion operations. */ - @JsonProperty(value = "storageAccountSkuConversionStatus") private StorageAccountSkuConversionStatus storageAccountSkuConversionStatus; /* @@ -284,19 +251,16 @@ public final class StorageAccountPropertiesInner { * single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric * DNS Zone identifier. */ - @JsonProperty(value = "dnsEndpointType") private DnsEndpointType dnsEndpointType; /* * This property will be set to true or false on an event of ongoing migration. Default value is null. */ - @JsonProperty(value = "isSkuConversionBlocked", access = JsonProperty.Access.WRITE_ONLY) private Boolean isSkuConversionBlocked; /* * If customer initiated account migration is in progress, the value will be true else it will be null. */ - @JsonProperty(value = "accountMigrationInProgress", access = JsonProperty.Access.WRITE_ONLY) private Boolean accountMigrationInProgress; /** @@ -988,4 +952,172 @@ public void validate() { storageAccountSkuConversionStatus().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("azureFilesIdentityBasedAuthentication", this.azureFilesIdentityBasedAuthentication); + jsonWriter.writeBooleanField("supportsHttpsTrafficOnly", this.enableHttpsTrafficOnly); + jsonWriter.writeBooleanField("isSftpEnabled", this.isSftpEnabled); + jsonWriter.writeBooleanField("isLocalUserEnabled", this.isLocalUserEnabled); + jsonWriter.writeBooleanField("enableExtendedGroups", this.enableExtendedGroups); + jsonWriter.writeBooleanField("isHnsEnabled", this.isHnsEnabled); + jsonWriter.writeStringField("largeFileSharesState", + this.largeFileSharesState == null ? null : this.largeFileSharesState.toString()); + jsonWriter.writeJsonField("routingPreference", this.routingPreference); + jsonWriter.writeBooleanField("allowBlobPublicAccess", this.allowBlobPublicAccess); + jsonWriter.writeStringField("minimumTlsVersion", + this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString()); + jsonWriter.writeBooleanField("allowSharedKeyAccess", this.allowSharedKeyAccess); + jsonWriter.writeBooleanField("isNfsV3Enabled", this.enableNfsV3); + jsonWriter.writeBooleanField("allowCrossTenantReplication", this.allowCrossTenantReplication); + jsonWriter.writeBooleanField("defaultToOAuthAuthentication", this.defaultToOAuthAuthentication); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("immutableStorageWithVersioning", this.immutableStorageWithVersioning); + jsonWriter.writeStringField("allowedCopyScope", + this.allowedCopyScope == null ? null : this.allowedCopyScope.toString()); + jsonWriter.writeJsonField("storageAccountSkuConversionStatus", this.storageAccountSkuConversionStatus); + jsonWriter.writeStringField("dnsEndpointType", + this.dnsEndpointType == null ? null : this.dnsEndpointType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountPropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountPropertiesInner 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 StorageAccountPropertiesInner. + */ + public static StorageAccountPropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountPropertiesInner deserializedStorageAccountPropertiesInner + = new StorageAccountPropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("primaryEndpoints".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.primaryEndpoints = Endpoints.fromJson(reader); + } else if ("primaryLocation".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.primaryLocation = reader.getString(); + } else if ("statusOfPrimary".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.statusOfPrimary + = AccountStatus.fromString(reader.getString()); + } else if ("lastGeoFailoverTime".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.lastGeoFailoverTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("secondaryLocation".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.secondaryLocation = reader.getString(); + } else if ("statusOfSecondary".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.statusOfSecondary + = AccountStatus.fromString(reader.getString()); + } else if ("creationTime".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.creationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("customDomain".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.customDomain = CustomDomain.fromJson(reader); + } else if ("sasPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.sasPolicy = SasPolicy.fromJson(reader); + } else if ("keyPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.keyPolicy = KeyPolicy.fromJson(reader); + } else if ("keyCreationTime".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.keyCreationTime = KeyCreationTime.fromJson(reader); + } else if ("secondaryEndpoints".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.secondaryEndpoints = Endpoints.fromJson(reader); + } else if ("encryption".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.encryption = Encryption.fromJson(reader); + } else if ("accessTier".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.accessTier = AccessTier.fromString(reader.getString()); + } else if ("azureFilesIdentityBasedAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.azureFilesIdentityBasedAuthentication + = AzureFilesIdentityBasedAuthentication.fromJson(reader); + } else if ("supportsHttpsTrafficOnly".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.enableHttpsTrafficOnly + = reader.getNullable(JsonReader::getBoolean); + } else if ("networkAcls".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.networkRuleSet = NetworkRuleSet.fromJson(reader); + } else if ("isSftpEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.isSftpEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("isLocalUserEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.isLocalUserEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableExtendedGroups".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.enableExtendedGroups + = reader.getNullable(JsonReader::getBoolean); + } else if ("isHnsEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.isHnsEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("geoReplicationStats".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.geoReplicationStats + = GeoReplicationStats.fromJson(reader); + } else if ("failoverInProgress".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.failoverInProgress + = reader.getNullable(JsonReader::getBoolean); + } else if ("largeFileSharesState".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.largeFileSharesState + = LargeFileSharesState.fromString(reader.getString()); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedStorageAccountPropertiesInner.privateEndpointConnections = privateEndpointConnections; + } else if ("routingPreference".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.routingPreference = RoutingPreference.fromJson(reader); + } else if ("blobRestoreStatus".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.blobRestoreStatus + = BlobRestoreStatusInner.fromJson(reader); + } else if ("allowBlobPublicAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.allowBlobPublicAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.minimumTlsVersion + = MinimumTlsVersion.fromString(reader.getString()); + } else if ("allowSharedKeyAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.allowSharedKeyAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("isNfsV3Enabled".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.enableNfsV3 = reader.getNullable(JsonReader::getBoolean); + } else if ("allowCrossTenantReplication".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.allowCrossTenantReplication + = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultToOAuthAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.defaultToOAuthAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("immutableStorageWithVersioning".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.immutableStorageWithVersioning + = ImmutableStorageAccount.fromJson(reader); + } else if ("allowedCopyScope".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.allowedCopyScope + = AllowedCopyScope.fromString(reader.getString()); + } else if ("storageAccountSkuConversionStatus".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.storageAccountSkuConversionStatus + = StorageAccountSkuConversionStatus.fromJson(reader); + } else if ("dnsEndpointType".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.dnsEndpointType + = DnsEndpointType.fromString(reader.getString()); + } else if ("isSkuConversionBlocked".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.isSkuConversionBlocked + = reader.getNullable(JsonReader::getBoolean); + } else if ("accountMigrationInProgress".equals(fieldName)) { + deserializedStorageAccountPropertiesInner.accountMigrationInProgress + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountPropertiesInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesUpdateParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesUpdateParameters.java index c931bdd7bd7b1..f8dc2758d92a1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesUpdateParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesUpdateParameters.java @@ -5,6 +5,10 @@ package com.azure.resourcemanager.storage.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.storage.models.AccessTier; import com.azure.resourcemanager.storage.models.AllowedCopyScope; import com.azure.resourcemanager.storage.models.AzureFilesIdentityBasedAuthentication; @@ -19,38 +23,35 @@ import com.azure.resourcemanager.storage.models.PublicNetworkAccess; import com.azure.resourcemanager.storage.models.RoutingPreference; import com.azure.resourcemanager.storage.models.SasPolicy; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The parameters used when updating a storage account. */ @Fluent -public final class StorageAccountPropertiesUpdateParameters { +public final class StorageAccountPropertiesUpdateParameters + implements JsonSerializable { /* * Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is * supported per storage account at this time. To clear the existing custom domain, use an empty string for the * custom domain name property. */ - @JsonProperty(value = "customDomain") private CustomDomain customDomain; /* * Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be * disabled. */ - @JsonProperty(value = "encryption") private Encryption encryption; /* * SasPolicy assigned to the storage account. */ - @JsonProperty(value = "sasPolicy") private SasPolicy sasPolicy; /* * KeyPolicy assigned to the storage account. */ - @JsonProperty(value = "keyPolicy") private KeyPolicy keyPolicy; /* @@ -58,69 +59,58 @@ public final class StorageAccountPropertiesUpdateParameters { * tier is the default value for premium block blobs storage account type and it cannot be changed for the premium * block blobs storage account type. */ - @JsonProperty(value = "accessTier") private AccessTier accessTier; /* * Provides the identity based authentication settings for Azure Files. */ - @JsonProperty(value = "azureFilesIdentityBasedAuthentication") private AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication; /* * Allows https traffic only to storage service if sets to true. */ - @JsonProperty(value = "supportsHttpsTrafficOnly") private Boolean enableHttpsTrafficOnly; /* * Enables Secure File Transfer Protocol, if set to true */ - @JsonProperty(value = "isSftpEnabled") private Boolean isSftpEnabled; /* * Enables local users feature, if set to true */ - @JsonProperty(value = "isLocalUserEnabled") private Boolean isLocalUserEnabled; /* * Enables extended group support with local users feature, if set to true */ - @JsonProperty(value = "enableExtendedGroups") private Boolean enableExtendedGroups; /* * Network rule set */ - @JsonProperty(value = "networkAcls") private NetworkRuleSet networkRuleSet; /* * Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. */ - @JsonProperty(value = "largeFileSharesState") private LargeFileSharesState largeFileSharesState; /* * Maintains information about the network routing choice opted by the user for data transfer */ - @JsonProperty(value = "routingPreference") private RoutingPreference routingPreference; /* * Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is * false for this property. */ - @JsonProperty(value = "allowBlobPublicAccess") private Boolean allowBlobPublicAccess; /* * Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for * this property. */ - @JsonProperty(value = "minimumTlsVersion") private MinimumTlsVersion minimumTlsVersion; /* @@ -128,7 +118,6 @@ public final class StorageAccountPropertiesUpdateParameters { * Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active * Directory (Azure AD). The default value is null, which is equivalent to true. */ - @JsonProperty(value = "allowSharedKeyAccess") private Boolean allowSharedKeyAccess; /* @@ -136,34 +125,29 @@ public final class StorageAccountPropertiesUpdateParameters { * only if object replication policies will involve storage accounts in different AAD tenants. The default * interpretation is false for new accounts to follow best security practices by default. */ - @JsonProperty(value = "allowCrossTenantReplication") private Boolean allowCrossTenantReplication; /* * A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is * false for this property. */ - @JsonProperty(value = "defaultToOAuthAuthentication") private Boolean defaultToOAuthAuthentication; /* * Allow, disallow, or let Network Security Perimeter configuration to evaluate public network access to Storage * Account. Value is optional but if passed in, must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; /* * The property is immutable and can only be set to true at the account creation time. When set to true, it enables * object level immutability for all the containers in the account by default. */ - @JsonProperty(value = "immutableStorageWithVersioning") private ImmutableStorageAccount immutableStorageWithVersioning; /* * Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. */ - @JsonProperty(value = "allowedCopyScope") private AllowedCopyScope allowedCopyScope; /* @@ -171,7 +155,6 @@ public final class StorageAccountPropertiesUpdateParameters { * single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric * DNS Zone identifier. */ - @JsonProperty(value = "dnsEndpointType") private DnsEndpointType dnsEndpointType; /** @@ -702,4 +685,127 @@ public void validate() { immutableStorageWithVersioning().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("customDomain", this.customDomain); + jsonWriter.writeJsonField("encryption", this.encryption); + jsonWriter.writeJsonField("sasPolicy", this.sasPolicy); + jsonWriter.writeJsonField("keyPolicy", this.keyPolicy); + jsonWriter.writeStringField("accessTier", this.accessTier == null ? null : this.accessTier.toString()); + jsonWriter.writeJsonField("azureFilesIdentityBasedAuthentication", this.azureFilesIdentityBasedAuthentication); + jsonWriter.writeBooleanField("supportsHttpsTrafficOnly", this.enableHttpsTrafficOnly); + jsonWriter.writeBooleanField("isSftpEnabled", this.isSftpEnabled); + jsonWriter.writeBooleanField("isLocalUserEnabled", this.isLocalUserEnabled); + jsonWriter.writeBooleanField("enableExtendedGroups", this.enableExtendedGroups); + jsonWriter.writeJsonField("networkAcls", this.networkRuleSet); + jsonWriter.writeStringField("largeFileSharesState", + this.largeFileSharesState == null ? null : this.largeFileSharesState.toString()); + jsonWriter.writeJsonField("routingPreference", this.routingPreference); + jsonWriter.writeBooleanField("allowBlobPublicAccess", this.allowBlobPublicAccess); + jsonWriter.writeStringField("minimumTlsVersion", + this.minimumTlsVersion == null ? null : this.minimumTlsVersion.toString()); + jsonWriter.writeBooleanField("allowSharedKeyAccess", this.allowSharedKeyAccess); + jsonWriter.writeBooleanField("allowCrossTenantReplication", this.allowCrossTenantReplication); + jsonWriter.writeBooleanField("defaultToOAuthAuthentication", this.defaultToOAuthAuthentication); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + jsonWriter.writeJsonField("immutableStorageWithVersioning", this.immutableStorageWithVersioning); + jsonWriter.writeStringField("allowedCopyScope", + this.allowedCopyScope == null ? null : this.allowedCopyScope.toString()); + jsonWriter.writeStringField("dnsEndpointType", + this.dnsEndpointType == null ? null : this.dnsEndpointType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountPropertiesUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountPropertiesUpdateParameters 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 StorageAccountPropertiesUpdateParameters. + */ + public static StorageAccountPropertiesUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountPropertiesUpdateParameters deserializedStorageAccountPropertiesUpdateParameters + = new StorageAccountPropertiesUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customDomain".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.customDomain = CustomDomain.fromJson(reader); + } else if ("encryption".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.encryption = Encryption.fromJson(reader); + } else if ("sasPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.sasPolicy = SasPolicy.fromJson(reader); + } else if ("keyPolicy".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.keyPolicy = KeyPolicy.fromJson(reader); + } else if ("accessTier".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.accessTier + = AccessTier.fromString(reader.getString()); + } else if ("azureFilesIdentityBasedAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.azureFilesIdentityBasedAuthentication + = AzureFilesIdentityBasedAuthentication.fromJson(reader); + } else if ("supportsHttpsTrafficOnly".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.enableHttpsTrafficOnly + = reader.getNullable(JsonReader::getBoolean); + } else if ("isSftpEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.isSftpEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("isLocalUserEnabled".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.isLocalUserEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableExtendedGroups".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.enableExtendedGroups + = reader.getNullable(JsonReader::getBoolean); + } else if ("networkAcls".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.networkRuleSet + = NetworkRuleSet.fromJson(reader); + } else if ("largeFileSharesState".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.largeFileSharesState + = LargeFileSharesState.fromString(reader.getString()); + } else if ("routingPreference".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.routingPreference + = RoutingPreference.fromJson(reader); + } else if ("allowBlobPublicAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.allowBlobPublicAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("minimumTlsVersion".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.minimumTlsVersion + = MinimumTlsVersion.fromString(reader.getString()); + } else if ("allowSharedKeyAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.allowSharedKeyAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowCrossTenantReplication".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.allowCrossTenantReplication + = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultToOAuthAuthentication".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.defaultToOAuthAuthentication + = reader.getNullable(JsonReader::getBoolean); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("immutableStorageWithVersioning".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.immutableStorageWithVersioning + = ImmutableStorageAccount.fromJson(reader); + } else if ("allowedCopyScope".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.allowedCopyScope + = AllowedCopyScope.fromString(reader.getString()); + } else if ("dnsEndpointType".equals(fieldName)) { + deserializedStorageAccountPropertiesUpdateParameters.dnsEndpointType + = DnsEndpointType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountPropertiesUpdateParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageQueueInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageQueueInner.java index f89ed07868355..3ecdedb520f64 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageQueueInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageQueueInner.java @@ -6,7 +6,10 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** @@ -17,9 +20,23 @@ public final class StorageQueueInner extends ProxyResource { /* * Queue resource properties. */ - @JsonProperty(value = "properties") private QueueProperties innerQueueProperties; + /* + * 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 StorageQueueInner class. */ @@ -35,6 +52,36 @@ private QueueProperties innerQueueProperties() { return this.innerQueueProperties; } + /** + * 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 metadata property: A name-value pair that represents queue metadata. * @@ -78,4 +125,47 @@ public void validate() { innerQueueProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerQueueProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageQueueInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageQueueInner 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 StorageQueueInner. + */ + public static StorageQueueInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageQueueInner deserializedStorageQueueInner = new StorageQueueInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageQueueInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageQueueInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageQueueInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedStorageQueueInner.innerQueueProperties = QueueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageQueueInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageTaskAssignmentInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageTaskAssignmentInner.java index cddea55cfbc6b..ad077d4ac8a5c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageTaskAssignmentInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageTaskAssignmentInner.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.storage.models.StorageTaskAssignmentProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The storage task assignment. @@ -18,9 +21,23 @@ public final class StorageTaskAssignmentInner extends ProxyResource { /* * Properties of the storage task assignment. */ - @JsonProperty(value = "properties", required = true) private StorageTaskAssignmentProperties 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 StorageTaskAssignmentInner class. */ @@ -47,6 +64,36 @@ public StorageTaskAssignmentInner withProperties(StorageTaskAssignmentProperties 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. * @@ -63,4 +110,48 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentInner 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 StorageTaskAssignmentInner. + */ + public static StorageTaskAssignmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentInner deserializedStorageTaskAssignmentInner = new StorageTaskAssignmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageTaskAssignmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageTaskAssignmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageTaskAssignmentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedStorageTaskAssignmentInner.properties + = StorageTaskAssignmentProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageTaskReportInstanceInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageTaskReportInstanceInner.java index 5adf07b4ef996..a0cca9970e1c3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageTaskReportInstanceInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageTaskReportInstanceInner.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.storage.models.StorageTaskReportProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Storage Tasks run report instance. @@ -17,9 +20,23 @@ public final class StorageTaskReportInstanceInner extends ProxyResource { /* * Storage task execution report for a run instance. */ - @JsonProperty(value = "properties") private StorageTaskReportProperties 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 StorageTaskReportInstanceInner class. */ @@ -46,6 +63,36 @@ public StorageTaskReportInstanceInner withProperties(StorageTaskReportProperties 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 StorageTaskReportInstanceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskReportInstanceInner 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 StorageTaskReportInstanceInner. + */ + public static StorageTaskReportInstanceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskReportInstanceInner deserializedStorageTaskReportInstanceInner + = new StorageTaskReportInstanceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedStorageTaskReportInstanceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedStorageTaskReportInstanceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedStorageTaskReportInstanceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedStorageTaskReportInstanceInner.properties + = StorageTaskReportProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskReportInstanceInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableInner.java index 325b794fe2258..5429cee7702d3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableInner.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.storage.models.TableSignedIdentifier; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -18,9 +21,23 @@ public final class TableInner extends ProxyResource { /* * Table resource properties. */ - @JsonProperty(value = "properties") private TableProperties innerTableProperties; + /* + * 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 TableInner class. */ @@ -36,6 +53,36 @@ private TableProperties innerTableProperties() { return this.innerTableProperties; } + /** + * 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 tableName property: Table name under the specified account. * @@ -78,4 +125,47 @@ public void validate() { innerTableProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerTableProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableInner 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 TableInner. + */ + public static TableInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableInner deserializedTableInner = new TableInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTableInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTableInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTableInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTableInner.innerTableProperties = TableProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTableInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableProperties.java index 3ffc156d14a5b..bd5d2f35fe0f1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableProperties.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.storage.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.storage.models.TableSignedIdentifier; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The TableProperties model. */ @Fluent -public final class TableProperties { +public final class TableProperties implements JsonSerializable { /* * Table name under the specified account */ - @JsonProperty(value = "tableName", access = JsonProperty.Access.WRITE_ONLY) private String tableName; /* * List of stored access policies specified on the table. */ - @JsonProperty(value = "signedIdentifiers") private List signedIdentifiers; /** @@ -71,4 +73,45 @@ public void validate() { signedIdentifiers().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("signedIdentifiers", this.signedIdentifiers, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableProperties 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 TableProperties. + */ + public static TableProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableProperties deserializedTableProperties = new TableProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tableName".equals(fieldName)) { + deserializedTableProperties.tableName = reader.getString(); + } else if ("signedIdentifiers".equals(fieldName)) { + List signedIdentifiers + = reader.readArray(reader1 -> TableSignedIdentifier.fromJson(reader1)); + deserializedTableProperties.signedIdentifiers = signedIdentifiers; + } else { + reader.skipChildren(); + } + } + + return deserializedTableProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesInner.java index ffebb02eb55ef..b001d31062e80 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesInner.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.storage.models.CorsRules; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of a storage account’s Table service. @@ -17,9 +20,23 @@ public final class TableServicePropertiesInner extends ProxyResource { /* * The properties of a storage account’s Table service. */ - @JsonProperty(value = "properties") private TableServicePropertiesProperties innerTableServiceProperties; + /* + * 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 TableServicePropertiesInner class. */ @@ -35,6 +52,36 @@ private TableServicePropertiesProperties innerTableServiceProperties() { return this.innerTableServiceProperties; } + /** + * 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 cors property: Specifies CORS rules for the Table service. You can include up to five CorsRule elements * in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and @@ -72,4 +119,48 @@ public void validate() { innerTableServiceProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerTableServiceProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableServicePropertiesInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableServicePropertiesInner 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 TableServicePropertiesInner. + */ + public static TableServicePropertiesInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableServicePropertiesInner deserializedTableServicePropertiesInner = new TableServicePropertiesInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTableServicePropertiesInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTableServicePropertiesInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTableServicePropertiesInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTableServicePropertiesInner.innerTableServiceProperties + = TableServicePropertiesProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTableServicePropertiesInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesProperties.java index 9b7976ab3c9d0..3c104f130d742 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesProperties.java @@ -5,20 +5,23 @@ package com.azure.resourcemanager.storage.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.storage.models.CorsRules; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The properties of a storage account’s Table service. */ @Fluent -public final class TableServicePropertiesProperties { +public final class TableServicePropertiesProperties implements JsonSerializable { /* * Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no * CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for * the Table service. */ - @JsonProperty(value = "cors") private CorsRules cors; /** @@ -61,4 +64,41 @@ public void validate() { cors().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("cors", this.cors); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableServicePropertiesProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableServicePropertiesProperties 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 TableServicePropertiesProperties. + */ + public static TableServicePropertiesProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableServicePropertiesProperties deserializedTableServicePropertiesProperties + = new TableServicePropertiesProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cors".equals(fieldName)) { + deserializedTableServicePropertiesProperties.cors = CorsRules.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTableServicePropertiesProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/UsageInner.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/UsageInner.java index 2338794c438bc..25867333fd5fe 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/UsageInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/UsageInner.java @@ -5,37 +5,37 @@ package com.azure.resourcemanager.storage.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.storage.models.UsageName; import com.azure.resourcemanager.storage.models.UsageUnit; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * Describes Storage Resource Usage. */ @Immutable -public final class UsageInner { +public final class UsageInner implements JsonSerializable { /* * Gets the unit of measurement. */ - @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private UsageUnit unit; /* * Gets the current count of the allocated resources in the subscription. */ - @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) private Integer currentValue; /* * Gets the maximum count of the resources that can be allocated in the subscription. */ - @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) private Integer limit; /* * Gets the name of the type of usage. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private UsageName name; /** @@ -90,4 +90,45 @@ public void validate() { name().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageInner 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 UsageInner. + */ + public static UsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageInner deserializedUsageInner = new UsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unit".equals(fieldName)) { + deserializedUsageInner.unit = UsageUnit.fromString(reader.getString()); + } else if ("currentValue".equals(fieldName)) { + deserializedUsageInner.currentValue = reader.getNullable(JsonReader::getInt); + } else if ("limit".equals(fieldName)) { + deserializedUsageInner.limit = reader.getNullable(JsonReader::getInt); + } else if ("name".equals(fieldName)) { + deserializedUsageInner.name = UsageName.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersClientImpl.java index c04c8d6089a4a..7b7c9304fbcb7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersClientImpl.java @@ -1449,9 +1449,9 @@ public LegalHoldInner clearLegalHold(String resourceGroupName, String accountNam * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1504,9 +1504,9 @@ public LegalHoldInner clearLegalHold(String resourceGroupName, String accountNam * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1585,9 +1585,9 @@ public Mono createOrUpdateImmutabilityPolicyAsync(Strin * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @param parameters The ImmutabilityPolicy Properties that will be created or updated to a blob container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1638,9 +1638,9 @@ public ImmutabilityPolicyInner createOrUpdateImmutabilityPolicy(String resourceG * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1687,9 +1687,9 @@ public Mono getImmutabilityPolicyWi * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -1760,9 +1760,9 @@ public Mono getImmutabilityPolicyAsync(String resourceG * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -1811,9 +1811,9 @@ public ImmutabilityPolicyInner getImmutabilityPolicy(String resourceGroupName, S * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1865,9 +1865,9 @@ public Mono deleteImmutabilityPo * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -1919,9 +1919,9 @@ private Mono deleteImmutabilityP * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1947,9 +1947,9 @@ public Mono deleteImmutabilityPolicyAsync(String resour * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -1975,9 +1975,9 @@ public BlobContainersDeleteImmutabilityPolicyResponse deleteImmutabilityPolicyWi * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2001,9 +2001,9 @@ public ImmutabilityPolicyInner deleteImmutabilityPolicy(String resourceGroupName * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2053,9 +2053,9 @@ public Mono lockImmutabilityPolicy * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -2104,9 +2104,9 @@ private Mono lockImmutabilityPolic * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2131,9 +2131,9 @@ public Mono lockImmutabilityPolicyAsync(String resource * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @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. @@ -2158,9 +2158,9 @@ public BlobContainersLockImmutabilityPolicyResponse lockImmutabilityPolicyWithRe * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2184,9 +2184,9 @@ public ImmutabilityPolicyInner lockImmutabilityPolicy(String resourceGroupName, * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2241,9 +2241,9 @@ public Mono extendImmutabilityPo * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2298,9 +2298,9 @@ private Mono extendImmutabilityP * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2326,9 +2326,9 @@ public Mono extendImmutabilityPolicyAsync(String resour * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @param parameters The ImmutabilityPolicy Properties that will be extended for a blob container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2354,9 +2354,9 @@ public BlobContainersExtendImmutabilityPolicyResponse extendImmutabilityPolicyWi * @param containerName The name of the blob container within the specified storage account. Blob container names * must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash * (-) character must be immediately preceded and followed by a letter or number. - * @param ifMatch The entity state (ETag) version of the immutability policy to update. A value of "*" can be used - * to apply the operation only if the immutability policy already exists. If omitted, this operation will always be - * applied. + * @param ifMatch The entity state (ETag) version of the immutability policy to update must be returned to the + * server for all update operations. The ETag value must include the leading and trailing double quotes as returned + * by the service. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessPolicy.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessPolicy.java index fc65ad8fdb487..c5bb666cf4ca4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessPolicy.java @@ -5,30 +5,33 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The AccessPolicy model. */ @Fluent -public final class AccessPolicy { +public final class AccessPolicy implements JsonSerializable { /* * Start time of the access policy */ - @JsonProperty(value = "startTime") private OffsetDateTime startTime; /* * Expiry time of the access policy */ - @JsonProperty(value = "expiryTime") private OffsetDateTime expiryTime; /* * List of abbreviated permissions. */ - @JsonProperty(value = "permission") private String permission; /** @@ -104,4 +107,50 @@ public AccessPolicy withPermission(String permission) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("expiryTime", + this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); + jsonWriter.writeStringField("permission", this.permission); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessPolicy 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 AccessPolicy. + */ + public static AccessPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessPolicy deserializedAccessPolicy = new AccessPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedAccessPolicy.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expiryTime".equals(fieldName)) { + deserializedAccessPolicy.expiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("permission".equals(fieldName)) { + deserializedAccessPolicy.permission = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessTier.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessTier.java index 08fc921094a3f..60cb46c8b9ab3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessTier.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessTier.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access * tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block @@ -48,7 +45,6 @@ public enum AccessTier { * @param value the serialized value to parse. * @return the parsed AccessTier object, or null if unable to parse. */ - @JsonCreator public static AccessTier fromString(String value) { if (value == null) { return null; @@ -65,7 +61,6 @@ public static AccessTier fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountImmutabilityPolicyProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountImmutabilityPolicyProperties.java index 7f694e2e0d94b..5a78b938505a2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountImmutabilityPolicyProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountImmutabilityPolicyProperties.java @@ -5,17 +5,21 @@ package com.azure.resourcemanager.storage.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; /** * This defines account-level immutability policy properties. */ @Fluent -public final class AccountImmutabilityPolicyProperties { +public final class AccountImmutabilityPolicyProperties + implements JsonSerializable { /* * The immutability period for the blobs in the container since the policy creation, in days. */ - @JsonProperty(value = "immutabilityPeriodSinceCreationInDays") private Integer immutabilityPeriodSinceCreationInDays; /* @@ -25,7 +29,6 @@ public final class AccountImmutabilityPolicyProperties { * in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can * transition to a Locked state which cannot be reverted. */ - @JsonProperty(value = "state") private AccountImmutabilityPolicyState state; /* @@ -33,7 +36,6 @@ public final class AccountImmutabilityPolicyProperties { * blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks * can be added and any existing blocks cannot be modified or deleted. */ - @JsonProperty(value = "allowProtectedAppendWrites") private Boolean allowProtectedAppendWrites; /** @@ -126,4 +128,51 @@ public AccountImmutabilityPolicyProperties withAllowProtectedAppendWrites(Boolea */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("immutabilityPeriodSinceCreationInDays", + this.immutabilityPeriodSinceCreationInDays); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeBooleanField("allowProtectedAppendWrites", this.allowProtectedAppendWrites); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountImmutabilityPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountImmutabilityPolicyProperties 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 AccountImmutabilityPolicyProperties. + */ + public static AccountImmutabilityPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountImmutabilityPolicyProperties deserializedAccountImmutabilityPolicyProperties + = new AccountImmutabilityPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("immutabilityPeriodSinceCreationInDays".equals(fieldName)) { + deserializedAccountImmutabilityPolicyProperties.immutabilityPeriodSinceCreationInDays + = reader.getNullable(JsonReader::getInt); + } else if ("state".equals(fieldName)) { + deserializedAccountImmutabilityPolicyProperties.state + = AccountImmutabilityPolicyState.fromString(reader.getString()); + } else if ("allowProtectedAppendWrites".equals(fieldName)) { + deserializedAccountImmutabilityPolicyProperties.allowProtectedAppendWrites + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountImmutabilityPolicyProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountImmutabilityPolicyState.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountImmutabilityPolicyState.java index 80b83a6fd2d8d..e3015cc1a2ed3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountImmutabilityPolicyState.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountImmutabilityPolicyState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -46,7 +45,6 @@ public AccountImmutabilityPolicyState() { * @param name a name to look for. * @return the corresponding AccountImmutabilityPolicyState. */ - @JsonCreator public static AccountImmutabilityPolicyState fromString(String name) { return fromString(name, AccountImmutabilityPolicyState.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountSasParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountSasParameters.java index e89c913f1627b..bcf4515f22e25 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountSasParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountSasParameters.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The parameters to list SAS credentials of a storage account. */ @Fluent -public final class AccountSasParameters { +public final class AccountSasParameters implements JsonSerializable { /* * The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), * File (f). */ - @JsonProperty(value = "signedServices", required = true) private Services services; /* @@ -26,44 +31,37 @@ public final class AccountSasParameters { * Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, * table entities, and files. */ - @JsonProperty(value = "signedResourceTypes", required = true) private SignedResourceTypes resourceTypes; /* * The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), * Add (a), Create (c), Update (u) and Process (p). */ - @JsonProperty(value = "signedPermission", required = true) private Permissions permissions; /* * An IP address or a range of IP addresses from which to accept requests. */ - @JsonProperty(value = "signedIp") private String ipAddressOrRange; /* * The protocol permitted for a request made with the account SAS. */ - @JsonProperty(value = "signedProtocol") private HttpProtocol protocols; /* * The time at which the SAS becomes valid. */ - @JsonProperty(value = "signedStart") private OffsetDateTime sharedAccessStartTime; /* * The time at which the shared access signature becomes invalid. */ - @JsonProperty(value = "signedExpiry", required = true) private OffsetDateTime sharedAccessExpiryTime; /* * The key to sign the account SAS token with. */ - @JsonProperty(value = "keyToSign") private String keyToSign; /** @@ -268,4 +266,71 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(AccountSasParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("signedServices", this.services == null ? null : this.services.toString()); + jsonWriter.writeStringField("signedResourceTypes", + this.resourceTypes == null ? null : this.resourceTypes.toString()); + jsonWriter.writeStringField("signedPermission", this.permissions == null ? null : this.permissions.toString()); + jsonWriter.writeStringField("signedExpiry", + this.sharedAccessExpiryTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sharedAccessExpiryTime)); + jsonWriter.writeStringField("signedIp", this.ipAddressOrRange); + jsonWriter.writeStringField("signedProtocol", this.protocols == null ? null : this.protocols.toString()); + jsonWriter.writeStringField("signedStart", + this.sharedAccessStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sharedAccessStartTime)); + jsonWriter.writeStringField("keyToSign", this.keyToSign); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountSasParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountSasParameters 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 AccountSasParameters. + */ + public static AccountSasParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountSasParameters deserializedAccountSasParameters = new AccountSasParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("signedServices".equals(fieldName)) { + deserializedAccountSasParameters.services = Services.fromString(reader.getString()); + } else if ("signedResourceTypes".equals(fieldName)) { + deserializedAccountSasParameters.resourceTypes = SignedResourceTypes.fromString(reader.getString()); + } else if ("signedPermission".equals(fieldName)) { + deserializedAccountSasParameters.permissions = Permissions.fromString(reader.getString()); + } else if ("signedExpiry".equals(fieldName)) { + deserializedAccountSasParameters.sharedAccessExpiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("signedIp".equals(fieldName)) { + deserializedAccountSasParameters.ipAddressOrRange = reader.getString(); + } else if ("signedProtocol".equals(fieldName)) { + deserializedAccountSasParameters.protocols = HttpProtocol.fromString(reader.getString()); + } else if ("signedStart".equals(fieldName)) { + deserializedAccountSasParameters.sharedAccessStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("keyToSign".equals(fieldName)) { + deserializedAccountSasParameters.keyToSign = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountSasParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatus.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatus.java index d909fd36490aa..d6fe64ee7ebdb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatus.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Gets the status indicating whether the primary location of the storage account is available or unavailable. */ @@ -36,7 +33,6 @@ public enum AccountStatus { * @param value the serialized value to parse. * @return the parsed AccountStatus object, or null if unable to parse. */ - @JsonCreator public static AccountStatus fromString(String value) { if (value == null) { return null; @@ -53,7 +49,6 @@ public static AccountStatus fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Action.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Action.java index d79fa391be3cc..ba0ad34b83ff3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Action.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Action.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * The action of virtual network rule. */ @@ -31,7 +28,6 @@ public enum Action { * @param value the serialized value to parse. * @return the parsed Action object, or null if unable to parse. */ - @JsonCreator public static Action fromString(String value) { if (value == null) { return null; @@ -48,7 +44,6 @@ public static Action fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryProperties.java index 0b7e69c77bdc8..8e0c3eecc0664 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryProperties.java @@ -6,59 +6,55 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Settings properties for Active Directory (AD). */ @Fluent -public final class ActiveDirectoryProperties { +public final class ActiveDirectoryProperties implements JsonSerializable { /* * Specifies the primary domain that the AD DNS server is authoritative for. */ - @JsonProperty(value = "domainName", required = true) private String domainName; /* * Specifies the NetBIOS domain name. */ - @JsonProperty(value = "netBiosDomainName") private String netBiosDomainName; /* * Specifies the Active Directory forest to get. */ - @JsonProperty(value = "forestName") private String forestName; /* * Specifies the domain GUID. */ - @JsonProperty(value = "domainGuid", required = true) private String domainGuid; /* * Specifies the security identifier (SID). */ - @JsonProperty(value = "domainSid") private String domainSid; /* * Specifies the security identifier (SID) for Azure Storage. */ - @JsonProperty(value = "azureStorageSid") private String azureStorageSid; /* * Specifies the Active Directory SAMAccountName for Azure Storage. */ - @JsonProperty(value = "samAccountName") private String samAccountName; /* * Specifies the Active Directory account type for Azure Storage. */ - @JsonProperty(value = "accountType") private ActiveDirectoryPropertiesAccountType accountType; /** @@ -246,4 +242,63 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ActiveDirectoryProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("domainName", this.domainName); + jsonWriter.writeStringField("domainGuid", this.domainGuid); + jsonWriter.writeStringField("netBiosDomainName", this.netBiosDomainName); + jsonWriter.writeStringField("forestName", this.forestName); + jsonWriter.writeStringField("domainSid", this.domainSid); + jsonWriter.writeStringField("azureStorageSid", this.azureStorageSid); + jsonWriter.writeStringField("samAccountName", this.samAccountName); + jsonWriter.writeStringField("accountType", this.accountType == null ? null : this.accountType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ActiveDirectoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ActiveDirectoryProperties 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 ActiveDirectoryProperties. + */ + public static ActiveDirectoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ActiveDirectoryProperties deserializedActiveDirectoryProperties = new ActiveDirectoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("domainName".equals(fieldName)) { + deserializedActiveDirectoryProperties.domainName = reader.getString(); + } else if ("domainGuid".equals(fieldName)) { + deserializedActiveDirectoryProperties.domainGuid = reader.getString(); + } else if ("netBiosDomainName".equals(fieldName)) { + deserializedActiveDirectoryProperties.netBiosDomainName = reader.getString(); + } else if ("forestName".equals(fieldName)) { + deserializedActiveDirectoryProperties.forestName = reader.getString(); + } else if ("domainSid".equals(fieldName)) { + deserializedActiveDirectoryProperties.domainSid = reader.getString(); + } else if ("azureStorageSid".equals(fieldName)) { + deserializedActiveDirectoryProperties.azureStorageSid = reader.getString(); + } else if ("samAccountName".equals(fieldName)) { + deserializedActiveDirectoryProperties.samAccountName = reader.getString(); + } else if ("accountType".equals(fieldName)) { + deserializedActiveDirectoryProperties.accountType + = ActiveDirectoryPropertiesAccountType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedActiveDirectoryProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryPropertiesAccountType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryPropertiesAccountType.java index 25643fd460c89..ae4c5348c310d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryPropertiesAccountType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryPropertiesAccountType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public ActiveDirectoryPropertiesAccountType() { * @param name a name to look for. * @return the corresponding ActiveDirectoryPropertiesAccountType. */ - @JsonCreator public static ActiveDirectoryPropertiesAccountType fromString(String name) { return fromString(name, ActiveDirectoryPropertiesAccountType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AllowedCopyScope.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AllowedCopyScope.java index 04565ae12ca40..fc803bec29723 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AllowedCopyScope.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AllowedCopyScope.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public AllowedCopyScope() { * @param name a name to look for. * @return the corresponding AllowedCopyScope. */ - @JsonCreator public static AllowedCopyScope fromString(String name) { return fromString(name, AllowedCopyScope.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureEntityResource.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureEntityResource.java index 1fde51180fdb6..fe7eabdc95c3a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureEntityResource.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureEntityResource.java @@ -6,7 +6,10 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Entity Resource @@ -18,9 +21,23 @@ public class AzureEntityResource extends ProxyResource { /* * Resource Etag. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /* + * 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 AzureEntityResource class. */ @@ -36,6 +53,47 @@ public String etag() { return this.etag; } + /** + * Set the etag property: Resource Etag. + * + * @param etag the etag value to set. + * @return the AzureEntityResource object itself. + */ + AzureEntityResource withEtag(String etag) { + this.etag = etag; + 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. * @@ -43,4 +101,46 @@ public String etag() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureEntityResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureEntityResource 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 AzureEntityResource. + */ + public static AzureEntityResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureEntityResource deserializedAzureEntityResource = new AzureEntityResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAzureEntityResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAzureEntityResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAzureEntityResource.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedAzureEntityResource.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureEntityResource; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureFilesIdentityBasedAuthentication.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureFilesIdentityBasedAuthentication.java index d80187a693aad..4fb8a9dc47c62 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureFilesIdentityBasedAuthentication.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureFilesIdentityBasedAuthentication.java @@ -6,29 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Settings for Azure Files identity based authentication. */ @Fluent -public final class AzureFilesIdentityBasedAuthentication { +public final class AzureFilesIdentityBasedAuthentication + implements JsonSerializable { /* * Indicates the directory service used. Note that this enum may be extended in the future. */ - @JsonProperty(value = "directoryServiceOptions", required = true) private DirectoryServiceOptions directoryServiceOptions; /* * Required if directoryServiceOptions are AD, optional if they are AADKERB. */ - @JsonProperty(value = "activeDirectoryProperties") private ActiveDirectoryProperties activeDirectoryProperties; /* * Default share permission for users using Kerberos authentication if RBAC role is not assigned. */ - @JsonProperty(value = "defaultSharePermission") private DefaultSharePermission defaultSharePermission; /** @@ -123,4 +125,53 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(AzureFilesIdentityBasedAuthentication.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("directoryServiceOptions", + this.directoryServiceOptions == null ? null : this.directoryServiceOptions.toString()); + jsonWriter.writeJsonField("activeDirectoryProperties", this.activeDirectoryProperties); + jsonWriter.writeStringField("defaultSharePermission", + this.defaultSharePermission == null ? null : this.defaultSharePermission.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFilesIdentityBasedAuthentication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFilesIdentityBasedAuthentication 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 AzureFilesIdentityBasedAuthentication. + */ + public static AzureFilesIdentityBasedAuthentication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureFilesIdentityBasedAuthentication deserializedAzureFilesIdentityBasedAuthentication + = new AzureFilesIdentityBasedAuthentication(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("directoryServiceOptions".equals(fieldName)) { + deserializedAzureFilesIdentityBasedAuthentication.directoryServiceOptions + = DirectoryServiceOptions.fromString(reader.getString()); + } else if ("activeDirectoryProperties".equals(fieldName)) { + deserializedAzureFilesIdentityBasedAuthentication.activeDirectoryProperties + = ActiveDirectoryProperties.fromJson(reader); + } else if ("defaultSharePermission".equals(fieldName)) { + deserializedAzureFilesIdentityBasedAuthentication.defaultSharePermission + = DefaultSharePermission.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureFilesIdentityBasedAuthentication; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java index 757570352b3b9..86e418a57f3a6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; /** * The BlobContainersCreateOrUpdateImmutabilityPolicyHeaders model. @@ -17,7 +16,6 @@ public final class BlobContainersCreateOrUpdateImmutabilityPolicyHeaders { /* * The Etag property. */ - @JsonProperty(value = "Etag") private String etag; // HttpHeaders containing the raw property values. diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyHeaders.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyHeaders.java index e5762d731a9d0..4237e67fc3f48 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyHeaders.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyHeaders.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; /** * The BlobContainersDeleteImmutabilityPolicyHeaders model. @@ -17,7 +16,6 @@ public final class BlobContainersDeleteImmutabilityPolicyHeaders { /* * The Etag property. */ - @JsonProperty(value = "Etag") private String etag; // HttpHeaders containing the raw property values. diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyHeaders.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyHeaders.java index 258dec20699fa..e292d8c87aabb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyHeaders.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyHeaders.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; /** * The BlobContainersExtendImmutabilityPolicyHeaders model. @@ -17,7 +16,6 @@ public final class BlobContainersExtendImmutabilityPolicyHeaders { /* * The Etag property. */ - @JsonProperty(value = "Etag") private String etag; // HttpHeaders containing the raw property values. diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyHeaders.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyHeaders.java index 5209854306025..a8c76adb827d7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyHeaders.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyHeaders.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; /** * The BlobContainersGetImmutabilityPolicyHeaders model. @@ -17,7 +16,6 @@ public final class BlobContainersGetImmutabilityPolicyHeaders { /* * The Etag property. */ - @JsonProperty(value = "Etag") private String etag; // HttpHeaders containing the raw property values. diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyHeaders.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyHeaders.java index 220ad16def44d..3b9c64dbe96bd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyHeaders.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyHeaders.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; /** * The BlobContainersLockImmutabilityPolicyHeaders model. @@ -17,7 +16,6 @@ public final class BlobContainersLockImmutabilityPolicyHeaders { /* * The Etag property. */ - @JsonProperty(value = "Etag") private String etag; // HttpHeaders containing the raw property values. diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryCreationTime.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryCreationTime.java index ceed3f13d10fd..7d764513af61d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryCreationTime.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryCreationTime.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.storage.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; /** * This property defines the creation time based filtering condition. Blob Inventory schema parameter 'Creation-Time' is * mandatory with this filter. */ @Fluent -public final class BlobInventoryCreationTime { +public final class BlobInventoryCreationTime implements JsonSerializable { /* * When set the policy filters the objects that are created in the last N days. Where N is an integer value between * 1 to 36500. */ - @JsonProperty(value = "lastNDays") private Integer lastNDays; /** @@ -55,4 +58,40 @@ public BlobInventoryCreationTime withLastNDays(Integer lastNDays) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("lastNDays", this.lastNDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryCreationTime from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryCreationTime 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 BlobInventoryCreationTime. + */ + public static BlobInventoryCreationTime fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryCreationTime deserializedBlobInventoryCreationTime = new BlobInventoryCreationTime(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastNDays".equals(fieldName)) { + deserializedBlobInventoryCreationTime.lastNDays = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryCreationTime; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyDefinition.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyDefinition.java index 9e1218dbb6c91..ab03a304d33b2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyDefinition.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyDefinition.java @@ -6,37 +6,37 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * An object that defines the blob inventory rule. */ @Fluent -public final class BlobInventoryPolicyDefinition { +public final class BlobInventoryPolicyDefinition implements JsonSerializable { /* * An object that defines the filter set. */ - @JsonProperty(value = "filters") private BlobInventoryPolicyFilter filters; /* * This is a required field, it specifies the format for the inventory files. */ - @JsonProperty(value = "format", required = true) private Format format; /* * This is a required field. This field is used to schedule an inventory formation. */ - @JsonProperty(value = "schedule", required = true) private Schedule schedule; /* * This is a required field. This field specifies the scope of the inventory created either at the blob or container * level. */ - @JsonProperty(value = "objectType", required = true) private ObjectType objectType; /* @@ -57,7 +57,6 @@ public final class BlobInventoryPolicyDefinition { * Group, Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' * are only valid for Non-Hns accounts. */ - @JsonProperty(value = "schemaFields", required = true) private List schemaFields; /** @@ -230,4 +229,55 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicyDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("format", this.format == null ? null : this.format.toString()); + jsonWriter.writeStringField("schedule", this.schedule == null ? null : this.schedule.toString()); + jsonWriter.writeStringField("objectType", this.objectType == null ? null : this.objectType.toString()); + jsonWriter.writeArrayField("schemaFields", this.schemaFields, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("filters", this.filters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicyDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicyDefinition 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 BlobInventoryPolicyDefinition. + */ + public static BlobInventoryPolicyDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicyDefinition deserializedBlobInventoryPolicyDefinition + = new BlobInventoryPolicyDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("format".equals(fieldName)) { + deserializedBlobInventoryPolicyDefinition.format = Format.fromString(reader.getString()); + } else if ("schedule".equals(fieldName)) { + deserializedBlobInventoryPolicyDefinition.schedule = Schedule.fromString(reader.getString()); + } else if ("objectType".equals(fieldName)) { + deserializedBlobInventoryPolicyDefinition.objectType = ObjectType.fromString(reader.getString()); + } else if ("schemaFields".equals(fieldName)) { + List schemaFields = reader.readArray(reader1 -> reader1.getString()); + deserializedBlobInventoryPolicyDefinition.schemaFields = schemaFields; + } else if ("filters".equals(fieldName)) { + deserializedBlobInventoryPolicyDefinition.filters = BlobInventoryPolicyFilter.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicyDefinition; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyFilter.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyFilter.java index 82edb28bd2020..2e5590a25bae0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyFilter.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyFilter.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -14,38 +18,33 @@ * only prefixMatch is applicable and is optional. */ @Fluent -public final class BlobInventoryPolicyFilter { +public final class BlobInventoryPolicyFilter implements JsonSerializable { /* * An array of strings with maximum 10 blob prefixes to be included in the inventory. */ - @JsonProperty(value = "prefixMatch") private List prefixMatch; /* * An array of strings with maximum 10 blob prefixes to be excluded from the inventory. */ - @JsonProperty(value = "excludePrefix") private List excludePrefix; /* * An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not * support pageBlobs. This field is required when definition.objectType property is set to 'Blob'. */ - @JsonProperty(value = "blobTypes") private List blobTypes; /* * Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId * and IsCurrentVersion' are required if this property is set to true, else they must be excluded. */ - @JsonProperty(value = "includeBlobVersions") private Boolean includeBlobVersions; /* * Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' * is required if this property is set to true, else it must be excluded. */ - @JsonProperty(value = "includeSnapshots") private Boolean includeSnapshots; /* @@ -55,13 +54,11 @@ public final class BlobInventoryPolicyFilter { * disabled accounts the definition.schemaFields must include 'Deleted and RemainingRetentionDays', else it must be * excluded. */ - @JsonProperty(value = "includeDeleted") private Boolean includeDeleted; /* * This property is used to filter objects based on the object creation time */ - @JsonProperty(value = "creationTime") private BlobInventoryCreationTime creationTime; /** @@ -240,4 +237,63 @@ public void validate() { creationTime().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("prefixMatch", this.prefixMatch, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("excludePrefix", this.excludePrefix, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("blobTypes", this.blobTypes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("includeBlobVersions", this.includeBlobVersions); + jsonWriter.writeBooleanField("includeSnapshots", this.includeSnapshots); + jsonWriter.writeBooleanField("includeDeleted", this.includeDeleted); + jsonWriter.writeJsonField("creationTime", this.creationTime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicyFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicyFilter 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 BlobInventoryPolicyFilter. + */ + public static BlobInventoryPolicyFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicyFilter deserializedBlobInventoryPolicyFilter = new BlobInventoryPolicyFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefixMatch".equals(fieldName)) { + List prefixMatch = reader.readArray(reader1 -> reader1.getString()); + deserializedBlobInventoryPolicyFilter.prefixMatch = prefixMatch; + } else if ("excludePrefix".equals(fieldName)) { + List excludePrefix = reader.readArray(reader1 -> reader1.getString()); + deserializedBlobInventoryPolicyFilter.excludePrefix = excludePrefix; + } else if ("blobTypes".equals(fieldName)) { + List blobTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedBlobInventoryPolicyFilter.blobTypes = blobTypes; + } else if ("includeBlobVersions".equals(fieldName)) { + deserializedBlobInventoryPolicyFilter.includeBlobVersions + = reader.getNullable(JsonReader::getBoolean); + } else if ("includeSnapshots".equals(fieldName)) { + deserializedBlobInventoryPolicyFilter.includeSnapshots = reader.getNullable(JsonReader::getBoolean); + } else if ("includeDeleted".equals(fieldName)) { + deserializedBlobInventoryPolicyFilter.includeDeleted = reader.getNullable(JsonReader::getBoolean); + } else if ("creationTime".equals(fieldName)) { + deserializedBlobInventoryPolicyFilter.creationTime = BlobInventoryCreationTime.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicyFilter; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyName.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyName.java index 630d069dc0d84..de6e453ed047b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyName.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyName.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public BlobInventoryPolicyName() { * @param name a name to look for. * @return the corresponding BlobInventoryPolicyName. */ - @JsonCreator public static BlobInventoryPolicyName fromString(String name) { return fromString(name, BlobInventoryPolicyName.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyRule.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyRule.java index 0f86dd32f3c76..6ffac1a9f18b2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyRule.java @@ -6,36 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * An object that wraps the blob inventory rule. Each rule is uniquely defined by name. */ @Fluent -public final class BlobInventoryPolicyRule { +public final class BlobInventoryPolicyRule implements JsonSerializable { /* * Rule is enabled when set to true. */ - @JsonProperty(value = "enabled", required = true) private boolean enabled; /* * A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be * unique within a policy. */ - @JsonProperty(value = "name", required = true) private String name; /* * Container name where blob inventory files are stored. Must be pre-created. */ - @JsonProperty(value = "destination", required = true) private String destination; /* * An object that defines the blob inventory policy rule. */ - @JsonProperty(value = "definition", required = true) private BlobInventoryPolicyDefinition definition; /** @@ -151,4 +151,50 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicyRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("destination", this.destination); + jsonWriter.writeJsonField("definition", this.definition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicyRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicyRule 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 BlobInventoryPolicyRule. + */ + public static BlobInventoryPolicyRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicyRule deserializedBlobInventoryPolicyRule = new BlobInventoryPolicyRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedBlobInventoryPolicyRule.enabled = reader.getBoolean(); + } else if ("name".equals(fieldName)) { + deserializedBlobInventoryPolicyRule.name = reader.getString(); + } else if ("destination".equals(fieldName)) { + deserializedBlobInventoryPolicyRule.destination = reader.getString(); + } else if ("definition".equals(fieldName)) { + deserializedBlobInventoryPolicyRule.definition = BlobInventoryPolicyDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicyRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicySchema.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicySchema.java index 43db9a0601d5f..d32a66eae161a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicySchema.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicySchema.java @@ -6,37 +6,37 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The storage account blob inventory policy rules. */ @Fluent -public final class BlobInventoryPolicySchema { +public final class BlobInventoryPolicySchema implements JsonSerializable { /* * Policy is enabled if set to true. */ - @JsonProperty(value = "enabled", required = true) private boolean enabled; /* * Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be * specified at the rule level 'policy.rule.destination' */ - @JsonProperty(value = "destination", access = JsonProperty.Access.WRITE_ONLY) private String destination; /* * The valid value is Inventory */ - @JsonProperty(value = "type", required = true) private InventoryRuleType type; /* * The storage account blob inventory policy rules. The rule is applied when it is enabled. */ - @JsonProperty(value = "rules", required = true) private List rules; /** @@ -135,4 +135,51 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BlobInventoryPolicySchema.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobInventoryPolicySchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobInventoryPolicySchema 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 BlobInventoryPolicySchema. + */ + public static BlobInventoryPolicySchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobInventoryPolicySchema deserializedBlobInventoryPolicySchema = new BlobInventoryPolicySchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedBlobInventoryPolicySchema.enabled = reader.getBoolean(); + } else if ("type".equals(fieldName)) { + deserializedBlobInventoryPolicySchema.type = InventoryRuleType.fromString(reader.getString()); + } else if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> BlobInventoryPolicyRule.fromJson(reader1)); + deserializedBlobInventoryPolicySchema.rules = rules; + } else if ("destination".equals(fieldName)) { + deserializedBlobInventoryPolicySchema.destination = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobInventoryPolicySchema; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreParameters.java index a86beaaebf582..c5cfaf355c51f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreParameters.java @@ -5,26 +5,30 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; /** * Blob restore parameters. */ @Fluent -public final class BlobRestoreParameters { +public final class BlobRestoreParameters implements JsonSerializable { /* * Restore blob to the specified time. */ - @JsonProperty(value = "timeToRestore", required = true) private OffsetDateTime timeToRestore; /* * Blob ranges to restore. */ - @JsonProperty(value = "blobRanges", required = true) private List blobRanges; /** @@ -94,4 +98,47 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BlobRestoreParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeToRestore", + this.timeToRestore == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.timeToRestore)); + jsonWriter.writeArrayField("blobRanges", this.blobRanges, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobRestoreParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobRestoreParameters 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 BlobRestoreParameters. + */ + public static BlobRestoreParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobRestoreParameters deserializedBlobRestoreParameters = new BlobRestoreParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeToRestore".equals(fieldName)) { + deserializedBlobRestoreParameters.timeToRestore = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("blobRanges".equals(fieldName)) { + List blobRanges = reader.readArray(reader1 -> BlobRestoreRange.fromJson(reader1)); + deserializedBlobRestoreParameters.blobRanges = blobRanges; + } else { + reader.skipChildren(); + } + } + + return deserializedBlobRestoreParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreProgressStatus.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreProgressStatus.java index f43098e1924d6..6767e64c04c88 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreProgressStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreProgressStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -44,7 +43,6 @@ public BlobRestoreProgressStatus() { * @param name a name to look for. * @return the corresponding BlobRestoreProgressStatus. */ - @JsonCreator public static BlobRestoreProgressStatus fromString(String name) { return fromString(name, BlobRestoreProgressStatus.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreRange.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreRange.java index 1dd1e62d2dca9..76f26bb54502e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreRange.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreRange.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Blob range. */ @Fluent -public final class BlobRestoreRange { +public final class BlobRestoreRange implements JsonSerializable { /* * Blob start range. This is inclusive. Empty means account start. */ - @JsonProperty(value = "startRange", required = true) private String startRange; /* * Blob end range. This is exclusive. Empty means account end. */ - @JsonProperty(value = "endRange", required = true) private String endRange; /** @@ -88,4 +90,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(BlobRestoreRange.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startRange", this.startRange); + jsonWriter.writeStringField("endRange", this.endRange); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobRestoreRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobRestoreRange 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 BlobRestoreRange. + */ + public static BlobRestoreRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobRestoreRange deserializedBlobRestoreRange = new BlobRestoreRange(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startRange".equals(fieldName)) { + deserializedBlobRestoreRange.startRange = reader.getString(); + } else if ("endRange".equals(fieldName)) { + deserializedBlobRestoreRange.endRange = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobRestoreRange; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServiceItems.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServiceItems.java index c601c313ddfcf..775ef2d764016 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServiceItems.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobServiceItems.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.BlobServicePropertiesInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The BlobServiceItems model. */ @Immutable -public final class BlobServiceItems { +public final class BlobServiceItems implements JsonSerializable { /* * List of blob services returned. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /** @@ -45,4 +48,41 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobServiceItems from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobServiceItems 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 BlobServiceItems. + */ + public static BlobServiceItems fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobServiceItems deserializedBlobServiceItems = new BlobServiceItems(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BlobServicePropertiesInner.fromJson(reader1)); + deserializedBlobServiceItems.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedBlobServiceItems; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Bypass.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Bypass.java index 2c753e9c392a3..4671cd9974224 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Bypass.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Bypass.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public Bypass() { * @param name a name to look for. * @return the corresponding Bypass. */ - @JsonCreator public static Bypass fromString(String name) { return fromString(name, Bypass.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ChangeFeed.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ChangeFeed.java index 50171588b55d3..cad0035e52eb4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ChangeFeed.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ChangeFeed.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.storage.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 blob service properties for change feed events. */ @Fluent -public final class ChangeFeed { +public final class ChangeFeed implements JsonSerializable { /* * Indicates whether change feed event logging is enabled for the Blob service. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days * (400 years). A null value indicates an infinite retention of the change feed. */ - @JsonProperty(value = "retentionInDays") private Integer retentionInDays; /** @@ -80,4 +82,43 @@ public ChangeFeed withRetentionInDays(Integer retentionInDays) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("retentionInDays", this.retentionInDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChangeFeed from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChangeFeed 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 ChangeFeed. + */ + public static ChangeFeed fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChangeFeed deserializedChangeFeed = new ChangeFeed(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedChangeFeed.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("retentionInDays".equals(fieldName)) { + deserializedChangeFeed.retentionInDays = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedChangeFeed; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRule.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRule.java index decc470b9ed6e..34a5f618387db 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRule.java @@ -6,44 +6,43 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Specifies a CORS rule for the Blob service. */ @Fluent -public final class CorsRule { +public final class CorsRule implements JsonSerializable { /* * Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow * all domains */ - @JsonProperty(value = "allowedOrigins", required = true) private List allowedOrigins; /* * Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. */ - @JsonProperty(value = "allowedMethods", required = true) private List allowedMethods; /* * Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight * response. */ - @JsonProperty(value = "maxAgeInSeconds", required = true) private int maxAgeInSeconds; /* * Required if CorsRule element is present. A list of response headers to expose to CORS clients. */ - @JsonProperty(value = "exposedHeaders", required = true) private List exposedHeaders; /* * Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. */ - @JsonProperty(value = "allowedHeaders", required = true) private List allowedHeaders; /** @@ -187,4 +186,62 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(CorsRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowedOrigins", this.allowedOrigins, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("allowedMethods", this.allowedMethods, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeIntField("maxAgeInSeconds", this.maxAgeInSeconds); + jsonWriter.writeArrayField("exposedHeaders", this.exposedHeaders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("allowedHeaders", this.allowedHeaders, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CorsRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CorsRule 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 CorsRule. + */ + public static CorsRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CorsRule deserializedCorsRule = new CorsRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedOrigins".equals(fieldName)) { + List allowedOrigins = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsRule.allowedOrigins = allowedOrigins; + } else if ("allowedMethods".equals(fieldName)) { + List allowedMethods + = reader.readArray(reader1 -> CorsRuleAllowedMethodsItem.fromString(reader1.getString())); + deserializedCorsRule.allowedMethods = allowedMethods; + } else if ("maxAgeInSeconds".equals(fieldName)) { + deserializedCorsRule.maxAgeInSeconds = reader.getInt(); + } else if ("exposedHeaders".equals(fieldName)) { + List exposedHeaders = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsRule.exposedHeaders = exposedHeaders; + } else if ("allowedHeaders".equals(fieldName)) { + List allowedHeaders = reader.readArray(reader1 -> reader1.getString()); + deserializedCorsRule.allowedHeaders = allowedHeaders; + } else { + reader.skipChildren(); + } + } + + return deserializedCorsRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRuleAllowedMethodsItem.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRuleAllowedMethodsItem.java index f832d520f0432..3838d59e15a00 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRuleAllowedMethodsItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRuleAllowedMethodsItem.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -77,7 +76,6 @@ public CorsRuleAllowedMethodsItem() { * @param name a name to look for. * @return the corresponding CorsRuleAllowedMethodsItem. */ - @JsonCreator public static CorsRuleAllowedMethodsItem fromString(String name) { return fromString(name, CorsRuleAllowedMethodsItem.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRules.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRules.java index fce250d9accfa..f7757c75fc52d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRules.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRules.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Sets the CORS rules. You can include up to five CorsRule elements in the request. */ @Fluent -public final class CorsRules { +public final class CorsRules implements JsonSerializable { /* * The List of CORS rules. You can include up to five CorsRule elements in the request. */ - @JsonProperty(value = "corsRules") private List corsRules; /** @@ -55,4 +58,41 @@ public void validate() { corsRules().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("corsRules", this.corsRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CorsRules from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CorsRules 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 CorsRules. + */ + public static CorsRules fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CorsRules deserializedCorsRules = new CorsRules(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("corsRules".equals(fieldName)) { + List corsRules = reader.readArray(reader1 -> CorsRule.fromJson(reader1)); + deserializedCorsRules.corsRules = corsRules; + } else { + reader.skipChildren(); + } + } + + return deserializedCorsRules; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CustomDomain.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CustomDomain.java index 3ea78e6c399d9..4fdfdea669636 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CustomDomain.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CustomDomain.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The custom domain assigned to this storage account. This can be set via Update. */ @Fluent -public final class CustomDomain { +public final class CustomDomain implements JsonSerializable { /* * Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. */ - @JsonProperty(value = "name", required = true) private String name; /* * Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on * updates. */ - @JsonProperty(value = "useSubDomainName") private Boolean useSubDomainName; /** @@ -89,4 +91,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(CustomDomain.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("useSubDomainName", this.useSubDomainName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomDomain from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomDomain 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 CustomDomain. + */ + public static CustomDomain fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomDomain deserializedCustomDomain = new CustomDomain(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCustomDomain.name = reader.getString(); + } else if ("useSubDomainName".equals(fieldName)) { + deserializedCustomDomain.useSubDomainName = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCustomDomain; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterCreation.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterCreation.java index 126e6ee66be4f..0a7f687591a70 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterCreation.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterCreation.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.storage.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; /** * Object to define snapshot and version action conditions. */ @Fluent -public final class DateAfterCreation { +public final class DateAfterCreation implements JsonSerializable { /* * Value indicating the age in days after creation */ - @JsonProperty(value = "daysAfterCreationGreaterThan", required = true) private float daysAfterCreationGreaterThan; /* @@ -23,7 +26,6 @@ public final class DateAfterCreation { * tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based * actions. The blob will be archived if both the conditions are satisfied. */ - @JsonProperty(value = "daysAfterLastTierChangeGreaterThan") private Float daysAfterLastTierChangeGreaterThan; /** @@ -83,4 +85,45 @@ public DateAfterCreation withDaysAfterLastTierChangeGreaterThan(Float daysAfterL */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeFloatField("daysAfterCreationGreaterThan", this.daysAfterCreationGreaterThan); + jsonWriter.writeNumberField("daysAfterLastTierChangeGreaterThan", this.daysAfterLastTierChangeGreaterThan); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DateAfterCreation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DateAfterCreation 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 DateAfterCreation. + */ + public static DateAfterCreation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DateAfterCreation deserializedDateAfterCreation = new DateAfterCreation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daysAfterCreationGreaterThan".equals(fieldName)) { + deserializedDateAfterCreation.daysAfterCreationGreaterThan = reader.getFloat(); + } else if ("daysAfterLastTierChangeGreaterThan".equals(fieldName)) { + deserializedDateAfterCreation.daysAfterLastTierChangeGreaterThan + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedDateAfterCreation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterModification.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterModification.java index aa27520438c96..20a5566e7eb0f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterModification.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterModification.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.storage.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; /** * Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan, @@ -15,18 +19,16 @@ * daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan. */ @Fluent -public final class DateAfterModification { +public final class DateAfterModification implements JsonSerializable { /* * Value indicating the age in days after last modification */ - @JsonProperty(value = "daysAfterModificationGreaterThan") private Float daysAfterModificationGreaterThan; /* * Value indicating the age in days after last blob access. This property can only be used in conjunction with last * access time tracking policy */ - @JsonProperty(value = "daysAfterLastAccessTimeGreaterThan") private Float daysAfterLastAccessTimeGreaterThan; /* @@ -34,13 +36,11 @@ public final class DateAfterModification { * tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The * blob will be archived if both the conditions are satisfied. */ - @JsonProperty(value = "daysAfterLastTierChangeGreaterThan") private Float daysAfterLastTierChangeGreaterThan; /* * Value indicating the age in days after blob creation. */ - @JsonProperty(value = "daysAfterCreationGreaterThan") private Float daysAfterCreationGreaterThan; /** @@ -142,4 +142,53 @@ public DateAfterModification withDaysAfterCreationGreaterThan(Float daysAfterCre */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("daysAfterModificationGreaterThan", this.daysAfterModificationGreaterThan); + jsonWriter.writeNumberField("daysAfterLastAccessTimeGreaterThan", this.daysAfterLastAccessTimeGreaterThan); + jsonWriter.writeNumberField("daysAfterLastTierChangeGreaterThan", this.daysAfterLastTierChangeGreaterThan); + jsonWriter.writeNumberField("daysAfterCreationGreaterThan", this.daysAfterCreationGreaterThan); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DateAfterModification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DateAfterModification 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 DateAfterModification. + */ + public static DateAfterModification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DateAfterModification deserializedDateAfterModification = new DateAfterModification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("daysAfterModificationGreaterThan".equals(fieldName)) { + deserializedDateAfterModification.daysAfterModificationGreaterThan + = reader.getNullable(JsonReader::getFloat); + } else if ("daysAfterLastAccessTimeGreaterThan".equals(fieldName)) { + deserializedDateAfterModification.daysAfterLastAccessTimeGreaterThan + = reader.getNullable(JsonReader::getFloat); + } else if ("daysAfterLastTierChangeGreaterThan".equals(fieldName)) { + deserializedDateAfterModification.daysAfterLastTierChangeGreaterThan + = reader.getNullable(JsonReader::getFloat); + } else if ("daysAfterCreationGreaterThan".equals(fieldName)) { + deserializedDateAfterModification.daysAfterCreationGreaterThan + = reader.getNullable(JsonReader::getFloat); + } else { + reader.skipChildren(); + } + } + + return deserializedDateAfterModification; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultAction.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultAction.java index 19bf7273cb65d..ee402de1e0392 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultAction.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultAction.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Specifies the default action of allow or deny when no other rules match. */ @@ -36,7 +33,6 @@ public enum DefaultAction { * @param value the serialized value to parse. * @return the parsed DefaultAction object, or null if unable to parse. */ - @JsonCreator public static DefaultAction fromString(String value) { if (value == null) { return null; @@ -53,7 +49,6 @@ public static DefaultAction fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultSharePermission.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultSharePermission.java index 4c8e68fa34f73..b1d1373fce236 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultSharePermission.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultSharePermission.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -50,7 +49,6 @@ public DefaultSharePermission() { * @param name a name to look for. * @return the corresponding DefaultSharePermission. */ - @JsonCreator public static DefaultSharePermission fromString(String name) { return fromString(name, DefaultSharePermission.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeleteRetentionPolicy.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeleteRetentionPolicy.java index 571cd2b75fb29..53cd33ed9e1e6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeleteRetentionPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeleteRetentionPolicy.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.storage.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 service properties for soft delete. */ @Fluent -public final class DeleteRetentionPolicy { +public final class DeleteRetentionPolicy implements JsonSerializable { /* * Indicates whether DeleteRetentionPolicy is enabled. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and * the maximum value can be 365. */ - @JsonProperty(value = "days") private Integer days; /* @@ -30,7 +32,6 @@ public final class DeleteRetentionPolicy { * cannot be used blob restore policy. This property only applies to blob service and does not apply to containers * or file share. */ - @JsonProperty(value = "allowPermanentDelete") private Boolean allowPermanentDelete; /** @@ -112,4 +113,46 @@ public DeleteRetentionPolicy withAllowPermanentDelete(Boolean allowPermanentDele */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("days", this.days); + jsonWriter.writeBooleanField("allowPermanentDelete", this.allowPermanentDelete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeleteRetentionPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeleteRetentionPolicy 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 DeleteRetentionPolicy. + */ + public static DeleteRetentionPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeleteRetentionPolicy deserializedDeleteRetentionPolicy = new DeleteRetentionPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedDeleteRetentionPolicy.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("days".equals(fieldName)) { + deserializedDeleteRetentionPolicy.days = reader.getNullable(JsonReader::getInt); + } else if ("allowPermanentDelete".equals(fieldName)) { + deserializedDeleteRetentionPolicy.allowPermanentDelete = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDeleteRetentionPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedAccountListResult.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedAccountListResult.java index b567f7507a011..5b7e3a34084d8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedAccountListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedAccountListResult.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.DeletedAccountInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response from the List Deleted Accounts operation. */ @Immutable -public final class DeletedAccountListResult { +public final class DeletedAccountListResult implements JsonSerializable { /* * Gets the list of deleted accounts and their properties. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Request URL that can be used to query next page of deleted accounts. Returned when total number of requested * deleted accounts exceed maximum page size. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -62,4 +64,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedAccountListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedAccountListResult 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 DeletedAccountListResult. + */ + public static DeletedAccountListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedAccountListResult deserializedDeletedAccountListResult = new DeletedAccountListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DeletedAccountInner.fromJson(reader1)); + deserializedDeletedAccountListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDeletedAccountListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedAccountListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedShare.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedShare.java index 1944a5a05760d..c8a22e7358fe4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedShare.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedShare.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The deleted share to be restored. */ @Fluent -public final class DeletedShare { +public final class DeletedShare implements JsonSerializable { /* * Required. Identify the name of the deleted share that will be restored. */ - @JsonProperty(value = "deletedShareName", required = true) private String deletedShareName; /* * Required. Identify the version of the deleted share that will be restored. */ - @JsonProperty(value = "deletedShareVersion", required = true) private String deletedShareVersion; /** @@ -89,4 +91,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(DeletedShare.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deletedShareName", this.deletedShareName); + jsonWriter.writeStringField("deletedShareVersion", this.deletedShareVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedShare from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedShare 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 DeletedShare. + */ + public static DeletedShare fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedShare deserializedDeletedShare = new DeletedShare(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deletedShareName".equals(fieldName)) { + deserializedDeletedShare.deletedShareName = reader.getString(); + } else if ("deletedShareVersion".equals(fieldName)) { + deserializedDeletedShare.deletedShareVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedShare; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Dimension.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Dimension.java index fd1175778a7f5..92b969ac69f6f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Dimension.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Dimension.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.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; /** * Dimension of blobs, possibly be blob type or access tier. */ @Fluent -public final class Dimension { +public final class Dimension implements JsonSerializable { /* * Display name of dimension. */ - @JsonProperty(value = "name") private String name; /* * Display name of dimension. */ - @JsonProperty(value = "displayName") private String displayName; /** @@ -77,4 +79,43 @@ public Dimension withDisplayName(String displayName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dimension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dimension 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 Dimension. + */ + public static Dimension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dimension deserializedDimension = new Dimension(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDimension.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedDimension.displayName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDimension; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DirectoryServiceOptions.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DirectoryServiceOptions.java index 2c9a2710bcc17..0eeba6bf36b86 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DirectoryServiceOptions.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DirectoryServiceOptions.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public DirectoryServiceOptions() { * @param name a name to look for. * @return the corresponding DirectoryServiceOptions. */ - @JsonCreator public static DirectoryServiceOptions fromString(String name) { return fromString(name, DirectoryServiceOptions.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DnsEndpointType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DnsEndpointType.java index e858a3ac8490b..159ebe597dd9b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DnsEndpointType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DnsEndpointType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -39,7 +38,6 @@ public DnsEndpointType() { * @param name a name to look for. * @return the corresponding DnsEndpointType. */ - @JsonCreator public static DnsEndpointType fromString(String name) { return fromString(name, DnsEndpointType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EnabledProtocols.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EnabledProtocols.java index 6d1e55c185f6b..cdd0f03adfc13 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EnabledProtocols.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EnabledProtocols.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public EnabledProtocols() { * @param name a name to look for. * @return the corresponding EnabledProtocols. */ - @JsonCreator public static EnabledProtocols fromString(String name) { return fromString(name, EnabledProtocols.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Encryption.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Encryption.java index 37aa3c42f38b8..93b7e497df902 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Encryption.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Encryption.java @@ -5,42 +5,41 @@ package com.azure.resourcemanager.storage.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 encryption settings on the storage account. */ @Fluent -public final class Encryption { +public final class Encryption implements JsonSerializable { /* * List of services which support encryption. */ - @JsonProperty(value = "services") private EncryptionServices services; /* * The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault */ - @JsonProperty(value = "keySource") private KeySource keySource; /* * A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed * keys for data at rest. */ - @JsonProperty(value = "requireInfrastructureEncryption") private Boolean requireInfrastructureEncryption; /* * Properties provided by key vault. */ - @JsonProperty(value = "keyvaultproperties") private KeyVaultProperties keyVaultProperties; /* * The identity to be used with service-side encryption at rest. */ - @JsonProperty(value = "identity") private EncryptionIdentity encryptionIdentity; /** @@ -169,4 +168,52 @@ public void validate() { encryptionIdentity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("services", this.services); + jsonWriter.writeStringField("keySource", this.keySource == null ? null : this.keySource.toString()); + jsonWriter.writeBooleanField("requireInfrastructureEncryption", this.requireInfrastructureEncryption); + jsonWriter.writeJsonField("keyvaultproperties", this.keyVaultProperties); + jsonWriter.writeJsonField("identity", this.encryptionIdentity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Encryption from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Encryption 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 Encryption. + */ + public static Encryption fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Encryption deserializedEncryption = new Encryption(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("services".equals(fieldName)) { + deserializedEncryption.services = EncryptionServices.fromJson(reader); + } else if ("keySource".equals(fieldName)) { + deserializedEncryption.keySource = KeySource.fromString(reader.getString()); + } else if ("requireInfrastructureEncryption".equals(fieldName)) { + deserializedEncryption.requireInfrastructureEncryption = reader.getNullable(JsonReader::getBoolean); + } else if ("keyvaultproperties".equals(fieldName)) { + deserializedEncryption.keyVaultProperties = KeyVaultProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedEncryption.encryptionIdentity = EncryptionIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryption; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionIdentity.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionIdentity.java index a077dcdfc4aa0..4a9fd8f7d5bb1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionIdentity.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionIdentity.java @@ -5,27 +5,27 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Encryption identity for the storage account. */ @Fluent -public final class EncryptionIdentity { +public final class EncryptionIdentity implements JsonSerializable { /* * Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage * account. */ - @JsonProperty(value = "userAssignedIdentity") - @JsonInclude(value = JsonInclude.Include.ALWAYS) private String encryptionUserAssignedIdentity; /* * ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for * cross-tenant customer-managed-keys server-side encryption on the storage account. */ - @JsonProperty(value = "federatedIdentityClientId") private String encryptionFederatedIdentityClientId; /** @@ -87,4 +87,43 @@ public EncryptionIdentity withEncryptionFederatedIdentityClientId(String encrypt */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("userAssignedIdentity", this.encryptionUserAssignedIdentity); + jsonWriter.writeStringField("federatedIdentityClientId", this.encryptionFederatedIdentityClientId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionIdentity 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 EncryptionIdentity. + */ + public static EncryptionIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionIdentity deserializedEncryptionIdentity = new EncryptionIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("userAssignedIdentity".equals(fieldName)) { + deserializedEncryptionIdentity.encryptionUserAssignedIdentity = reader.getString(); + } else if ("federatedIdentityClientId".equals(fieldName)) { + deserializedEncryptionIdentity.encryptionFederatedIdentityClientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionIdentity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeKeyVaultProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeKeyVaultProperties.java index 31e9a47d9c8dc..b802e7350102e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeKeyVaultProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeKeyVaultProperties.java @@ -5,7 +5,12 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -13,24 +18,21 @@ * set to 'Microsoft.KeyVault'. */ @Fluent -public final class EncryptionScopeKeyVaultProperties { +public final class EncryptionScopeKeyVaultProperties implements JsonSerializable { /* * The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced * by the identifier to enable customer-managed key support on this encryption scope. */ - @JsonProperty(value = "keyUri") private String keyUri; /* * The object identifier of the current versioned Key Vault Key in use. */ - @JsonProperty(value = "currentVersionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) private String currentVersionedKeyIdentifier; /* * Timestamp of last rotation of the Key Vault Key. */ - @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastKeyRotationTimestamp; /** @@ -87,4 +89,46 @@ public OffsetDateTime lastKeyRotationTimestamp() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyUri", this.keyUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionScopeKeyVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionScopeKeyVaultProperties 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 EncryptionScopeKeyVaultProperties. + */ + public static EncryptionScopeKeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionScopeKeyVaultProperties deserializedEncryptionScopeKeyVaultProperties + = new EncryptionScopeKeyVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyUri".equals(fieldName)) { + deserializedEncryptionScopeKeyVaultProperties.keyUri = reader.getString(); + } else if ("currentVersionedKeyIdentifier".equals(fieldName)) { + deserializedEncryptionScopeKeyVaultProperties.currentVersionedKeyIdentifier = reader.getString(); + } else if ("lastKeyRotationTimestamp".equals(fieldName)) { + deserializedEncryptionScopeKeyVaultProperties.lastKeyRotationTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionScopeKeyVaultProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeListResult.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeListResult.java index ec62b49fbfe6b..a026ba1949034 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeListResult.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.EncryptionScopeInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. */ @Immutable -public final class EncryptionScopeListResult { +public final class EncryptionScopeListResult implements JsonSerializable { /* * List of encryption scopes requested. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Request URL that can be used to query next page of encryption scopes. Returned when total number of requested * encryption scopes exceeds the maximum page size. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -62,4 +64,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionScopeListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionScopeListResult 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 EncryptionScopeListResult. + */ + public static EncryptionScopeListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionScopeListResult deserializedEncryptionScopeListResult = new EncryptionScopeListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> EncryptionScopeInner.fromJson(reader1)); + deserializedEncryptionScopeListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEncryptionScopeListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionScopeListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeSource.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeSource.java index 601dddff846b2..2d9a455e69a6f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeSource.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeSource.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public EncryptionScopeSource() { * @param name a name to look for. * @return the corresponding EncryptionScopeSource. */ - @JsonCreator public static EncryptionScopeSource fromString(String name) { return fromString(name, EncryptionScopeSource.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeState.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeState.java index 5aabea054b9ec..c39f151c8aca5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeState.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public EncryptionScopeState() { * @param name a name to look for. * @return the corresponding EncryptionScopeState. */ - @JsonCreator public static EncryptionScopeState fromString(String name) { return fromString(name, EncryptionScopeState.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionService.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionService.java index cc7e50d929eac..6f79e7058a8a1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionService.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionService.java @@ -5,33 +5,35 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * A service that allows server-side encryption to be used. */ @Fluent -public final class EncryptionService { +public final class EncryptionService implements JsonSerializable { /* * A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled * by default today and cannot be disabled. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at * rest by default today and cannot be disabled. */ - @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastEnabledTime; /* * Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped * encryption key will be used. 'Service' key type implies that a default service key is used. */ - @JsonProperty(value = "keyType") private KeyType keyType; /** @@ -103,4 +105,46 @@ public EncryptionService withKeyType(KeyType keyType) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("keyType", this.keyType == null ? null : this.keyType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionService from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionService 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 EncryptionService. + */ + public static EncryptionService fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionService deserializedEncryptionService = new EncryptionService(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedEncryptionService.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("lastEnabledTime".equals(fieldName)) { + deserializedEncryptionService.lastEnabledTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("keyType".equals(fieldName)) { + deserializedEncryptionService.keyType = KeyType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionService; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionServices.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionServices.java index 52544dde22fe6..c7e908e032056 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionServices.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionServices.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.storage.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; /** * A list of services that support encryption. */ @Fluent -public final class EncryptionServices { +public final class EncryptionServices implements JsonSerializable { /* * The encryption function of the blob storage service. */ - @JsonProperty(value = "blob") private EncryptionService blob; /* * The encryption function of the file storage service. */ - @JsonProperty(value = "file") private EncryptionService file; /* * The encryption function of the table storage service. */ - @JsonProperty(value = "table") private EncryptionService table; /* * The encryption function of the queue storage service. */ - @JsonProperty(value = "queue") private EncryptionService queue; /** @@ -141,4 +141,49 @@ public void validate() { queue().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("blob", this.blob); + jsonWriter.writeJsonField("file", this.file); + jsonWriter.writeJsonField("table", this.table); + jsonWriter.writeJsonField("queue", this.queue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EncryptionServices from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EncryptionServices 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 EncryptionServices. + */ + public static EncryptionServices fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EncryptionServices deserializedEncryptionServices = new EncryptionServices(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blob".equals(fieldName)) { + deserializedEncryptionServices.blob = EncryptionService.fromJson(reader); + } else if ("file".equals(fieldName)) { + deserializedEncryptionServices.file = EncryptionService.fromJson(reader); + } else if ("table".equals(fieldName)) { + deserializedEncryptionServices.table = EncryptionService.fromJson(reader); + } else if ("queue".equals(fieldName)) { + deserializedEncryptionServices.queue = EncryptionService.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEncryptionServices; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Endpoints.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Endpoints.java index 4615bd74db96e..815c2706de127 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Endpoints.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Endpoints.java @@ -5,59 +5,55 @@ package com.azure.resourcemanager.storage.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 URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. */ @Fluent -public final class Endpoints { +public final class Endpoints implements JsonSerializable { /* * Gets the blob endpoint. */ - @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) private String blob; /* * Gets the queue endpoint. */ - @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) private String queue; /* * Gets the table endpoint. */ - @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) private String table; /* * Gets the file endpoint. */ - @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) private String file; /* * Gets the web endpoint. */ - @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) private String web; /* * Gets the dfs endpoint. */ - @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) private String dfs; /* * Gets the microsoft routing storage endpoints. */ - @JsonProperty(value = "microsoftEndpoints") private StorageAccountMicrosoftEndpoints microsoftEndpoints; /* * Gets the internet routing storage endpoints */ - @JsonProperty(value = "internetEndpoints") private StorageAccountInternetEndpoints internetEndpoints; /** @@ -173,4 +169,55 @@ public void validate() { internetEndpoints().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("microsoftEndpoints", this.microsoftEndpoints); + jsonWriter.writeJsonField("internetEndpoints", this.internetEndpoints); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Endpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Endpoints 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 Endpoints. + */ + public static Endpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Endpoints deserializedEndpoints = new Endpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blob".equals(fieldName)) { + deserializedEndpoints.blob = reader.getString(); + } else if ("queue".equals(fieldName)) { + deserializedEndpoints.queue = reader.getString(); + } else if ("table".equals(fieldName)) { + deserializedEndpoints.table = reader.getString(); + } else if ("file".equals(fieldName)) { + deserializedEndpoints.file = reader.getString(); + } else if ("web".equals(fieldName)) { + deserializedEndpoints.web = reader.getString(); + } else if ("dfs".equals(fieldName)) { + deserializedEndpoints.dfs = reader.getString(); + } else if ("microsoftEndpoints".equals(fieldName)) { + deserializedEndpoints.microsoftEndpoints = StorageAccountMicrosoftEndpoints.fromJson(reader); + } else if ("internetEndpoints".equals(fieldName)) { + deserializedEndpoints.internetEndpoints = StorageAccountInternetEndpoints.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedEndpoints; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTarget.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTarget.java index 7f6ce957f5175..9bce10b1f7560 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTarget.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTarget.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -13,18 +17,16 @@ * storage task. */ @Fluent -public final class ExecutionTarget { +public final class ExecutionTarget implements JsonSerializable { /* * Required list of object prefixes to be included for task execution */ - @JsonProperty(value = "prefix") private List prefix; /* * List of object prefixes to be excluded from task execution. If there is a conflict between include and exclude * prefixes, the exclude prefix will be the determining factor */ - @JsonProperty(value = "excludePrefix") private List excludePrefix; /** @@ -82,4 +84,46 @@ public ExecutionTarget withExcludePrefix(List excludePrefix) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("prefix", this.prefix, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("excludePrefix", this.excludePrefix, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionTarget from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionTarget 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 ExecutionTarget. + */ + public static ExecutionTarget fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionTarget deserializedExecutionTarget = new ExecutionTarget(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefix".equals(fieldName)) { + List prefix = reader.readArray(reader1 -> reader1.getString()); + deserializedExecutionTarget.prefix = prefix; + } else if ("excludePrefix".equals(fieldName)) { + List excludePrefix = reader.readArray(reader1 -> reader1.getString()); + deserializedExecutionTarget.excludePrefix = excludePrefix; + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionTarget; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTrigger.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTrigger.java index b812e354506b1..3e87ee542d501 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTrigger.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTrigger.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Execution trigger for storage task assignment. */ @Fluent -public final class ExecutionTrigger { +public final class ExecutionTrigger implements JsonSerializable { /* * The trigger type of the storage task assignment execution */ - @JsonProperty(value = "type", required = true) private TriggerType type; /* * The trigger parameters of the storage task assignment execution */ - @JsonProperty(value = "parameters", required = true) private TriggerParameters parameters; /** @@ -90,4 +92,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ExecutionTrigger.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("parameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionTrigger 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 ExecutionTrigger. + */ + public static ExecutionTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionTrigger deserializedExecutionTrigger = new ExecutionTrigger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedExecutionTrigger.type = TriggerType.fromString(reader.getString()); + } else if ("parameters".equals(fieldName)) { + deserializedExecutionTrigger.parameters = TriggerParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionTrigger; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTriggerUpdate.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTriggerUpdate.java index 81f1cd81883d9..9a35f7c587824 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTriggerUpdate.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTriggerUpdate.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.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; /** * Execution trigger update for storage task assignment. */ @Fluent -public final class ExecutionTriggerUpdate { +public final class ExecutionTriggerUpdate implements JsonSerializable { /* * The trigger type of the storage task assignment execution */ - @JsonProperty(value = "type") private TriggerType type; /* * The trigger parameters of the storage task assignment execution */ - @JsonProperty(value = "parameters") private TriggerParametersUpdate parameters; /** @@ -80,4 +82,43 @@ public void validate() { parameters().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("parameters", this.parameters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionTriggerUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionTriggerUpdate 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 ExecutionTriggerUpdate. + */ + public static ExecutionTriggerUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionTriggerUpdate deserializedExecutionTriggerUpdate = new ExecutionTriggerUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedExecutionTriggerUpdate.type = TriggerType.fromString(reader.getString()); + } else if ("parameters".equals(fieldName)) { + deserializedExecutionTriggerUpdate.parameters = TriggerParametersUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionTriggerUpdate; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExpirationAction.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExpirationAction.java index e7a21b51e0c5f..1c437aac47faf 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExpirationAction.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExpirationAction.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -39,7 +38,6 @@ public ExpirationAction() { * @param name a name to look for. * @return the corresponding ExpirationAction. */ - @JsonCreator public static ExpirationAction fromString(String name) { return fromString(name, ExpirationAction.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExtendedLocation.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExtendedLocation.java index 5a5c69e7d5afb..e4bcb9bbccf4a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExtendedLocation.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExtendedLocation.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.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 complex type of the extended location. */ @Fluent -public final class ExtendedLocation { +public final class ExtendedLocation implements JsonSerializable { /* * The name of the extended location. */ - @JsonProperty(value = "name") private String name; /* * The type of the extended location. */ - @JsonProperty(value = "type") private ExtendedLocationTypes type; /** @@ -77,4 +79,43 @@ public ExtendedLocation withType(ExtendedLocationTypes type) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExtendedLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExtendedLocation 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 ExtendedLocation. + */ + public static ExtendedLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExtendedLocation deserializedExtendedLocation = new ExtendedLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedExtendedLocation.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExtendedLocation.type = ExtendedLocationTypes.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExtendedLocation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExtendedLocationTypes.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExtendedLocationTypes.java index d2b2a7175d6b2..d902409fd9cee 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExtendedLocationTypes.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExtendedLocationTypes.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ExtendedLocationTypes() { * @param name a name to look for. * @return the corresponding ExtendedLocationTypes. */ - @JsonCreator public static ExtendedLocationTypes fromString(String name) { return fromString(name, ExtendedLocationTypes.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FailoverType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FailoverType.java index 046599fc033f6..397dba6d90cec 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FailoverType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FailoverType.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Defines values for FailoverType. */ @@ -31,7 +28,6 @@ public enum FailoverType { * @param value the serialized value to parse. * @return the parsed FailoverType object, or null if unable to parse. */ - @JsonCreator public static FailoverType fromString(String value) { if (value == null) { return null; @@ -48,7 +44,6 @@ public static FailoverType fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileShareItems.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileShareItems.java index ec055d7a72066..86fccbc7a65a7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileShareItems.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileShareItems.java @@ -5,8 +5,12 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.FileShareItemInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -14,18 +18,16 @@ * shares. */ @Immutable -public final class FileShareItems { +public final class FileShareItems implements JsonSerializable { /* * List of file shares returned. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed * maximum page size. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -63,4 +65,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileShareItems from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileShareItems 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 FileShareItems. + */ + public static FileShareItems fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileShareItems deserializedFileShareItems = new FileShareItems(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> FileShareItemInner.fromJson(reader1)); + deserializedFileShareItems.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFileShareItems.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFileShareItems; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileSharesLeaseHeaders.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileSharesLeaseHeaders.java index 3909573dbc089..ae83d77ef9e7f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileSharesLeaseHeaders.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileSharesLeaseHeaders.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; /** * The FileSharesLeaseHeaders model. @@ -17,7 +16,6 @@ public final class FileSharesLeaseHeaders { /* * The Etag property. */ - @JsonProperty(value = "Etag") private String etag; // HttpHeaders containing the raw property values. diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Format.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Format.java index 4ed4d69abe0c3..2185712a9d496 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Format.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Format.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public Format() { * @param name a name to look for. * @return the corresponding Format. */ - @JsonCreator public static Format fromString(String name) { return fromString(name, Format.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStats.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStats.java index c2c9ef86d0a06..eaf57e6cfc6e7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStats.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStats.java @@ -5,7 +5,12 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** @@ -13,14 +18,13 @@ * when geo-redundant replication is enabled for the storage account. */ @Immutable -public final class GeoReplicationStats { +public final class GeoReplicationStats implements JsonSerializable { /* * The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is * active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary * location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that * the secondary location is temporarily unavailable. */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private GeoReplicationStatus status; /* @@ -28,31 +32,26 @@ public final class GeoReplicationStats { * writes following this point in time may or may not be available for reads. Element may be default value if value * of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap. */ - @JsonProperty(value = "lastSyncTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastSyncTime; /* * A boolean flag which indicates whether or not account failover is supported for the account. */ - @JsonProperty(value = "canFailover", access = JsonProperty.Access.WRITE_ONLY) private Boolean canFailover; /* * A boolean flag which indicates whether or not planned account failover is supported for the account. */ - @JsonProperty(value = "canPlannedFailover", access = JsonProperty.Access.WRITE_ONLY) private Boolean canPlannedFailover; /* * The redundancy type of the account after an account failover is performed. */ - @JsonProperty(value = "postFailoverRedundancy", access = JsonProperty.Access.WRITE_ONLY) private PostFailoverRedundancy postFailoverRedundancy; /* * The redundancy type of the account after a planned account failover is performed. */ - @JsonProperty(value = "postPlannedFailoverRedundancy", access = JsonProperty.Access.WRITE_ONLY) private PostPlannedFailoverRedundancy postPlannedFailoverRedundancy; /** @@ -132,4 +131,52 @@ public PostPlannedFailoverRedundancy postPlannedFailoverRedundancy() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GeoReplicationStats from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GeoReplicationStats 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 GeoReplicationStats. + */ + public static GeoReplicationStats fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GeoReplicationStats deserializedGeoReplicationStats = new GeoReplicationStats(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedGeoReplicationStats.status = GeoReplicationStatus.fromString(reader.getString()); + } else if ("lastSyncTime".equals(fieldName)) { + deserializedGeoReplicationStats.lastSyncTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("canFailover".equals(fieldName)) { + deserializedGeoReplicationStats.canFailover = reader.getNullable(JsonReader::getBoolean); + } else if ("canPlannedFailover".equals(fieldName)) { + deserializedGeoReplicationStats.canPlannedFailover = reader.getNullable(JsonReader::getBoolean); + } else if ("postFailoverRedundancy".equals(fieldName)) { + deserializedGeoReplicationStats.postFailoverRedundancy + = PostFailoverRedundancy.fromString(reader.getString()); + } else if ("postPlannedFailoverRedundancy".equals(fieldName)) { + deserializedGeoReplicationStats.postPlannedFailoverRedundancy + = PostPlannedFailoverRedundancy.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGeoReplicationStats; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStatus.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStatus.java index 67aa228a15225..07124035f60dd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -45,7 +44,6 @@ public GeoReplicationStatus() { * @param name a name to look for. * @return the corresponding GeoReplicationStatus. */ - @JsonCreator public static GeoReplicationStatus fromString(String name) { return fromString(name, GeoReplicationStatus.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/HttpProtocol.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/HttpProtocol.java index 3eddddd684b61..928298edfe32b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/HttpProtocol.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/HttpProtocol.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * The protocol permitted for a request made with the account SAS. */ @@ -36,7 +33,6 @@ public enum HttpProtocol { * @param value the serialized value to parse. * @return the parsed HttpProtocol object, or null if unable to parse. */ - @JsonCreator public static HttpProtocol fromString(String value) { if (value == null) { return null; @@ -53,7 +49,6 @@ public static HttpProtocol fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Identity.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Identity.java index d68011c48a153..90c7265a1aaf7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Identity.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Identity.java @@ -6,31 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * Identity for the resource. */ @Fluent -public final class Identity { +public final class Identity implements JsonSerializable { /* * The principal ID of resource identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private String principalId; /* * The tenant ID of resource. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; /* * The identity type. */ - @JsonProperty(value = "type", required = true) private IdentityType type; /* @@ -38,8 +38,6 @@ public final class Identity { * this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is * permitted here. */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; /** @@ -130,4 +128,51 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(Identity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Identity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Identity 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 Identity. + */ + public static Identity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Identity deserializedIdentity = new Identity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedIdentity.type = IdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedIdentity.tenantId = reader.getString(); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedIdentity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IdentityType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IdentityType.java index 1e046ea9f59ef..9618f7315c022 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IdentityType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IdentityType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public IdentityType() { * @param name a name to look for. * @return the corresponding IdentityType. */ - @JsonCreator public static IdentityType fromString(String name) { return fromString(name, IdentityType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyProperties.java index fd6a48197e388..1d90db93031d2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyProperties.java @@ -5,31 +5,32 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.ImmutabilityPolicyProperty; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The properties of an ImmutabilityPolicy of a blob container. */ @Fluent -public final class ImmutabilityPolicyProperties { +public final class ImmutabilityPolicyProperties implements JsonSerializable { /* * The properties of an ImmutabilityPolicy of a blob container. */ - @JsonProperty(value = "properties") private ImmutabilityPolicyProperty innerProperties; /* * ImmutabilityPolicy Etag. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; /* * The ImmutabilityPolicy update history of the blob container. */ - @JsonProperty(value = "updateHistory", access = JsonProperty.Access.WRITE_ONLY) private List updateHistory; /** @@ -174,4 +175,47 @@ public void validate() { updateHistory().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutabilityPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutabilityPolicyProperties 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 ImmutabilityPolicyProperties. + */ + public static ImmutabilityPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutabilityPolicyProperties deserializedImmutabilityPolicyProperties = new ImmutabilityPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedImmutabilityPolicyProperties.innerProperties + = ImmutabilityPolicyProperty.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedImmutabilityPolicyProperties.etag = reader.getString(); + } else if ("updateHistory".equals(fieldName)) { + List updateHistory + = reader.readArray(reader1 -> UpdateHistoryProperty.fromJson(reader1)); + deserializedImmutabilityPolicyProperties.updateHistory = updateHistory; + } else { + reader.skipChildren(); + } + } + + return deserializedImmutabilityPolicyProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyState.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyState.java index 14784be44e80c..0427baa218ee0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyState.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public ImmutabilityPolicyState() { * @param name a name to look for. * @return the corresponding ImmutabilityPolicyState. */ - @JsonCreator public static ImmutabilityPolicyState fromString(String name) { return fromString(name, ImmutabilityPolicyState.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyUpdateType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyUpdateType.java index f2135c2da5a57..7ae099228f7a8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyUpdateType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyUpdateType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public ImmutabilityPolicyUpdateType() { * @param name a name to look for. * @return the corresponding ImmutabilityPolicyUpdateType. */ - @JsonCreator public static ImmutabilityPolicyUpdateType fromString(String name) { return fromString(name, ImmutabilityPolicyUpdateType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutableStorageAccount.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutableStorageAccount.java index 080bd8a235948..7ffa4c89a30d5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutableStorageAccount.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutableStorageAccount.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.storage.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; /** * This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. */ @Fluent -public final class ImmutableStorageAccount { +public final class ImmutableStorageAccount implements JsonSerializable { /* * A boolean flag which enables account-level immutability. All the containers under such an account have * object-level immutability enabled by default. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* @@ -25,7 +28,6 @@ public final class ImmutableStorageAccount { * precedence than the container-level immutability policy, which has a higher precedence than the account-level * immutability policy. */ - @JsonProperty(value = "immutabilityPolicy") private AccountImmutabilityPolicyProperties immutabilityPolicy; /** @@ -92,4 +94,44 @@ public void validate() { immutabilityPolicy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeJsonField("immutabilityPolicy", this.immutabilityPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutableStorageAccount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutableStorageAccount 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 ImmutableStorageAccount. + */ + public static ImmutableStorageAccount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutableStorageAccount deserializedImmutableStorageAccount = new ImmutableStorageAccount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedImmutableStorageAccount.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("immutabilityPolicy".equals(fieldName)) { + deserializedImmutableStorageAccount.immutabilityPolicy + = AccountImmutabilityPolicyProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedImmutableStorageAccount; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutableStorageWithVersioning.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutableStorageWithVersioning.java index 7e5a13ecbfc42..625d67537fa35 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutableStorageWithVersioning.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutableStorageWithVersioning.java @@ -5,30 +5,32 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * Object level immutability properties of the container. */ @Fluent -public final class ImmutableStorageWithVersioning { +public final class ImmutableStorageWithVersioning implements JsonSerializable { /* * This is an immutable property, when set to true it enables object level immutability at the container level. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * Returns the date and time the object level immutability was enabled. */ - @JsonProperty(value = "timeStamp", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime timestamp; /* * This property denotes the container level immutability to object level immutability migration state. */ - @JsonProperty(value = "migrationState", access = JsonProperty.Access.WRITE_ONLY) private MigrationState migrationState; /** @@ -85,4 +87,47 @@ public MigrationState migrationState() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImmutableStorageWithVersioning from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImmutableStorageWithVersioning 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 ImmutableStorageWithVersioning. + */ + public static ImmutableStorageWithVersioning fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImmutableStorageWithVersioning deserializedImmutableStorageWithVersioning + = new ImmutableStorageWithVersioning(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedImmutableStorageWithVersioning.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("timeStamp".equals(fieldName)) { + deserializedImmutableStorageWithVersioning.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("migrationState".equals(fieldName)) { + deserializedImmutableStorageWithVersioning.migrationState + = MigrationState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedImmutableStorageWithVersioning; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IntervalUnit.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IntervalUnit.java index f71f4cf9f9b03..06555fd3a8938 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IntervalUnit.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IntervalUnit.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; * this property should not be present when ExecutionTrigger.properties.type is 'RunOnce'. @@ -32,7 +29,6 @@ public enum IntervalUnit { * @param value the serialized value to parse. * @return the parsed IntervalUnit object, or null if unable to parse. */ - @JsonCreator public static IntervalUnit fromString(String value) { if (value == null) { return null; @@ -49,7 +45,6 @@ public static IntervalUnit fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/InventoryRuleType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/InventoryRuleType.java index db652d8b27325..13e2895c0419d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/InventoryRuleType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/InventoryRuleType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public InventoryRuleType() { * @param name a name to look for. * @return the corresponding InventoryRuleType. */ - @JsonCreator public static InventoryRuleType fromString(String name) { return fromString(name, InventoryRuleType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IpRule.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IpRule.java index 65b9b57385486..b6117f7968c12 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IpRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IpRule.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * IP rule with specific IP or IP range in CIDR format. */ @Fluent -public final class IpRule { +public final class IpRule implements JsonSerializable { /* * Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. */ - @JsonProperty(value = "value", required = true) private String ipAddressOrRange; /* * The action of IP ACL rule. */ - @JsonProperty(value = "action") private Action action; /** @@ -84,4 +86,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(IpRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.ipAddressOrRange); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpRule 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 IpRule. + */ + public static IpRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpRule deserializedIpRule = new IpRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedIpRule.ipAddressOrRange = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedIpRule.action = Action.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IssueType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IssueType.java index 6ddc2568eef08..054bb0d7cafa5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IssueType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IssueType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public IssueType() { * @param name a name to look for. * @return the corresponding IssueType. */ - @JsonCreator public static IssueType fromString(String name) { return fromString(name, IssueType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyCreationTime.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyCreationTime.java index c575b3f157c17..8a3fa8b9f5bfa 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyCreationTime.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyCreationTime.java @@ -5,24 +5,28 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Storage account keys creation time. */ @Fluent -public final class KeyCreationTime { +public final class KeyCreationTime implements JsonSerializable { /* * The key1 property. */ - @JsonProperty(value = "key1") private OffsetDateTime key1; /* * The key2 property. */ - @JsonProperty(value = "key2") private OffsetDateTime key2; /** @@ -78,4 +82,47 @@ public KeyCreationTime withKey2(OffsetDateTime key2) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key1", + this.key1 == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.key1)); + jsonWriter.writeStringField("key2", + this.key2 == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.key2)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyCreationTime from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyCreationTime 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 KeyCreationTime. + */ + public static KeyCreationTime fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyCreationTime deserializedKeyCreationTime = new KeyCreationTime(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key1".equals(fieldName)) { + deserializedKeyCreationTime.key1 = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("key2".equals(fieldName)) { + deserializedKeyCreationTime.key2 = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyCreationTime; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPermission.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPermission.java index 78721c046afb1..783cc81ef62e3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPermission.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPermission.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Permissions for the key -- read-only or full permissions. */ @@ -36,7 +33,6 @@ public enum KeyPermission { * @param value the serialized value to parse. * @return the parsed KeyPermission object, or null if unable to parse. */ - @JsonCreator public static KeyPermission fromString(String value) { if (value == null) { return null; @@ -53,7 +49,6 @@ public static KeyPermission fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPolicy.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPolicy.java index 0c7239c324c08..bde83e1a0436f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPolicy.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.storage.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; /** * KeyPolicy assigned to the storage account. */ @Fluent -public final class KeyPolicy { +public final class KeyPolicy implements JsonSerializable { /* * The key expiration period in days. */ - @JsonProperty(value = "keyExpirationPeriodInDays", required = true) private int keyExpirationPeriodInDays; /** @@ -51,4 +54,41 @@ public KeyPolicy withKeyExpirationPeriodInDays(int keyExpirationPeriodInDays) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("keyExpirationPeriodInDays", this.keyExpirationPeriodInDays); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyPolicy 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 KeyPolicy. + */ + public static KeyPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyPolicy deserializedKeyPolicy = new KeyPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyExpirationPeriodInDays".equals(fieldName)) { + deserializedKeyPolicy.keyExpirationPeriodInDays = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeySource.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeySource.java index d91ee15f2d156..18fefacfacab9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeySource.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeySource.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public KeySource() { * @param name a name to look for. * @return the corresponding KeySource. */ - @JsonCreator public static KeySource fromString(String name) { return fromString(name, KeySource.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyType.java index fc08f18bc5e87..7fed9b14f1160 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public KeyType() { * @param name a name to look for. * @return the corresponding KeyType. */ - @JsonCreator public static KeyType fromString(String name) { return fromString(name, KeyType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyVaultProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyVaultProperties.java index 4041cdd0ee966..ee6d97ea9e59f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyVaultProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyVaultProperties.java @@ -5,49 +5,48 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * Properties of key vault. */ @Fluent -public final class KeyVaultProperties { +public final class KeyVaultProperties implements JsonSerializable { /* * The name of KeyVault key. */ - @JsonProperty(value = "keyname") private String keyName; /* * The version of KeyVault key. */ - @JsonProperty(value = "keyversion") private String keyVersion; /* * The Uri of KeyVault. */ - @JsonProperty(value = "keyvaulturi") private String keyVaultUri; /* * The object identifier of the current versioned Key Vault Key in use. */ - @JsonProperty(value = "currentVersionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) private String currentVersionedKeyIdentifier; /* * Timestamp of last rotation of the Key Vault Key. */ - @JsonProperty(value = "lastKeyRotationTimestamp", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastKeyRotationTimestamp; /* * This is a read only property that represents the expiration time of the current version of the customer managed * key used for encryption. */ - @JsonProperty(value = "currentVersionedKeyExpirationTimestamp", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime currentVersionedKeyExpirationTimestamp; /** @@ -152,4 +151,54 @@ public OffsetDateTime currentVersionedKeyExpirationTimestamp() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyname", this.keyName); + jsonWriter.writeStringField("keyversion", this.keyVersion); + jsonWriter.writeStringField("keyvaulturi", this.keyVaultUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyVaultProperties 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 KeyVaultProperties. + */ + public static KeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyVaultProperties deserializedKeyVaultProperties = new KeyVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyname".equals(fieldName)) { + deserializedKeyVaultProperties.keyName = reader.getString(); + } else if ("keyversion".equals(fieldName)) { + deserializedKeyVaultProperties.keyVersion = reader.getString(); + } else if ("keyvaulturi".equals(fieldName)) { + deserializedKeyVaultProperties.keyVaultUri = reader.getString(); + } else if ("currentVersionedKeyIdentifier".equals(fieldName)) { + deserializedKeyVaultProperties.currentVersionedKeyIdentifier = reader.getString(); + } else if ("lastKeyRotationTimestamp".equals(fieldName)) { + deserializedKeyVaultProperties.lastKeyRotationTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("currentVersionedKeyExpirationTimestamp".equals(fieldName)) { + deserializedKeyVaultProperties.currentVersionedKeyExpirationTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyVaultProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Kind.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Kind.java index c002f27659f68..0da0c5493b229 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Kind.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Kind.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public Kind() { * @param name a name to look for. * @return the corresponding Kind. */ - @JsonCreator public static Kind fromString(String name) { return fromString(name, Kind.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LargeFileSharesState.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LargeFileSharesState.java index d8db2f54d1ae2..1baaa97793cf6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LargeFileSharesState.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LargeFileSharesState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public LargeFileSharesState() { * @param name a name to look for. * @return the corresponding LargeFileSharesState. */ - @JsonCreator public static LargeFileSharesState fromString(String name) { return fromString(name, LargeFileSharesState.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LastAccessTimeTrackingPolicy.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LastAccessTimeTrackingPolicy.java index 277db7d2a93d3..00e1379cca035 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LastAccessTimeTrackingPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LastAccessTimeTrackingPolicy.java @@ -5,38 +5,38 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The blob service properties for Last access time based tracking policy. */ @Fluent -public final class LastAccessTimeTrackingPolicy { +public final class LastAccessTimeTrackingPolicy implements JsonSerializable { /* * When set to true last access time based tracking is enabled. */ - @JsonProperty(value = "enable", required = true) private boolean enable; /* * Name of the policy. The valid value is AccessTimeTracking. This field is currently read only */ - @JsonProperty(value = "name") private Name name; /* * The field specifies blob object tracking granularity in days, typically how often the blob object should be * tracked.This field is currently read only with value as 1 */ - @JsonProperty(value = "trackingGranularityInDays") private Integer trackingGranularityInDays; /* * An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read * only */ - @JsonProperty(value = "blobType") private List blobType; /** @@ -138,4 +138,52 @@ public LastAccessTimeTrackingPolicy withBlobType(List blobType) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enable", this.enable); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + jsonWriter.writeNumberField("trackingGranularityInDays", this.trackingGranularityInDays); + jsonWriter.writeArrayField("blobType", this.blobType, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LastAccessTimeTrackingPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LastAccessTimeTrackingPolicy 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 LastAccessTimeTrackingPolicy. + */ + public static LastAccessTimeTrackingPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LastAccessTimeTrackingPolicy deserializedLastAccessTimeTrackingPolicy = new LastAccessTimeTrackingPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enable".equals(fieldName)) { + deserializedLastAccessTimeTrackingPolicy.enable = reader.getBoolean(); + } else if ("name".equals(fieldName)) { + deserializedLastAccessTimeTrackingPolicy.name = Name.fromString(reader.getString()); + } else if ("trackingGranularityInDays".equals(fieldName)) { + deserializedLastAccessTimeTrackingPolicy.trackingGranularityInDays + = reader.getNullable(JsonReader::getInt); + } else if ("blobType".equals(fieldName)) { + List blobType = reader.readArray(reader1 -> reader1.getString()); + deserializedLastAccessTimeTrackingPolicy.blobType = blobType; + } else { + reader.skipChildren(); + } + } + + return deserializedLastAccessTimeTrackingPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequest.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequest.java index 8b7a3747a3468..acb1c3194e86d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequest.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequest.java @@ -6,43 +6,42 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Lease Container request schema. */ @Fluent -public final class LeaseContainerRequest { +public final class LeaseContainerRequest implements JsonSerializable { /* * Specifies the lease action. Can be one of the available actions. */ - @JsonProperty(value = "action", required = true) private LeaseContainerRequestAction action; /* * Identifies the lease. Can be specified in any valid GUID string format. */ - @JsonProperty(value = "leaseId") private String leaseId; /* * Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, * between 0 and 60. */ - @JsonProperty(value = "breakPeriod") private Integer breakPeriod; /* * Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that * never expires. */ - @JsonProperty(value = "leaseDuration") private Integer leaseDuration; /* * Optional for acquire, required for change. Proposed lease ID, in a GUID string format. */ - @JsonProperty(value = "proposedLeaseId") private String proposedLeaseId; /** @@ -170,4 +169,54 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(LeaseContainerRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("leaseId", this.leaseId); + jsonWriter.writeNumberField("breakPeriod", this.breakPeriod); + jsonWriter.writeNumberField("leaseDuration", this.leaseDuration); + jsonWriter.writeStringField("proposedLeaseId", this.proposedLeaseId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LeaseContainerRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LeaseContainerRequest 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 LeaseContainerRequest. + */ + public static LeaseContainerRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LeaseContainerRequest deserializedLeaseContainerRequest = new LeaseContainerRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedLeaseContainerRequest.action + = LeaseContainerRequestAction.fromString(reader.getString()); + } else if ("leaseId".equals(fieldName)) { + deserializedLeaseContainerRequest.leaseId = reader.getString(); + } else if ("breakPeriod".equals(fieldName)) { + deserializedLeaseContainerRequest.breakPeriod = reader.getNullable(JsonReader::getInt); + } else if ("leaseDuration".equals(fieldName)) { + deserializedLeaseContainerRequest.leaseDuration = reader.getNullable(JsonReader::getInt); + } else if ("proposedLeaseId".equals(fieldName)) { + deserializedLeaseContainerRequest.proposedLeaseId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLeaseContainerRequest; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequestAction.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequestAction.java index 07799fc51185b..1e5d6f91b365a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequestAction.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequestAction.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public LeaseContainerRequestAction() { * @param name a name to look for. * @return the corresponding LeaseContainerRequestAction. */ - @JsonCreator public static LeaseContainerRequestAction fromString(String name) { return fromString(name, LeaseContainerRequestAction.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseDuration.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseDuration.java index 1982f0ca736f4..6492e5dde6d79 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseDuration.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseDuration.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public LeaseDuration() { * @param name a name to look for. * @return the corresponding LeaseDuration. */ - @JsonCreator public static LeaseDuration fromString(String name) { return fromString(name, LeaseDuration.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseShareAction.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseShareAction.java index 8b31f20ba13b3..098f7a71b982e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseShareAction.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseShareAction.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public LeaseShareAction() { * @param name a name to look for. * @return the corresponding LeaseShareAction. */ - @JsonCreator public static LeaseShareAction fromString(String name) { return fromString(name, LeaseShareAction.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseShareRequest.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseShareRequest.java index 767c72c08d173..3b0f1a609eef8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseShareRequest.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseShareRequest.java @@ -6,43 +6,42 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Lease Share request schema. */ @Fluent -public final class LeaseShareRequest { +public final class LeaseShareRequest implements JsonSerializable { /* * Specifies the lease action. Can be one of the available actions. */ - @JsonProperty(value = "action", required = true) private LeaseShareAction action; /* * Identifies the lease. Can be specified in any valid GUID string format. */ - @JsonProperty(value = "leaseId") private String leaseId; /* * Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, * between 0 and 60. */ - @JsonProperty(value = "breakPeriod") private Integer breakPeriod; /* * Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that * never expires. */ - @JsonProperty(value = "leaseDuration") private Integer leaseDuration; /* * Optional for acquire, required for change. Proposed lease ID, in a GUID string format. */ - @JsonProperty(value = "proposedLeaseId") private String proposedLeaseId; /** @@ -170,4 +169,53 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(LeaseShareRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("leaseId", this.leaseId); + jsonWriter.writeNumberField("breakPeriod", this.breakPeriod); + jsonWriter.writeNumberField("leaseDuration", this.leaseDuration); + jsonWriter.writeStringField("proposedLeaseId", this.proposedLeaseId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LeaseShareRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LeaseShareRequest 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 LeaseShareRequest. + */ + public static LeaseShareRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LeaseShareRequest deserializedLeaseShareRequest = new LeaseShareRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedLeaseShareRequest.action = LeaseShareAction.fromString(reader.getString()); + } else if ("leaseId".equals(fieldName)) { + deserializedLeaseShareRequest.leaseId = reader.getString(); + } else if ("breakPeriod".equals(fieldName)) { + deserializedLeaseShareRequest.breakPeriod = reader.getNullable(JsonReader::getInt); + } else if ("leaseDuration".equals(fieldName)) { + deserializedLeaseShareRequest.leaseDuration = reader.getNullable(JsonReader::getInt); + } else if ("proposedLeaseId".equals(fieldName)) { + deserializedLeaseShareRequest.proposedLeaseId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLeaseShareRequest; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseState.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseState.java index 2fcedfff3e80c..c864cfd9d635c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseState.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public LeaseState() { * @param name a name to look for. * @return the corresponding LeaseState. */ - @JsonCreator public static LeaseState fromString(String name) { return fromString(name, LeaseState.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseStatus.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseStatus.java index 1dbe18631760a..6f4ac843824b8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public LeaseStatus() { * @param name a name to look for. * @return the corresponding LeaseStatus. */ - @JsonCreator public static LeaseStatus fromString(String name) { return fromString(name, LeaseStatus.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHoldProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHoldProperties.java index 63b1e712f7ca3..3be2539b0176a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHoldProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHoldProperties.java @@ -5,32 +5,33 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The LegalHold property of a blob container. */ @Fluent -public final class LegalHoldProperties { +public final class LegalHoldProperties implements JsonSerializable { /* * The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold * public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of * 1000 blob containers with hasLegalHold=true for a given account. */ - @JsonProperty(value = "hasLegalHold", access = JsonProperty.Access.WRITE_ONLY) private Boolean hasLegalHold; /* * The list of LegalHold tags of a blob container. */ - @JsonProperty(value = "tags") private List tags; /* * Protected append blob writes history. */ - @JsonProperty(value = "protectedAppendWritesHistory") private ProtectedAppendWritesHistory protectedAppendWritesHistory; /** @@ -104,4 +105,47 @@ public void validate() { protectedAppendWritesHistory().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("protectedAppendWritesHistory", this.protectedAppendWritesHistory); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LegalHoldProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LegalHoldProperties 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 LegalHoldProperties. + */ + public static LegalHoldProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LegalHoldProperties deserializedLegalHoldProperties = new LegalHoldProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hasLegalHold".equals(fieldName)) { + deserializedLegalHoldProperties.hasLegalHold = reader.getNullable(JsonReader::getBoolean); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> TagProperty.fromJson(reader1)); + deserializedLegalHoldProperties.tags = tags; + } else if ("protectedAppendWritesHistory".equals(fieldName)) { + deserializedLegalHoldProperties.protectedAppendWritesHistory + = ProtectedAppendWritesHistory.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLegalHoldProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListBlobInventoryPolicy.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListBlobInventoryPolicy.java index 209da72b7c572..cb0d9688b118c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListBlobInventoryPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListBlobInventoryPolicy.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.BlobInventoryPolicyInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List of blob inventory policies returned. */ @Immutable -public final class ListBlobInventoryPolicy { +public final class ListBlobInventoryPolicy implements JsonSerializable { /* * List of blob inventory policies. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /** @@ -45,4 +48,41 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListBlobInventoryPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListBlobInventoryPolicy 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 ListBlobInventoryPolicy. + */ + public static ListBlobInventoryPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListBlobInventoryPolicy deserializedListBlobInventoryPolicy = new ListBlobInventoryPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BlobInventoryPolicyInner.fromJson(reader1)); + deserializedListBlobInventoryPolicy.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedListBlobInventoryPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainerItems.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainerItems.java index 93964d0e65aab..9bb14e7d2b761 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainerItems.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainerItems.java @@ -5,8 +5,12 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.ListContainerItemInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -14,18 +18,16 @@ * containers. */ @Immutable -public final class ListContainerItems { +public final class ListContainerItems implements JsonSerializable { /* * List of blobs containers returned. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Request URL that can be used to query next page of containers. Returned when total number of requested containers * exceed maximum page size. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -63,4 +65,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListContainerItems from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListContainerItems 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 ListContainerItems. + */ + public static ListContainerItems fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListContainerItems deserializedListContainerItems = new ListContainerItems(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ListContainerItemInner.fromJson(reader1)); + deserializedListContainerItems.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListContainerItems.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListContainerItems; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java index b5dfdf0d88489..6a63c352d79a2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ListContainersInclude() { * @param name a name to look for. * @return the corresponding ListContainersInclude. */ - @JsonCreator public static ListContainersInclude fromString(String name) { return fromString(name, ListContainersInclude.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListEncryptionScopesInclude.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListEncryptionScopesInclude.java index 80147da676142..d94fee7b79e60 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListEncryptionScopesInclude.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListEncryptionScopesInclude.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public ListEncryptionScopesInclude() { * @param name a name to look for. * @return the corresponding ListEncryptionScopesInclude. */ - @JsonCreator public static ListEncryptionScopesInclude fromString(String name) { return fromString(name, ListEncryptionScopesInclude.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListKeyExpand.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListKeyExpand.java index 30c5f3f887e31..44574c2bfd5f6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListKeyExpand.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListKeyExpand.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Defines values for ListKeyExpand. */ @@ -31,7 +28,6 @@ public enum ListKeyExpand { * @param value the serialized value to parse. * @return the parsed ListKeyExpand object, or null if unable to parse. */ - @JsonCreator public static ListKeyExpand fromString(String value) { if (value == null) { return null; @@ -48,7 +44,6 @@ public static ListKeyExpand fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListLocalUserIncludeParam.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListLocalUserIncludeParam.java index 4a504f8e89b44..cced4aa82afb7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListLocalUserIncludeParam.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListLocalUserIncludeParam.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ListLocalUserIncludeParam() { * @param name a name to look for. * @return the corresponding ListLocalUserIncludeParam. */ - @JsonCreator public static ListLocalUserIncludeParam fromString(String name) { return fromString(name, ListLocalUserIncludeParam.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListQueueResource.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListQueueResource.java index 6a4f809dde8af..94c7948de0ee3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListQueueResource.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListQueueResource.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.ListQueueInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Response schema. Contains list of queues returned. */ @Immutable -public final class ListQueueResource { +public final class ListQueueResource implements JsonSerializable { /* * List of queues returned. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Request URL that can be used to list next page of queues */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -60,4 +62,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListQueueResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListQueueResource 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 ListQueueResource. + */ + public static ListQueueResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListQueueResource deserializedListQueueResource = new ListQueueResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ListQueueInner.fromJson(reader1)); + deserializedListQueueResource.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListQueueResource.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListQueueResource; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListTableResource.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListTableResource.java index eb8f683468697..d5beb5aebdb3f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListTableResource.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListTableResource.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.TableInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Response schema. Contains list of tables returned. */ @Immutable -public final class ListTableResource { +public final class ListTableResource implements JsonSerializable { /* * List of tables returned. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Request URL that can be used to query next page of tables */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -60,4 +62,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListTableResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListTableResource 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 ListTableResource. + */ + public static ListTableResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListTableResource deserializedListTableResource = new ListTableResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> TableInner.fromJson(reader1)); + deserializedListTableResource.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListTableResource.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListTableResource; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LocalUsers.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LocalUsers.java index 1c53a056dd371..33a621aa11509 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LocalUsers.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LocalUsers.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.LocalUserInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List of local users requested, and if paging is required, a URL to the next page of local users. */ @Fluent -public final class LocalUsers { +public final class LocalUsers implements JsonSerializable { /* * The list of local users associated with the storage account. */ - @JsonProperty(value = "value") private List value; /* * Request URL that can be used to query next page of local users. Returned when total number of requested local * users exceeds the maximum page size. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -73,4 +75,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LocalUsers from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LocalUsers 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 LocalUsers. + */ + public static LocalUsers fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LocalUsers deserializedLocalUsers = new LocalUsers(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> LocalUserInner.fromJson(reader1)); + deserializedLocalUsers.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLocalUsers.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLocalUsers; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyAction.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyAction.java index 84b304d979f50..837a6eb1498d9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyAction.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyAction.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.storage.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; /** * Actions are applied to the filtered blobs when the execution condition is met. */ @Fluent -public final class ManagementPolicyAction { +public final class ManagementPolicyAction implements JsonSerializable { /* * The management policy action for base blob */ - @JsonProperty(value = "baseBlob") private ManagementPolicyBaseBlob baseBlob; /* * The management policy action for snapshot */ - @JsonProperty(value = "snapshot") private ManagementPolicySnapShot snapshot; /* * The management policy action for version */ - @JsonProperty(value = "version") private ManagementPolicyVersion version; /** @@ -112,4 +113,46 @@ public void validate() { version().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("baseBlob", this.baseBlob); + jsonWriter.writeJsonField("snapshot", this.snapshot); + jsonWriter.writeJsonField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyAction 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 ManagementPolicyAction. + */ + public static ManagementPolicyAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyAction deserializedManagementPolicyAction = new ManagementPolicyAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("baseBlob".equals(fieldName)) { + deserializedManagementPolicyAction.baseBlob = ManagementPolicyBaseBlob.fromJson(reader); + } else if ("snapshot".equals(fieldName)) { + deserializedManagementPolicyAction.snapshot = ManagementPolicySnapShot.fromJson(reader); + } else if ("version".equals(fieldName)) { + deserializedManagementPolicyAction.version = ManagementPolicyVersion.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyAction; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyBaseBlob.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyBaseBlob.java index 351759896b22c..175b8ae5602ad 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyBaseBlob.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyBaseBlob.java @@ -5,48 +5,46 @@ package com.azure.resourcemanager.storage.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; /** * Management policy action for base blob. */ @Fluent -public final class ManagementPolicyBaseBlob { +public final class ManagementPolicyBaseBlob implements JsonSerializable { /* * The function to tier blobs to cool storage. */ - @JsonProperty(value = "tierToCool") private DateAfterModification tierToCool; /* * The function to tier blobs to archive storage. */ - @JsonProperty(value = "tierToArchive") private DateAfterModification tierToArchive; /* * The function to tier blobs to cold storage. */ - @JsonProperty(value = "tierToCold") private DateAfterModification tierToCold; /* * The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts */ - @JsonProperty(value = "tierToHot") private DateAfterModification tierToHot; /* * The function to delete the blob */ - @JsonProperty(value = "delete") private DateAfterModification delete; /* * This property enables auto tiering of a blob from cool to hot on a blob access. This property requires * tierToCool.daysAfterLastAccessTimeGreaterThan. */ - @JsonProperty(value = "enableAutoTierToHotFromCool") private Boolean enableAutoTierToHotFromCool; /** @@ -201,4 +199,56 @@ public void validate() { delete().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("tierToCool", this.tierToCool); + jsonWriter.writeJsonField("tierToArchive", this.tierToArchive); + jsonWriter.writeJsonField("tierToCold", this.tierToCold); + jsonWriter.writeJsonField("tierToHot", this.tierToHot); + jsonWriter.writeJsonField("delete", this.delete); + jsonWriter.writeBooleanField("enableAutoTierToHotFromCool", this.enableAutoTierToHotFromCool); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyBaseBlob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyBaseBlob 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 ManagementPolicyBaseBlob. + */ + public static ManagementPolicyBaseBlob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyBaseBlob deserializedManagementPolicyBaseBlob = new ManagementPolicyBaseBlob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tierToCool".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.tierToCool = DateAfterModification.fromJson(reader); + } else if ("tierToArchive".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.tierToArchive = DateAfterModification.fromJson(reader); + } else if ("tierToCold".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.tierToCold = DateAfterModification.fromJson(reader); + } else if ("tierToHot".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.tierToHot = DateAfterModification.fromJson(reader); + } else if ("delete".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.delete = DateAfterModification.fromJson(reader); + } else if ("enableAutoTierToHotFromCool".equals(fieldName)) { + deserializedManagementPolicyBaseBlob.enableAutoTierToHotFromCool + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyBaseBlob; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyDefinition.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyDefinition.java index 2df3f45b71185..1b2d726828a1b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyDefinition.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyDefinition.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. */ @Fluent -public final class ManagementPolicyDefinition { +public final class ManagementPolicyDefinition implements JsonSerializable { /* * An object that defines the action set. */ - @JsonProperty(value = "actions", required = true) private ManagementPolicyAction actions; /* * An object that defines the filter set. */ - @JsonProperty(value = "filters") private ManagementPolicyFilter filters; /** @@ -90,4 +92,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("actions", this.actions); + jsonWriter.writeJsonField("filters", this.filters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyDefinition 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 ManagementPolicyDefinition. + */ + public static ManagementPolicyDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyDefinition deserializedManagementPolicyDefinition = new ManagementPolicyDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actions".equals(fieldName)) { + deserializedManagementPolicyDefinition.actions = ManagementPolicyAction.fromJson(reader); + } else if ("filters".equals(fieldName)) { + deserializedManagementPolicyDefinition.filters = ManagementPolicyFilter.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyDefinition; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyFilter.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyFilter.java index c50748347eedb..4d5ceb425cf5b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyFilter.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyFilter.java @@ -6,7 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -14,24 +18,21 @@ * logical AND is performed on all filters. */ @Fluent -public final class ManagementPolicyFilter { +public final class ManagementPolicyFilter implements JsonSerializable { /* * An array of strings for prefixes to be match. */ - @JsonProperty(value = "prefixMatch") private List prefixMatch; /* * An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete * actions are supported for appendBlob. */ - @JsonProperty(value = "blobTypes", required = true) private List blobTypes; /* * An array of blob index tag based filters, there can be at most 10 tag filters */ - @JsonProperty(value = "blobIndexMatch") private List blobIndexMatch; /** @@ -119,4 +120,51 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyFilter.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("blobTypes", this.blobTypes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("prefixMatch", this.prefixMatch, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("blobIndexMatch", this.blobIndexMatch, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyFilter 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 ManagementPolicyFilter. + */ + public static ManagementPolicyFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyFilter deserializedManagementPolicyFilter = new ManagementPolicyFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blobTypes".equals(fieldName)) { + List blobTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedManagementPolicyFilter.blobTypes = blobTypes; + } else if ("prefixMatch".equals(fieldName)) { + List prefixMatch = reader.readArray(reader1 -> reader1.getString()); + deserializedManagementPolicyFilter.prefixMatch = prefixMatch; + } else if ("blobIndexMatch".equals(fieldName)) { + List blobIndexMatch = reader.readArray(reader1 -> TagFilter.fromJson(reader1)); + deserializedManagementPolicyFilter.blobIndexMatch = blobIndexMatch; + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyFilter; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java index e3111e02cf9a4..30e8aefd4c140 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ManagementPolicyName() { * @param name a name to look for. * @return the corresponding ManagementPolicyName. */ - @JsonCreator public static ManagementPolicyName fromString(String name) { return fromString(name, ManagementPolicyName.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java index 7914270a54b30..e3e972200b441 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java @@ -6,36 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. */ @Fluent -public final class ManagementPolicyRule { +public final class ManagementPolicyRule implements JsonSerializable { /* * Rule is enabled if set to true. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be * unique within a policy. */ - @JsonProperty(value = "name", required = true) private String name; /* * The valid value is Lifecycle */ - @JsonProperty(value = "type", required = true) private RuleType type; /* * An object that defines the Lifecycle rule. */ - @JsonProperty(value = "definition", required = true) private ManagementPolicyDefinition definition; /** @@ -150,4 +150,50 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("definition", this.definition); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyRule 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 ManagementPolicyRule. + */ + public static ManagementPolicyRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyRule deserializedManagementPolicyRule = new ManagementPolicyRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagementPolicyRule.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagementPolicyRule.type = RuleType.fromString(reader.getString()); + } else if ("definition".equals(fieldName)) { + deserializedManagementPolicyRule.definition = ManagementPolicyDefinition.fromJson(reader); + } else if ("enabled".equals(fieldName)) { + deserializedManagementPolicyRule.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySchema.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySchema.java index fc39efbfa3cf9..8aaad79327c5d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySchema.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySchema.java @@ -6,7 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -14,12 +18,11 @@ * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. */ @Fluent -public final class ManagementPolicySchema { +public final class ManagementPolicySchema implements JsonSerializable { /* * The Storage Account ManagementPolicies Rules. See more details in: * https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. */ - @JsonProperty(value = "rules", required = true) private List rules; /** @@ -65,4 +68,43 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicySchema.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicySchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicySchema 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 ManagementPolicySchema. + */ + public static ManagementPolicySchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicySchema deserializedManagementPolicySchema = new ManagementPolicySchema(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules + = reader.readArray(reader1 -> ManagementPolicyRule.fromJson(reader1)); + deserializedManagementPolicySchema.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicySchema; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySnapShot.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySnapShot.java index 7998bcbaef3aa..8aa6b95a2a892 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySnapShot.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySnapShot.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.storage.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; /** * Management policy action for snapshot. */ @Fluent -public final class ManagementPolicySnapShot { +public final class ManagementPolicySnapShot implements JsonSerializable { /* * The function to tier blob snapshot to cool storage. */ - @JsonProperty(value = "tierToCool") private DateAfterCreation tierToCool; /* * The function to tier blob snapshot to archive storage. */ - @JsonProperty(value = "tierToArchive") private DateAfterCreation tierToArchive; /* * The function to tier blobs to cold storage. */ - @JsonProperty(value = "tierToCold") private DateAfterCreation tierToCold; /* * The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts */ - @JsonProperty(value = "tierToHot") private DateAfterCreation tierToHot; /* * The function to delete the blob snapshot */ - @JsonProperty(value = "delete") private DateAfterCreation delete; /** @@ -172,4 +171,52 @@ public void validate() { delete().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("tierToCool", this.tierToCool); + jsonWriter.writeJsonField("tierToArchive", this.tierToArchive); + jsonWriter.writeJsonField("tierToCold", this.tierToCold); + jsonWriter.writeJsonField("tierToHot", this.tierToHot); + jsonWriter.writeJsonField("delete", this.delete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicySnapShot from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicySnapShot 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 ManagementPolicySnapShot. + */ + public static ManagementPolicySnapShot fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicySnapShot deserializedManagementPolicySnapShot = new ManagementPolicySnapShot(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tierToCool".equals(fieldName)) { + deserializedManagementPolicySnapShot.tierToCool = DateAfterCreation.fromJson(reader); + } else if ("tierToArchive".equals(fieldName)) { + deserializedManagementPolicySnapShot.tierToArchive = DateAfterCreation.fromJson(reader); + } else if ("tierToCold".equals(fieldName)) { + deserializedManagementPolicySnapShot.tierToCold = DateAfterCreation.fromJson(reader); + } else if ("tierToHot".equals(fieldName)) { + deserializedManagementPolicySnapShot.tierToHot = DateAfterCreation.fromJson(reader); + } else if ("delete".equals(fieldName)) { + deserializedManagementPolicySnapShot.delete = DateAfterCreation.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicySnapShot; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyVersion.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyVersion.java index 1eeed428ab976..62f7e2a5ff71a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyVersion.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyVersion.java @@ -5,41 +5,40 @@ package com.azure.resourcemanager.storage.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; /** * Management policy action for blob version. */ @Fluent -public final class ManagementPolicyVersion { +public final class ManagementPolicyVersion implements JsonSerializable { /* * The function to tier blob version to cool storage. */ - @JsonProperty(value = "tierToCool") private DateAfterCreation tierToCool; /* * The function to tier blob version to archive storage. */ - @JsonProperty(value = "tierToArchive") private DateAfterCreation tierToArchive; /* * The function to tier blobs to cold storage. */ - @JsonProperty(value = "tierToCold") private DateAfterCreation tierToCold; /* * The function to tier blobs to hot storage. This action can only be used with Premium Block Blob Storage Accounts */ - @JsonProperty(value = "tierToHot") private DateAfterCreation tierToHot; /* * The function to delete the blob version */ - @JsonProperty(value = "delete") private DateAfterCreation delete; /** @@ -172,4 +171,52 @@ public void validate() { delete().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("tierToCool", this.tierToCool); + jsonWriter.writeJsonField("tierToArchive", this.tierToArchive); + jsonWriter.writeJsonField("tierToCold", this.tierToCold); + jsonWriter.writeJsonField("tierToHot", this.tierToHot); + jsonWriter.writeJsonField("delete", this.delete); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagementPolicyVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagementPolicyVersion 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 ManagementPolicyVersion. + */ + public static ManagementPolicyVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagementPolicyVersion deserializedManagementPolicyVersion = new ManagementPolicyVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tierToCool".equals(fieldName)) { + deserializedManagementPolicyVersion.tierToCool = DateAfterCreation.fromJson(reader); + } else if ("tierToArchive".equals(fieldName)) { + deserializedManagementPolicyVersion.tierToArchive = DateAfterCreation.fromJson(reader); + } else if ("tierToCold".equals(fieldName)) { + deserializedManagementPolicyVersion.tierToCold = DateAfterCreation.fromJson(reader); + } else if ("tierToHot".equals(fieldName)) { + deserializedManagementPolicyVersion.tierToHot = DateAfterCreation.fromJson(reader); + } else if ("delete".equals(fieldName)) { + deserializedManagementPolicyVersion.delete = DateAfterCreation.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagementPolicyVersion; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MetricSpecification.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MetricSpecification.java index 6ab370ce958bd..c60c2f5a1556f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MetricSpecification.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MetricSpecification.java @@ -5,66 +5,61 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Metric specification of operation. */ @Fluent -public final class MetricSpecification { +public final class MetricSpecification implements JsonSerializable { /* * Name of metric specification. */ - @JsonProperty(value = "name") private String name; /* * Display name of metric specification. */ - @JsonProperty(value = "displayName") private String displayName; /* * Display description of metric specification. */ - @JsonProperty(value = "displayDescription") private String displayDescription; /* * Unit could be Bytes or Count. */ - @JsonProperty(value = "unit") private String unit; /* * Dimensions of blobs, including blob type and access tier. */ - @JsonProperty(value = "dimensions") private List dimensions; /* * Aggregation type could be Average. */ - @JsonProperty(value = "aggregationType") private String aggregationType; /* * The property to decide fill gap with zero or not. */ - @JsonProperty(value = "fillGapWithZero") private Boolean fillGapWithZero; /* * The category this metric specification belong to, could be Capacity. */ - @JsonProperty(value = "category") private String category; /* * Account Resource Id. */ - @JsonProperty(value = "resourceIdDimensionNameOverride") private String resourceIdDimensionNameOverride; /** @@ -263,4 +258,65 @@ public void validate() { dimensions().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("displayDescription", this.displayDescription); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("aggregationType", this.aggregationType); + jsonWriter.writeBooleanField("fillGapWithZero", this.fillGapWithZero); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeStringField("resourceIdDimensionNameOverride", this.resourceIdDimensionNameOverride); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricSpecification 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 MetricSpecification. + */ + public static MetricSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricSpecification deserializedMetricSpecification = new MetricSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetricSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMetricSpecification.displayName = reader.getString(); + } else if ("displayDescription".equals(fieldName)) { + deserializedMetricSpecification.displayDescription = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedMetricSpecification.unit = reader.getString(); + } else if ("dimensions".equals(fieldName)) { + List dimensions = reader.readArray(reader1 -> Dimension.fromJson(reader1)); + deserializedMetricSpecification.dimensions = dimensions; + } else if ("aggregationType".equals(fieldName)) { + deserializedMetricSpecification.aggregationType = reader.getString(); + } else if ("fillGapWithZero".equals(fieldName)) { + deserializedMetricSpecification.fillGapWithZero = reader.getNullable(JsonReader::getBoolean); + } else if ("category".equals(fieldName)) { + deserializedMetricSpecification.category = reader.getString(); + } else if ("resourceIdDimensionNameOverride".equals(fieldName)) { + deserializedMetricSpecification.resourceIdDimensionNameOverride = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricSpecification; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationName.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationName.java index 4d7fd030dfd20..e3eca21c9b478 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationName.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationName.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public MigrationName() { * @param name a name to look for. * @return the corresponding MigrationName. */ - @JsonCreator public static MigrationName fromString(String name) { return fromString(name, MigrationName.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationState.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationState.java index 0dd8f211b54b4..209c9d0f74b06 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationState.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public MigrationState() { * @param name a name to look for. * @return the corresponding MigrationState. */ - @JsonCreator public static MigrationState fromString(String name) { return fromString(name, MigrationState.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationStatus.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationStatus.java index d4a2be9ba956a..25a6d8110ffc5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public MigrationStatus() { * @param name a name to look for. * @return the corresponding MigrationStatus. */ - @JsonCreator public static MigrationStatus fromString(String name) { return fromString(name, MigrationStatus.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java index 8da44fb59b1a6..7a5985fb963cb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public MinimumTlsVersion() { * @param name a name to look for. * @return the corresponding MinimumTlsVersion. */ - @JsonCreator public static MinimumTlsVersion fromString(String name) { return fromString(name, MinimumTlsVersion.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Multichannel.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Multichannel.java index dcaee478544cf..ccdc4f6c68f2c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Multichannel.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Multichannel.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.storage.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; /** * Multichannel setting. Applies to Premium FileStorage only. */ @Fluent -public final class Multichannel { +public final class Multichannel implements JsonSerializable { /* * Indicates whether multichannel is enabled */ - @JsonProperty(value = "enabled") private Boolean enabled; /** @@ -51,4 +54,40 @@ public Multichannel withEnabled(Boolean enabled) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Multichannel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Multichannel 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 Multichannel. + */ + public static Multichannel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Multichannel deserializedMultichannel = new Multichannel(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedMultichannel.enabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMultichannel; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Name.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Name.java index c9e6bd4ebd3c0..2c2e5bdf09a87 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Name.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Name.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public Name() { * @param name a name to look for. * @return the corresponding Name. */ - @JsonCreator public static Name fromString(String name) { return fromString(name, Name.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkRuleSet.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkRuleSet.java index a4e83de77dc12..3e3f3d691656c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkRuleSet.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkRuleSet.java @@ -6,43 +6,42 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Network rule set. */ @Fluent -public final class NetworkRuleSet { +public final class NetworkRuleSet implements JsonSerializable { /* * Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of * Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. */ - @JsonProperty(value = "bypass") private Bypass bypass; /* * Sets the resource access rules */ - @JsonProperty(value = "resourceAccessRules") private List resourceAccessRules; /* * Sets the virtual network rules */ - @JsonProperty(value = "virtualNetworkRules") private List virtualNetworkRules; /* * Sets the IP ACL rules */ - @JsonProperty(value = "ipRules") private List ipRules; /* * Specifies the default action of allow or deny when no other rules match. */ - @JsonProperty(value = "defaultAction", required = true) private DefaultAction defaultAction; /** @@ -177,4 +176,60 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(NetworkRuleSet.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("defaultAction", this.defaultAction == null ? null : this.defaultAction.toString()); + jsonWriter.writeStringField("bypass", this.bypass == null ? null : this.bypass.toString()); + jsonWriter.writeArrayField("resourceAccessRules", this.resourceAccessRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("virtualNetworkRules", this.virtualNetworkRules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ipRules", this.ipRules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkRuleSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkRuleSet 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 NetworkRuleSet. + */ + public static NetworkRuleSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkRuleSet deserializedNetworkRuleSet = new NetworkRuleSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("defaultAction".equals(fieldName)) { + deserializedNetworkRuleSet.defaultAction = DefaultAction.fromString(reader.getString()); + } else if ("bypass".equals(fieldName)) { + deserializedNetworkRuleSet.bypass = Bypass.fromString(reader.getString()); + } else if ("resourceAccessRules".equals(fieldName)) { + List resourceAccessRules + = reader.readArray(reader1 -> ResourceAccessRule.fromJson(reader1)); + deserializedNetworkRuleSet.resourceAccessRules = resourceAccessRules; + } else if ("virtualNetworkRules".equals(fieldName)) { + List virtualNetworkRules + = reader.readArray(reader1 -> VirtualNetworkRule.fromJson(reader1)); + deserializedNetworkRuleSet.virtualNetworkRules = virtualNetworkRules; + } else if ("ipRules".equals(fieldName)) { + List ipRules = reader.readArray(reader1 -> IpRule.fromJson(reader1)); + deserializedNetworkRuleSet.ipRules = ipRules; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkRuleSet; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeter.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeter.java index 81f13349d3a10..81c2600d6b979 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeter.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeter.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.storage.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; /** * NetworkSecurityPerimeter related information. */ @Fluent -public final class NetworkSecurityPerimeter { +public final class NetworkSecurityPerimeter implements JsonSerializable { /* * The ARM identifier of the resource */ - @JsonProperty(value = "id") private String id; /* * Guid of the resource */ - @JsonProperty(value = "perimeterGuid") private String perimeterGuid; /* * Location of the resource */ - @JsonProperty(value = "location") private String location; /** @@ -103,4 +104,46 @@ public NetworkSecurityPerimeter withLocation(String location) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("perimeterGuid", this.perimeterGuid); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeter 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 NetworkSecurityPerimeter. + */ + public static NetworkSecurityPerimeter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeter deserializedNetworkSecurityPerimeter = new NetworkSecurityPerimeter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.id = reader.getString(); + } else if ("perimeterGuid".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.perimeterGuid = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeter; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationList.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationList.java index b2985b510062f..e47115fab6467 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationList.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationList.java @@ -5,25 +5,28 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.NetworkSecurityPerimeterConfigurationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Result of the List Network Security Perimeter configuration operation. */ @Fluent -public final class NetworkSecurityPerimeterConfigurationList { +public final class NetworkSecurityPerimeterConfigurationList + implements JsonSerializable { /* * A collection of Network Security Perimeter configurations */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * The URI that can be used to request the next set of paged results. */ - @JsonProperty(value = "nextLink") 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.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationList 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 NetworkSecurityPerimeterConfigurationList. + */ + public static NetworkSecurityPerimeterConfigurationList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationList deserializedNetworkSecurityPerimeterConfigurationList + = new NetworkSecurityPerimeterConfigurationList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkSecurityPerimeterConfigurationInner.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationList; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationPropertiesProfile.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationPropertiesProfile.java index 20cbcf7c470fe..dcd1e26fbabe4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationPropertiesProfile.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationPropertiesProfile.java @@ -5,42 +5,42 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Network Security Perimeter profile. */ @Fluent -public final class NetworkSecurityPerimeterConfigurationPropertiesProfile { +public final class NetworkSecurityPerimeterConfigurationPropertiesProfile + implements JsonSerializable { /* * Name of the resource */ - @JsonProperty(value = "name") private String name; /* * Current access rules version */ - @JsonProperty(value = "accessRulesVersion") private Float accessRulesVersion; /* * List of Access Rules */ - @JsonProperty(value = "accessRules") private List accessRules; /* * Diagnostic settings version */ - @JsonProperty(value = "diagnosticSettingsVersion") private Float diagnosticSettingsVersion; /* * Enabled logging categories */ - @JsonProperty(value = "enabledLogCategories") private List enabledLogCategories; /** @@ -161,4 +161,60 @@ public void validate() { accessRules().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("accessRulesVersion", this.accessRulesVersion); + jsonWriter.writeArrayField("accessRules", this.accessRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("diagnosticSettingsVersion", this.diagnosticSettingsVersion); + jsonWriter.writeArrayField("enabledLogCategories", this.enabledLogCategories, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationPropertiesProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationPropertiesProfile 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 NetworkSecurityPerimeterConfigurationPropertiesProfile. + */ + public static NetworkSecurityPerimeterConfigurationPropertiesProfile fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationPropertiesProfile deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile + = new NetworkSecurityPerimeterConfigurationPropertiesProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile.name = reader.getString(); + } else if ("accessRulesVersion".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile.accessRulesVersion + = reader.getNullable(JsonReader::getFloat); + } else if ("accessRules".equals(fieldName)) { + List accessRules = reader.readArray(reader1 -> NspAccessRule.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile.accessRules = accessRules; + } else if ("diagnosticSettingsVersion".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile.diagnosticSettingsVersion + = reader.getNullable(JsonReader::getFloat); + } else if ("enabledLogCategories".equals(fieldName)) { + List enabledLogCategories = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile.enabledLogCategories + = enabledLogCategories; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationPropertiesProfile; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.java index 1b5f36e4431f8..c2329d8d80a4f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.java @@ -5,23 +5,26 @@ package com.azure.resourcemanager.storage.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; /** * Information about resource association. */ @Fluent -public final class NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation { +public final class NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + implements JsonSerializable { /* * Name of the resource association */ - @JsonProperty(value = "name") private String name; /* * Access Mode of the resource association */ - @JsonProperty(value = "accessMode") private ResourceAssociationAccessMode accessMode; /** @@ -78,4 +81,48 @@ public ResourceAssociationAccessMode accessMode() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation 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 + * NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation. + */ + public static NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation deserializedNetworkSecurityPerimeterConfigurationPropertiesResourceAssociation + = new NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.name + = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.accessMode + = ResourceAssociationAccessMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationPropertiesResourceAssociation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationProvisioningState.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationProvisioningState.java index 402edcc405955..3461b6862a161 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationProvisioningState.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -53,7 +52,6 @@ public NetworkSecurityPerimeterConfigurationProvisioningState() { * @param name a name to look for. * @return the corresponding NetworkSecurityPerimeterConfigurationProvisioningState. */ - @JsonCreator public static NetworkSecurityPerimeterConfigurationProvisioningState fromString(String name) { return fromString(name, NetworkSecurityPerimeterConfigurationProvisioningState.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRule.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRule.java index 20ec2fdf4a771..7a6d903c996c9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRule.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.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; /** * Information of Access Rule in Network Security Perimeter profile. */ @Fluent -public final class NspAccessRule { +public final class NspAccessRule implements JsonSerializable { /* * Name of the resource */ - @JsonProperty(value = "name") private String name; /* * Properties of Access Rule */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private NspAccessRuleProperties properties; /** @@ -69,4 +71,42 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NspAccessRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NspAccessRule 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 NspAccessRule. + */ + public static NspAccessRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NspAccessRule deserializedNspAccessRule = new NspAccessRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNspAccessRule.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNspAccessRule.properties = NspAccessRuleProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNspAccessRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRuleDirection.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRuleDirection.java index bdaf56ee5c759..c1b34a579c0e5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRuleDirection.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRuleDirection.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public NspAccessRuleDirection() { * @param name a name to look for. * @return the corresponding NspAccessRuleDirection. */ - @JsonCreator public static NspAccessRuleDirection fromString(String name) { return fromString(name, NspAccessRuleDirection.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRuleProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRuleProperties.java index 1dedc534b2cc5..760cba44c9735 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRuleProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRuleProperties.java @@ -5,42 +5,41 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * Properties of Access Rule. */ @Fluent -public final class NspAccessRuleProperties { +public final class NspAccessRuleProperties implements JsonSerializable { /* * Direction of Access Rule */ - @JsonProperty(value = "direction") private NspAccessRuleDirection direction; /* * Address prefixes in the CIDR format for inbound rules */ - @JsonProperty(value = "addressPrefixes") private List addressPrefixes; /* * Subscriptions for inbound rules */ - @JsonProperty(value = "subscriptions") private List subscriptions; /* * NetworkSecurityPerimeters for inbound rules */ - @JsonProperty(value = "networkSecurityPerimeters", access = JsonProperty.Access.WRITE_ONLY) private List networkSecurityPerimeters; /* * FQDN for outbound rules */ - @JsonProperty(value = "fullyQualifiedDomainNames", access = JsonProperty.Access.WRITE_ONLY) private List fullyQualifiedDomainNames; /** @@ -140,4 +139,58 @@ public void validate() { networkSecurityPerimeters().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subscriptions", this.subscriptions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NspAccessRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NspAccessRuleProperties 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 NspAccessRuleProperties. + */ + public static NspAccessRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NspAccessRuleProperties deserializedNspAccessRuleProperties = new NspAccessRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("direction".equals(fieldName)) { + deserializedNspAccessRuleProperties.direction + = NspAccessRuleDirection.fromString(reader.getString()); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedNspAccessRuleProperties.addressPrefixes = addressPrefixes; + } else if ("subscriptions".equals(fieldName)) { + List subscriptions + = reader.readArray(reader1 -> NspAccessRulePropertiesSubscriptionsItem.fromJson(reader1)); + deserializedNspAccessRuleProperties.subscriptions = subscriptions; + } else if ("networkSecurityPerimeters".equals(fieldName)) { + List networkSecurityPerimeters + = reader.readArray(reader1 -> NetworkSecurityPerimeter.fromJson(reader1)); + deserializedNspAccessRuleProperties.networkSecurityPerimeters = networkSecurityPerimeters; + } else if ("fullyQualifiedDomainNames".equals(fieldName)) { + List fullyQualifiedDomainNames = reader.readArray(reader1 -> reader1.getString()); + deserializedNspAccessRuleProperties.fullyQualifiedDomainNames = fullyQualifiedDomainNames; + } else { + reader.skipChildren(); + } + } + + return deserializedNspAccessRuleProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRulePropertiesSubscriptionsItem.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRulePropertiesSubscriptionsItem.java index 1c7b04343b31e..98b96b68b54b7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRulePropertiesSubscriptionsItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRulePropertiesSubscriptionsItem.java @@ -5,17 +5,21 @@ package com.azure.resourcemanager.storage.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; /** * Subscription for inbound rule. */ @Fluent -public final class NspAccessRulePropertiesSubscriptionsItem { +public final class NspAccessRulePropertiesSubscriptionsItem + implements JsonSerializable { /* * The ARM identifier of subscription */ - @JsonProperty(value = "id") private String id; /** @@ -51,4 +55,41 @@ public NspAccessRulePropertiesSubscriptionsItem withId(String id) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NspAccessRulePropertiesSubscriptionsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NspAccessRulePropertiesSubscriptionsItem 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 NspAccessRulePropertiesSubscriptionsItem. + */ + public static NspAccessRulePropertiesSubscriptionsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NspAccessRulePropertiesSubscriptionsItem deserializedNspAccessRulePropertiesSubscriptionsItem + = new NspAccessRulePropertiesSubscriptionsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNspAccessRulePropertiesSubscriptionsItem.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNspAccessRulePropertiesSubscriptionsItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicies.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicies.java index 64d9d88294e38..41730397e262a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicies.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicies.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.ObjectReplicationPolicyInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List storage account object replication policies. */ @Fluent -public final class ObjectReplicationPolicies { +public final class ObjectReplicationPolicies implements JsonSerializable { /* * The replication policy between two storage accounts. */ - @JsonProperty(value = "value") private List value; /** @@ -56,4 +59,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReplicationPolicies from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicies 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 ObjectReplicationPolicies. + */ + public static ObjectReplicationPolicies fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicies deserializedObjectReplicationPolicies = new ObjectReplicationPolicies(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ObjectReplicationPolicyInner.fromJson(reader1)); + deserializedObjectReplicationPolicies.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicies; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyFilter.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyFilter.java index 5f5d86d9a58c4..c7a69c8a30a18 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyFilter.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyFilter.java @@ -5,7 +5,11 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** @@ -13,18 +17,16 @@ * filter. If multiple filters are defined, a logical AND is performed on all filters. */ @Fluent -public final class ObjectReplicationPolicyFilter { +public final class ObjectReplicationPolicyFilter implements JsonSerializable { /* * Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. */ - @JsonProperty(value = "prefixMatch") private List prefixMatch; /* * Blobs created after the time will be replicated to the destination. It must be in datetime format * 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z */ - @JsonProperty(value = "minCreationTime") private String minCreationTime; /** @@ -84,4 +86,45 @@ public ObjectReplicationPolicyFilter withMinCreationTime(String minCreationTime) */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("prefixMatch", this.prefixMatch, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("minCreationTime", this.minCreationTime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReplicationPolicyFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicyFilter 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 ObjectReplicationPolicyFilter. + */ + public static ObjectReplicationPolicyFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicyFilter deserializedObjectReplicationPolicyFilter + = new ObjectReplicationPolicyFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefixMatch".equals(fieldName)) { + List prefixMatch = reader.readArray(reader1 -> reader1.getString()); + deserializedObjectReplicationPolicyFilter.prefixMatch = prefixMatch; + } else if ("minCreationTime".equals(fieldName)) { + deserializedObjectReplicationPolicyFilter.minCreationTime = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicyFilter; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyRule.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyRule.java index b6cb025bab21c..74090821fe6d3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyRule.java @@ -6,36 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The replication policy rule between two containers. */ @Fluent -public final class ObjectReplicationPolicyRule { +public final class ObjectReplicationPolicyRule implements JsonSerializable { /* * Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source * account. */ - @JsonProperty(value = "ruleId") private String ruleId; /* * Required. Source container name. */ - @JsonProperty(value = "sourceContainer", required = true) private String sourceContainer; /* * Required. Destination container name. */ - @JsonProperty(value = "destinationContainer", required = true) private String destinationContainer; /* * Optional. An object that defines the filter set. */ - @JsonProperty(value = "filters") private ObjectReplicationPolicyFilter filters; /** @@ -148,4 +148,50 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ObjectReplicationPolicyRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceContainer", this.sourceContainer); + jsonWriter.writeStringField("destinationContainer", this.destinationContainer); + jsonWriter.writeStringField("ruleId", this.ruleId); + jsonWriter.writeJsonField("filters", this.filters); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ObjectReplicationPolicyRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ObjectReplicationPolicyRule 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 ObjectReplicationPolicyRule. + */ + public static ObjectReplicationPolicyRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ObjectReplicationPolicyRule deserializedObjectReplicationPolicyRule = new ObjectReplicationPolicyRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceContainer".equals(fieldName)) { + deserializedObjectReplicationPolicyRule.sourceContainer = reader.getString(); + } else if ("destinationContainer".equals(fieldName)) { + deserializedObjectReplicationPolicyRule.destinationContainer = reader.getString(); + } else if ("ruleId".equals(fieldName)) { + deserializedObjectReplicationPolicyRule.ruleId = reader.getString(); + } else if ("filters".equals(fieldName)) { + deserializedObjectReplicationPolicyRule.filters = ObjectReplicationPolicyFilter.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedObjectReplicationPolicyRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectType.java index c8861ac9c551f..7738536ce3183 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -38,7 +37,6 @@ public ObjectType() { * @param name a name to look for. * @return the corresponding ObjectType. */ - @JsonCreator public static ObjectType fromString(String name) { return fromString(name, ObjectType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationDisplay.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationDisplay.java index ce0cd6e5ddde7..dce0cba9d57d4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationDisplay.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationDisplay.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.storage.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; /** * Display metadata associated with the operation. */ @Fluent -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* * Service provider: Microsoft Storage. */ - @JsonProperty(value = "provider") private String provider; /* * Resource on which the operation is performed etc. */ - @JsonProperty(value = "resource") private String resource; /* * Type of operation: get, read, delete, etc. */ - @JsonProperty(value = "operation") private String operation; /* * Description of the operation. */ - @JsonProperty(value = "description") private String description; /** @@ -129,4 +129,49 @@ public OperationDisplay withDescription(String description) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationListResult.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationListResult.java index d01453915200b..cdde6a2fa53ef 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationListResult.java @@ -5,8 +5,12 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -14,11 +18,10 @@ * of results. */ @Fluent -public final class OperationListResult { +public final class OperationListResult implements JsonSerializable { /* * List of Storage operations supported by the Storage resource provider. */ - @JsonProperty(value = "value") private List value; /** @@ -57,4 +60,41 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PermissionScope.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PermissionScope.java index 3a4f09504c81c..862d720eb89dd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PermissionScope.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PermissionScope.java @@ -6,30 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The PermissionScope model. */ @Fluent -public final class PermissionScope { +public final class PermissionScope implements JsonSerializable { /* * The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), Create * (c), Modify Ownership (o), and Modify Permissions (p). */ - @JsonProperty(value = "permissions", required = true) private String permissions; /* * The service used by the local user, e.g. blob, file. */ - @JsonProperty(value = "service", required = true) private String service; /* * The name of resource, normally the container name or the file share name, used by the local user. */ - @JsonProperty(value = "resourceName", required = true) private String resourceName; /** @@ -123,4 +124,47 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(PermissionScope.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("permissions", this.permissions); + jsonWriter.writeStringField("service", this.service); + jsonWriter.writeStringField("resourceName", this.resourceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PermissionScope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PermissionScope 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 PermissionScope. + */ + public static PermissionScope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PermissionScope deserializedPermissionScope = new PermissionScope(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("permissions".equals(fieldName)) { + deserializedPermissionScope.permissions = reader.getString(); + } else if ("service".equals(fieldName)) { + deserializedPermissionScope.service = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedPermissionScope.resourceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPermissionScope; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Permissions.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Permissions.java index 4e7748e9d4962..966649356095d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Permissions.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Permissions.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -68,7 +67,6 @@ public Permissions() { * @param name a name to look for. * @return the corresponding Permissions. */ - @JsonCreator public static Permissions fromString(String name) { return fromString(name, Permissions.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PostFailoverRedundancy.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PostFailoverRedundancy.java index d79c4bbb07625..ca685d7efecc9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PostFailoverRedundancy.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PostFailoverRedundancy.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public PostFailoverRedundancy() { * @param name a name to look for. * @return the corresponding PostFailoverRedundancy. */ - @JsonCreator public static PostFailoverRedundancy fromString(String name) { return fromString(name, PostFailoverRedundancy.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PostPlannedFailoverRedundancy.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PostPlannedFailoverRedundancy.java index dde6f4487e2a4..faada56e64777 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PostPlannedFailoverRedundancy.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PostPlannedFailoverRedundancy.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public PostPlannedFailoverRedundancy() { * @param name a name to look for. * @return the corresponding PostPlannedFailoverRedundancy. */ - @JsonCreator public static PostPlannedFailoverRedundancy fromString(String name) { return fromString(name, PostPlannedFailoverRedundancy.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpoint.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpoint.java index 82f9e4c8f5bf0..5a5aa4f41b388 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpoint.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpoint.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The Private Endpoint resource. */ @Immutable -public final class PrivateEndpoint { +public final class PrivateEndpoint implements JsonSerializable { /* * The ARM identifier for Private Endpoint */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /** @@ -40,4 +43,39 @@ public String id() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionListResult.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionListResult.java index 80314c14b45bd..43921c2ea1af3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionListResult.java @@ -5,19 +5,23 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List of private endpoint connection associated with the specified storage account. */ @Fluent -public final class PrivateEndpointConnectionListResult { +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { /* * Array of private endpoint connections */ - @JsonProperty(value = "value") private List value; /** @@ -56,4 +60,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionProvisioningState.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionProvisioningState.java index 82f3692b6b731..68fcbe05b49bb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public PrivateEndpointConnectionProvisioningState() { * @param name a name to look for. * @return the corresponding PrivateEndpointConnectionProvisioningState. */ - @JsonCreator public static PrivateEndpointConnectionProvisioningState fromString(String name) { return fromString(name, PrivateEndpointConnectionProvisioningState.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointServiceConnectionStatus.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointServiceConnectionStatus.java index 1da84b70aabf0..0887c06d78ea5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointServiceConnectionStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -43,7 +42,6 @@ public PrivateEndpointServiceConnectionStatus() { * @param name a name to look for. * @return the corresponding PrivateEndpointServiceConnectionStatus. */ - @JsonCreator public static PrivateEndpointServiceConnectionStatus fromString(String name) { return fromString(name, PrivateEndpointServiceConnectionStatus.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkResource.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkResource.java index 3bb1c91b57838..2b1ea636d08b5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkResource.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkResource.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.storage.fluent.models.PrivateLinkResourceProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -18,9 +21,23 @@ public final class PrivateLinkResource extends ProxyResource { /* * Resource properties. */ - @JsonProperty(value = "properties") private PrivateLinkResourceProperties 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 PrivateLinkResource class. */ @@ -36,6 +53,36 @@ private PrivateLinkResourceProperties 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 groupId property: The private link resource group id. * @@ -87,4 +134,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 PrivateLinkResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResource 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 PrivateLinkResource. + */ + public static PrivateLinkResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResource deserializedPrivateLinkResource = new PrivateLinkResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResource.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResource.innerProperties = PrivateLinkResourceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResource; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkServiceConnectionState.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkServiceConnectionState.java index 50149e228d174..71f52b71ee629 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkServiceConnectionState.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkServiceConnectionState.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.storage.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; /** * A collection of information about the state of the connection between service consumer and provider. */ @Fluent -public final class PrivateLinkServiceConnectionState { +public final class PrivateLinkServiceConnectionState implements JsonSerializable { /* * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - @JsonProperty(value = "status") private PrivateEndpointServiceConnectionStatus status; /* * The reason for approval/rejection of the connection. */ - @JsonProperty(value = "description") private String description; /* * A message indicating if changes on the service provider require any updates on the consumer. */ - @JsonProperty(value = "actionRequired") private String actionRequired; /** @@ -107,4 +108,48 @@ public PrivateLinkServiceConnectionState withActionRequired(String actionRequire */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionRequired", this.actionRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProtectedAppendWritesHistory.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProtectedAppendWritesHistory.java index 50e98d8d54437..5790daf6eee60 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProtectedAppendWritesHistory.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProtectedAppendWritesHistory.java @@ -5,25 +5,28 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * Protected append writes history setting for the blob container with Legal holds. */ @Fluent -public final class ProtectedAppendWritesHistory { +public final class ProtectedAppendWritesHistory implements JsonSerializable { /* * When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection * and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. */ - @JsonProperty(value = "allowProtectedAppendWritesAll") private Boolean allowProtectedAppendWritesAll; /* * Returns the date and time the tag was added. */ - @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime timestamp; /** @@ -72,4 +75,44 @@ public OffsetDateTime timestamp() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowProtectedAppendWritesAll", this.allowProtectedAppendWritesAll); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProtectedAppendWritesHistory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProtectedAppendWritesHistory 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 ProtectedAppendWritesHistory. + */ + public static ProtectedAppendWritesHistory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProtectedAppendWritesHistory deserializedProtectedAppendWritesHistory = new ProtectedAppendWritesHistory(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowProtectedAppendWritesAll".equals(fieldName)) { + deserializedProtectedAppendWritesHistory.allowProtectedAppendWritesAll + = reader.getNullable(JsonReader::getBoolean); + } else if ("timestamp".equals(fieldName)) { + deserializedProtectedAppendWritesHistory.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedProtectedAppendWritesHistory; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProtocolSettings.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProtocolSettings.java index 1e2042124cc31..9ef7dc9792ae9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProtocolSettings.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProtocolSettings.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.storage.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; /** * Protocol settings for file service. */ @Fluent -public final class ProtocolSettings { +public final class ProtocolSettings implements JsonSerializable { /* * Setting for SMB protocol */ - @JsonProperty(value = "smb") private SmbSetting smb; /** @@ -54,4 +57,40 @@ public void validate() { smb().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("smb", this.smb); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProtocolSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProtocolSettings 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 ProtocolSettings. + */ + public static ProtocolSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProtocolSettings deserializedProtocolSettings = new ProtocolSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("smb".equals(fieldName)) { + deserializedProtocolSettings.smb = SmbSetting.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProtocolSettings; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningIssue.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningIssue.java index 6ee9ff2678b0e..770cefb3b1fc5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningIssue.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningIssue.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.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; /** * Describes provisioning issue for given NetworkSecurityPerimeterConfiguration. */ @Fluent -public final class ProvisioningIssue { +public final class ProvisioningIssue implements JsonSerializable { /* * Name of the issue */ - @JsonProperty(value = "name") private String name; /* * Properties of provisioning issue */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningIssueProperties properties; /** @@ -69,4 +71,42 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningIssue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningIssue 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 ProvisioningIssue. + */ + public static ProvisioningIssue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningIssue deserializedProvisioningIssue = new ProvisioningIssue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedProvisioningIssue.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProvisioningIssue.properties = ProvisioningIssueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssue; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningIssueProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningIssueProperties.java index e04c84a76d0bd..b9a3a44d26f12 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningIssueProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningIssueProperties.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.storage.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; /** * Properties of provisioning issue. */ @Fluent -public final class ProvisioningIssueProperties { +public final class ProvisioningIssueProperties implements JsonSerializable { /* * Type of issue */ - @JsonProperty(value = "issueType") private IssueType issueType; /* * Severity of the issue. */ - @JsonProperty(value = "severity") private Severity severity; /* * Description of the issue */ - @JsonProperty(value = "description") private String description; /** @@ -103,4 +104,46 @@ public ProvisioningIssueProperties withDescription(String description) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("issueType", this.issueType == null ? null : this.issueType.toString()); + jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningIssueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningIssueProperties 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 ProvisioningIssueProperties. + */ + public static ProvisioningIssueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningIssueProperties deserializedProvisioningIssueProperties = new ProvisioningIssueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issueType".equals(fieldName)) { + deserializedProvisioningIssueProperties.issueType = IssueType.fromString(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedProvisioningIssueProperties.severity = Severity.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedProvisioningIssueProperties.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssueProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningState.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningState.java index 21235495dcd89..4481ac4760814 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningState.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningState.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Gets the status of the storage account at the time the operation was called. */ @@ -66,7 +63,6 @@ public enum ProvisioningState { * @param value the serialized value to parse. * @return the parsed ProvisioningState object, or null if unable to parse. */ - @JsonCreator public static ProvisioningState fromString(String value) { if (value == null) { return null; @@ -83,7 +79,6 @@ public static ProvisioningState fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicAccess.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicAccess.java index 49b8d37567f65..919380ad6174f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicAccess.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicAccess.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Specifies whether data in the container may be accessed publicly and the level of access. */ @@ -41,7 +38,6 @@ public enum PublicAccess { * @param value the serialized value to parse. * @return the parsed PublicAccess object, or null if unable to parse. */ - @JsonCreator public static PublicAccess fromString(String value) { if (value == null) { return null; @@ -58,7 +54,6 @@ public static PublicAccess fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicNetworkAccess.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicNetworkAccess.java index b86e46233d051..c377df20ce90c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicNetworkAccess.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicNetworkAccess.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -43,7 +42,6 @@ public PublicNetworkAccess() { * @param name a name to look for. * @return the corresponding PublicNetworkAccess. */ - @JsonCreator public static PublicNetworkAccess fromString(String name) { return fromString(name, PublicNetworkAccess.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Reason.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Reason.java index a9e331b58d127..5c87b49d9e927 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Reason.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Reason.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable * is false. @@ -37,7 +34,6 @@ public enum Reason { * @param value the serialized value to parse. * @return the parsed Reason object, or null if unable to parse. */ - @JsonCreator public static Reason fromString(String value) { if (value == null) { return null; @@ -54,7 +50,6 @@ public static Reason fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ReasonCode.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ReasonCode.java index bbe10f9406a4d..b8bebe88d6b43 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ReasonCode.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ReasonCode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -39,7 +38,6 @@ public ReasonCode() { * @param name a name to look for. * @return the corresponding ReasonCode. */ - @JsonCreator public static ReasonCode fromString(String name) { return fromString(name, ReasonCode.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ResourceAccessRule.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ResourceAccessRule.java index cb598868484de..7b197b79b53b6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ResourceAccessRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ResourceAccessRule.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Resource Access Rule. */ @Fluent -public final class ResourceAccessRule { +public final class ResourceAccessRule implements JsonSerializable { /* * Tenant Id */ - @JsonProperty(value = "tenantId") private String tenantId; /* * Resource Id */ - @JsonProperty(value = "resourceId") private String resourceId; /** @@ -77,4 +79,43 @@ public ResourceAccessRule withResourceId(String resourceId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceAccessRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceAccessRule 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 ResourceAccessRule. + */ + public static ResourceAccessRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceAccessRule deserializedResourceAccessRule = new ResourceAccessRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedResourceAccessRule.tenantId = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedResourceAccessRule.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceAccessRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ResourceAssociationAccessMode.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ResourceAssociationAccessMode.java index c74056ff3a956..15411fcc324d0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ResourceAssociationAccessMode.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ResourceAssociationAccessMode.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public ResourceAssociationAccessMode() { * @param name a name to look for. * @return the corresponding ResourceAssociationAccessMode. */ - @JsonCreator public static ResourceAssociationAccessMode fromString(String name) { return fromString(name, ResourceAssociationAccessMode.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RestorePolicyProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RestorePolicyProperties.java index c371ae5819ea6..6552fee89bdc3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RestorePolicyProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RestorePolicyProperties.java @@ -5,36 +5,37 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * The blob service properties for blob restore policy. */ @Fluent -public final class RestorePolicyProperties { +public final class RestorePolicyProperties implements JsonSerializable { /* * Blob restore is enabled if set to true. */ - @JsonProperty(value = "enabled", required = true) private boolean enabled; /* * how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. */ - @JsonProperty(value = "days") private Integer days; /* * Deprecated in favor of minRestoreTime property. */ - @JsonProperty(value = "lastEnabledTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastEnabledTime; /* * Returns the minimum date and time that the restore can be started. */ - @JsonProperty(value = "minRestoreTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime minRestoreTime; /** @@ -110,4 +111,50 @@ public OffsetDateTime minRestoreTime() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("days", this.days); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RestorePolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RestorePolicyProperties 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 RestorePolicyProperties. + */ + public static RestorePolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RestorePolicyProperties deserializedRestorePolicyProperties = new RestorePolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedRestorePolicyProperties.enabled = reader.getBoolean(); + } else if ("days".equals(fieldName)) { + deserializedRestorePolicyProperties.days = reader.getNullable(JsonReader::getInt); + } else if ("lastEnabledTime".equals(fieldName)) { + deserializedRestorePolicyProperties.lastEnabledTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("minRestoreTime".equals(fieldName)) { + deserializedRestorePolicyProperties.minRestoreTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRestorePolicyProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Restriction.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Restriction.java index 482f6480529cf..8b264bccb1729 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Restriction.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Restriction.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * The restriction because of which SKU cannot be used. */ @Fluent -public final class Restriction { +public final class Restriction implements JsonSerializable { /* * The type of restrictions. As of now only possible value for this is location. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * The value of restrictions. If the restriction type is set to location. This would be different locations where * the SKU is restricted. */ - @JsonProperty(value = "values", access = JsonProperty.Access.WRITE_ONLY) private List values; /* @@ -31,7 +33,6 @@ public final class Restriction { * when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The * "NotAvailableForSubscription" is related to capacity at DC. */ - @JsonProperty(value = "reasonCode") private ReasonCode reasonCode; /** @@ -90,4 +91,45 @@ public Restriction withReasonCode(ReasonCode reasonCode) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("reasonCode", this.reasonCode == null ? null : this.reasonCode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Restriction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Restriction 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 Restriction. + */ + public static Restriction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Restriction deserializedRestriction = new Restriction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedRestriction.type = reader.getString(); + } else if ("values".equals(fieldName)) { + List values = reader.readArray(reader1 -> reader1.getString()); + deserializedRestriction.values = values; + } else if ("reasonCode".equals(fieldName)) { + deserializedRestriction.reasonCode = ReasonCode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRestriction; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RootSquashType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RootSquashType.java index 5e5b2a3ac3ed5..c49ab881ab0da 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RootSquashType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RootSquashType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public RootSquashType() { * @param name a name to look for. * @return the corresponding RootSquashType. */ - @JsonCreator public static RootSquashType fromString(String name) { return fromString(name, RootSquashType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingChoice.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingChoice.java index 61dd61b5ead44..6bb2f75d33bcd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingChoice.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingChoice.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public RoutingChoice() { * @param name a name to look for. * @return the corresponding RoutingChoice. */ - @JsonCreator public static RoutingChoice fromString(String name) { return fromString(name, RoutingChoice.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingPreference.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingPreference.java index 9011d3019e379..ba37e118d5762 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingPreference.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingPreference.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.storage.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; /** * Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user * data, the default option is microsoft routing. */ @Fluent -public final class RoutingPreference { +public final class RoutingPreference implements JsonSerializable { /* * Routing Choice defines the kind of network routing opted by the user. */ - @JsonProperty(value = "routingChoice") private RoutingChoice routingChoice; /* * A boolean flag which indicates whether microsoft routing storage endpoints are to be published */ - @JsonProperty(value = "publishMicrosoftEndpoints") private Boolean publishMicrosoftEndpoints; /* * A boolean flag which indicates whether internet routing storage endpoints are to be published */ - @JsonProperty(value = "publishInternetEndpoints") private Boolean publishInternetEndpoints; /** @@ -108,4 +109,47 @@ public RoutingPreference withPublishInternetEndpoints(Boolean publishInternetEnd */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("routingChoice", this.routingChoice == null ? null : this.routingChoice.toString()); + jsonWriter.writeBooleanField("publishMicrosoftEndpoints", this.publishMicrosoftEndpoints); + jsonWriter.writeBooleanField("publishInternetEndpoints", this.publishInternetEndpoints); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutingPreference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutingPreference 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 RoutingPreference. + */ + public static RoutingPreference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutingPreference deserializedRoutingPreference = new RoutingPreference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("routingChoice".equals(fieldName)) { + deserializedRoutingPreference.routingChoice = RoutingChoice.fromString(reader.getString()); + } else if ("publishMicrosoftEndpoints".equals(fieldName)) { + deserializedRoutingPreference.publishMicrosoftEndpoints + = reader.getNullable(JsonReader::getBoolean); + } else if ("publishInternetEndpoints".equals(fieldName)) { + deserializedRoutingPreference.publishInternetEndpoints = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedRoutingPreference; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java index d3a3e454e6045..e2b75985be764 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public RuleType() { * @param name a name to look for. * @return the corresponding RuleType. */ - @JsonCreator public static RuleType fromString(String name) { return fromString(name, RuleType.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RunResult.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RunResult.java index 7d6dd14c176a1..3109283bcf734 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RunResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RunResult.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public RunResult() { * @param name a name to look for. * @return the corresponding RunResult. */ - @JsonCreator public static RunResult fromString(String name) { return fromString(name, RunResult.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RunStatusEnum.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RunStatusEnum.java index 6b172d9a291a4..3bdcaaf783e14 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RunStatusEnum.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RunStatusEnum.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public RunStatusEnum() { * @param name a name to look for. * @return the corresponding RunStatusEnum. */ - @JsonCreator public static RunStatusEnum fromString(String name) { return fromString(name, RunStatusEnum.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SasPolicy.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SasPolicy.java index f682f92b79a6a..e53fd8725c8b5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SasPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SasPolicy.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * SasPolicy assigned to the storage account. */ @Fluent -public final class SasPolicy { +public final class SasPolicy implements JsonSerializable { /* * The SAS expiration period, DD.HH:MM:SS. */ - @JsonProperty(value = "sasExpirationPeriod", required = true) private String sasExpirationPeriod; /* @@ -24,7 +27,6 @@ public final class SasPolicy { * 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS * tokens that do not adhere to the sas policy expiration period. */ - @JsonProperty(value = "expirationAction", required = true) private ExpirationAction expirationAction; /** @@ -94,4 +96,45 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(SasPolicy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sasExpirationPeriod", this.sasExpirationPeriod); + jsonWriter.writeStringField("expirationAction", + this.expirationAction == null ? null : this.expirationAction.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SasPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SasPolicy 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 SasPolicy. + */ + public static SasPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SasPolicy deserializedSasPolicy = new SasPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sasExpirationPeriod".equals(fieldName)) { + deserializedSasPolicy.sasExpirationPeriod = reader.getString(); + } else if ("expirationAction".equals(fieldName)) { + deserializedSasPolicy.expirationAction = ExpirationAction.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSasPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Schedule.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Schedule.java index 1a0ae85ae6422..88be55bc052b9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Schedule.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Schedule.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public Schedule() { * @param name a name to look for. * @return the corresponding Schedule. */ - @JsonCreator public static Schedule fromString(String name) { return fromString(name, Schedule.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSasParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSasParameters.java index 1a00b1aa8829d..aaed30a41c63a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSasParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSasParameters.java @@ -5,124 +5,112 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The parameters to list service SAS credentials of a specific resource. */ @Fluent -public final class ServiceSasParameters { +public final class ServiceSasParameters implements JsonSerializable { /* * The canonical path to the signed resource. */ - @JsonProperty(value = "canonicalizedResource", required = true) private String canonicalizedResource; /* * The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), * Share (s). */ - @JsonProperty(value = "signedResource") private SignedResource resource; /* * The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), * Add (a), Create (c), Update (u) and Process (p). */ - @JsonProperty(value = "signedPermission") private Permissions permissions; /* * An IP address or a range of IP addresses from which to accept requests. */ - @JsonProperty(value = "signedIp") private String ipAddressOrRange; /* * The protocol permitted for a request made with the account SAS. */ - @JsonProperty(value = "signedProtocol") private HttpProtocol protocols; /* * The time at which the SAS becomes valid. */ - @JsonProperty(value = "signedStart") private OffsetDateTime sharedAccessStartTime; /* * The time at which the shared access signature becomes invalid. */ - @JsonProperty(value = "signedExpiry") private OffsetDateTime sharedAccessExpiryTime; /* * A unique value up to 64 characters in length that correlates to an access policy specified for the container, * queue, or table. */ - @JsonProperty(value = "signedIdentifier") private String identifier; /* * The start of partition key. */ - @JsonProperty(value = "startPk") private String partitionKeyStart; /* * The end of partition key. */ - @JsonProperty(value = "endPk") private String partitionKeyEnd; /* * The start of row key. */ - @JsonProperty(value = "startRk") private String rowKeyStart; /* * The end of row key. */ - @JsonProperty(value = "endRk") private String rowKeyEnd; /* * The key to sign the account SAS token with. */ - @JsonProperty(value = "keyToSign") private String keyToSign; /* * The response header override for cache control. */ - @JsonProperty(value = "rscc") private String cacheControl; /* * The response header override for content disposition. */ - @JsonProperty(value = "rscd") private String contentDisposition; /* * The response header override for content encoding. */ - @JsonProperty(value = "rsce") private String contentEncoding; /* * The response header override for content language. */ - @JsonProperty(value = "rscl") private String contentLanguage; /* * The response header override for content type. */ - @JsonProperty(value = "rsct") private String contentType; /** @@ -511,4 +499,100 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ServiceSasParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("canonicalizedResource", this.canonicalizedResource); + jsonWriter.writeStringField("signedResource", this.resource == null ? null : this.resource.toString()); + jsonWriter.writeStringField("signedPermission", this.permissions == null ? null : this.permissions.toString()); + jsonWriter.writeStringField("signedIp", this.ipAddressOrRange); + jsonWriter.writeStringField("signedProtocol", this.protocols == null ? null : this.protocols.toString()); + jsonWriter.writeStringField("signedStart", + this.sharedAccessStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sharedAccessStartTime)); + jsonWriter.writeStringField("signedExpiry", + this.sharedAccessExpiryTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sharedAccessExpiryTime)); + jsonWriter.writeStringField("signedIdentifier", this.identifier); + jsonWriter.writeStringField("startPk", this.partitionKeyStart); + jsonWriter.writeStringField("endPk", this.partitionKeyEnd); + jsonWriter.writeStringField("startRk", this.rowKeyStart); + jsonWriter.writeStringField("endRk", this.rowKeyEnd); + jsonWriter.writeStringField("keyToSign", this.keyToSign); + jsonWriter.writeStringField("rscc", this.cacheControl); + jsonWriter.writeStringField("rscd", this.contentDisposition); + jsonWriter.writeStringField("rsce", this.contentEncoding); + jsonWriter.writeStringField("rscl", this.contentLanguage); + jsonWriter.writeStringField("rsct", this.contentType); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceSasParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceSasParameters 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 ServiceSasParameters. + */ + public static ServiceSasParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceSasParameters deserializedServiceSasParameters = new ServiceSasParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("canonicalizedResource".equals(fieldName)) { + deserializedServiceSasParameters.canonicalizedResource = reader.getString(); + } else if ("signedResource".equals(fieldName)) { + deserializedServiceSasParameters.resource = SignedResource.fromString(reader.getString()); + } else if ("signedPermission".equals(fieldName)) { + deserializedServiceSasParameters.permissions = Permissions.fromString(reader.getString()); + } else if ("signedIp".equals(fieldName)) { + deserializedServiceSasParameters.ipAddressOrRange = reader.getString(); + } else if ("signedProtocol".equals(fieldName)) { + deserializedServiceSasParameters.protocols = HttpProtocol.fromString(reader.getString()); + } else if ("signedStart".equals(fieldName)) { + deserializedServiceSasParameters.sharedAccessStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("signedExpiry".equals(fieldName)) { + deserializedServiceSasParameters.sharedAccessExpiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("signedIdentifier".equals(fieldName)) { + deserializedServiceSasParameters.identifier = reader.getString(); + } else if ("startPk".equals(fieldName)) { + deserializedServiceSasParameters.partitionKeyStart = reader.getString(); + } else if ("endPk".equals(fieldName)) { + deserializedServiceSasParameters.partitionKeyEnd = reader.getString(); + } else if ("startRk".equals(fieldName)) { + deserializedServiceSasParameters.rowKeyStart = reader.getString(); + } else if ("endRk".equals(fieldName)) { + deserializedServiceSasParameters.rowKeyEnd = reader.getString(); + } else if ("keyToSign".equals(fieldName)) { + deserializedServiceSasParameters.keyToSign = reader.getString(); + } else if ("rscc".equals(fieldName)) { + deserializedServiceSasParameters.cacheControl = reader.getString(); + } else if ("rscd".equals(fieldName)) { + deserializedServiceSasParameters.contentDisposition = reader.getString(); + } else if ("rsce".equals(fieldName)) { + deserializedServiceSasParameters.contentEncoding = reader.getString(); + } else if ("rscl".equals(fieldName)) { + deserializedServiceSasParameters.contentLanguage = reader.getString(); + } else if ("rsct".equals(fieldName)) { + deserializedServiceSasParameters.contentType = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceSasParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSpecification.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSpecification.java index 82f69da1f6f45..23f85b35de805 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSpecification.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSpecification.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; /** * One property of operation, include metric specifications. */ @Fluent -public final class ServiceSpecification { +public final class ServiceSpecification implements JsonSerializable { /* * Metric specifications of operation. */ - @JsonProperty(value = "metricSpecifications") private List metricSpecifications; /** @@ -55,4 +58,43 @@ public void validate() { metricSpecifications().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("metricSpecifications", this.metricSpecifications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceSpecification 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 ServiceSpecification. + */ + public static ServiceSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceSpecification deserializedServiceSpecification = new ServiceSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("metricSpecifications".equals(fieldName)) { + List metricSpecifications + = reader.readArray(reader1 -> MetricSpecification.fromJson(reader1)); + deserializedServiceSpecification.metricSpecifications = metricSpecifications; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceSpecification; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Services.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Services.java index c039f09e670bd..7c6036c91d1e7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Services.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Services.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public Services() { * @param name a name to look for. * @return the corresponding Services. */ - @JsonCreator public static Services fromString(String name) { return fromString(name, Services.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Severity.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Severity.java index 921c02ab1cefe..a156ca0f34d78 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Severity.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Severity.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public Severity() { * @param name a name to look for. * @return the corresponding Severity. */ - @JsonCreator public static Severity fromString(String name) { return fromString(name, Severity.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ShareAccessTier.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ShareAccessTier.java index 3bc8241836612..33be19e45a53b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ShareAccessTier.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ShareAccessTier.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public ShareAccessTier() { * @param name a name to look for. * @return the corresponding ShareAccessTier. */ - @JsonCreator public static ShareAccessTier fromString(String name) { return fromString(name, ShareAccessTier.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedIdentifier.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedIdentifier.java index 63cc7d58c0f7a..248f3c40e44be 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedIdentifier.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedIdentifier.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.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 SignedIdentifier model. */ @Fluent -public final class SignedIdentifier { +public final class SignedIdentifier implements JsonSerializable { /* * An unique identifier of the stored access policy. */ - @JsonProperty(value = "id") private String id; /* * Access policy */ - @JsonProperty(value = "accessPolicy") private AccessPolicy accessPolicy; /** @@ -80,4 +82,43 @@ public void validate() { accessPolicy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("accessPolicy", this.accessPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SignedIdentifier from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SignedIdentifier 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 SignedIdentifier. + */ + public static SignedIdentifier fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SignedIdentifier deserializedSignedIdentifier = new SignedIdentifier(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSignedIdentifier.id = reader.getString(); + } else if ("accessPolicy".equals(fieldName)) { + deserializedSignedIdentifier.accessPolicy = AccessPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSignedIdentifier; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResource.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResource.java index 77d429b402649..cf622163d1f6d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResource.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResource.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -48,7 +47,6 @@ public SignedResource() { * @param name a name to look for. * @return the corresponding SignedResource. */ - @JsonCreator public static SignedResource fromString(String name) { return fromString(name, SignedResource.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResourceTypes.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResourceTypes.java index 4d539d3bf2023..77bb7eaeeb936 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResourceTypes.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResourceTypes.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -44,7 +43,6 @@ public SignedResourceTypes() { * @param name a name to look for. * @return the corresponding SignedResourceTypes. */ - @JsonCreator public static SignedResourceTypes fromString(String name) { return fromString(name, SignedResourceTypes.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Sku.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Sku.java index 9fbe6de332968..fae87752c7598 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Sku.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Sku.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The SKU of the storage account. */ @Fluent -public final class Sku { +public final class Sku implements JsonSerializable { /* * The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was * called accountType. */ - @JsonProperty(value = "name", required = true) private SkuName name; /* * The SKU tier. This is based on the SKU name. */ - @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) private SkuTier tier; /** @@ -75,4 +77,43 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSku.name = SkuName.fromString(reader.getString()); + } else if ("tier".equals(fieldName)) { + deserializedSku.tier = SkuTier.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuCapability.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuCapability.java index 6327cbd183b5c..b93b05b7079b9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuCapability.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuCapability.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. */ @Immutable -public final class SkuCapability { +public final class SkuCapability implements JsonSerializable { /* * The name of capability, The capability information in the specified SKU, including file encryption, network ACLs, * change notification, etc. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * A string value to indicate states of given capability. Possibly 'true' or 'false'. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; /** @@ -57,4 +59,41 @@ public String value() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkuCapability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkuCapability 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 SkuCapability. + */ + public static SkuCapability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SkuCapability deserializedSkuCapability = new SkuCapability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSkuCapability.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedSkuCapability.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSkuCapability; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuConversionStatus.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuConversionStatus.java index 5ca3b3277f4ea..c6276bfd494da 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuConversionStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuConversionStatus.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -42,7 +41,6 @@ public SkuConversionStatus() { * @param name a name to look for. * @return the corresponding SkuConversionStatus. */ - @JsonCreator public static SkuConversionStatus fromString(String name) { return fromString(name, SkuConversionStatus.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuName.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuName.java index fe8c783af4943..2b0b0d40c0609 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuName.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuName.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -68,7 +67,6 @@ public SkuName() { * @param name a name to look for. * @return the corresponding SkuName. */ - @JsonCreator public static SkuName fromString(String name) { return fromString(name, SkuName.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuTier.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuTier.java index 533ae1462cb07..28ade2eab07fb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuTier.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuTier.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * The SKU tier. This is based on the SKU name. */ @@ -36,7 +33,6 @@ public enum SkuTier { * @param value the serialized value to parse. * @return the parsed SkuTier object, or null if unable to parse. */ - @JsonCreator public static SkuTier fromString(String value) { if (value == null) { return null; @@ -53,7 +49,6 @@ public static SkuTier fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SmbSetting.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SmbSetting.java index ac0b30a884f0f..fd2d0f6205a80 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SmbSetting.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SmbSetting.java @@ -5,45 +5,44 @@ package com.azure.resourcemanager.storage.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; /** * Setting for SMB protocol. */ @Fluent -public final class SmbSetting { +public final class SmbSetting implements JsonSerializable { /* * Multichannel setting. Applies to Premium FileStorage only. */ - @JsonProperty(value = "multichannel") private Multichannel multichannel; /* * SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a * string with delimiter ';'. */ - @JsonProperty(value = "versions") private String versions; /* * SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string * with delimiter ';'. */ - @JsonProperty(value = "authenticationMethods") private String authenticationMethods; /* * Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string * with delimiter ';' */ - @JsonProperty(value = "kerberosTicketEncryption") private String kerberosTicketEncryption; /* * SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be * passed as a string with delimiter ';'. */ - @JsonProperty(value = "channelEncryption") private String channelEncryption; /** @@ -170,4 +169,52 @@ public void validate() { multichannel().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("multichannel", this.multichannel); + jsonWriter.writeStringField("versions", this.versions); + jsonWriter.writeStringField("authenticationMethods", this.authenticationMethods); + jsonWriter.writeStringField("kerberosTicketEncryption", this.kerberosTicketEncryption); + jsonWriter.writeStringField("channelEncryption", this.channelEncryption); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SmbSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SmbSetting 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 SmbSetting. + */ + public static SmbSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SmbSetting deserializedSmbSetting = new SmbSetting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("multichannel".equals(fieldName)) { + deserializedSmbSetting.multichannel = Multichannel.fromJson(reader); + } else if ("versions".equals(fieldName)) { + deserializedSmbSetting.versions = reader.getString(); + } else if ("authenticationMethods".equals(fieldName)) { + deserializedSmbSetting.authenticationMethods = reader.getString(); + } else if ("kerberosTicketEncryption".equals(fieldName)) { + deserializedSmbSetting.kerberosTicketEncryption = reader.getString(); + } else if ("channelEncryption".equals(fieldName)) { + deserializedSmbSetting.channelEncryption = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSmbSetting; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SshPublicKey.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SshPublicKey.java index 480126799bac1..fb50181e0085a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SshPublicKey.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SshPublicKey.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.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 SshPublicKey model. */ @Fluent -public final class SshPublicKey { +public final class SshPublicKey implements JsonSerializable { /* * Optional. It is used to store the function/usage of the key */ - @JsonProperty(value = "description") private String description; /* * Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB */ - @JsonProperty(value = "key") private String key; /** @@ -79,4 +81,43 @@ public SshPublicKey withKey(String key) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("key", this.key); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SshPublicKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SshPublicKey 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 SshPublicKey. + */ + public static SshPublicKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SshPublicKey deserializedSshPublicKey = new SshPublicKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedSshPublicKey.description = reader.getString(); + } else if ("key".equals(fieldName)) { + deserializedSshPublicKey.key = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSshPublicKey; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/State.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/State.java index 9a046f16cd329..84442e5693196 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/State.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/State.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -52,7 +51,6 @@ public State() { * @param name a name to look for. * @return the corresponding State. */ - @JsonCreator public static State fromString(String name) { return fromString(name, State.class); } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCheckNameAvailabilityParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCheckNameAvailabilityParameters.java index 000cc1d2c6c6a..8550237f040bc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCheckNameAvailabilityParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCheckNameAvailabilityParameters.java @@ -6,23 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The parameters used to check the availability of the storage account name. */ @Fluent -public final class StorageAccountCheckNameAvailabilityParameters { +public final class StorageAccountCheckNameAvailabilityParameters + implements JsonSerializable { /* * The storage account name. */ - @JsonProperty(value = "name", required = true) private String name; /* * The type of resource, Microsoft.Storage/storageAccounts */ - @JsonProperty(value = "type", required = true) private String type = "Microsoft.Storage/storageAccounts"; /** @@ -85,4 +88,43 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(StorageAccountCheckNameAvailabilityParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountCheckNameAvailabilityParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountCheckNameAvailabilityParameters 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 StorageAccountCheckNameAvailabilityParameters. + */ + public static StorageAccountCheckNameAvailabilityParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountCheckNameAvailabilityParameters deserializedStorageAccountCheckNameAvailabilityParameters + = new StorageAccountCheckNameAvailabilityParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedStorageAccountCheckNameAvailabilityParameters.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountCheckNameAvailabilityParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java index 38949421a8084..74ac85595198d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java @@ -6,26 +6,27 @@ 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.storage.fluent.models.StorageAccountPropertiesCreateParameters; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** * The parameters used when creating a storage account. */ @Fluent -public final class StorageAccountCreateParameters { +public final class StorageAccountCreateParameters implements JsonSerializable { /* * Required. Gets or sets the SKU name. */ - @JsonProperty(value = "sku", required = true) private Sku sku; /* * Required. Indicates the type of storage account. */ - @JsonProperty(value = "kind", required = true) private Kind kind; /* @@ -33,14 +34,12 @@ public final class StorageAccountCreateParameters { * Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is * created, but if an identical geo region is specified on update, the request will succeed. */ - @JsonProperty(value = "location", required = true) private String location; /* * Optional. Set the extended location of the resource. If not set, the storage account will be created in Azure * main region. Otherwise it will be created in the specified extended location */ - @JsonProperty(value = "extendedLocation") private ExtendedLocation extendedLocation; /* @@ -49,20 +48,16 @@ public final class StorageAccountCreateParameters { * must have a key with a length no greater than 128 characters and a value with a length no greater than 256 * characters. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The identity of the resource. */ - @JsonProperty(value = "identity") private Identity identity; /* * The parameters used to create the storage account. */ - @JsonProperty(value = "properties") private StorageAccountPropertiesCreateParameters innerProperties; /** @@ -849,4 +844,62 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(StorageAccountCreateParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountCreateParameters 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 StorageAccountCreateParameters. + */ + public static StorageAccountCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountCreateParameters deserializedStorageAccountCreateParameters + = new StorageAccountCreateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sku".equals(fieldName)) { + deserializedStorageAccountCreateParameters.sku = Sku.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedStorageAccountCreateParameters.kind = Kind.fromString(reader.getString()); + } else if ("location".equals(fieldName)) { + deserializedStorageAccountCreateParameters.location = reader.getString(); + } else if ("extendedLocation".equals(fieldName)) { + deserializedStorageAccountCreateParameters.extendedLocation = ExtendedLocation.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedStorageAccountCreateParameters.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedStorageAccountCreateParameters.identity = Identity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedStorageAccountCreateParameters.innerProperties + = StorageAccountPropertiesCreateParameters.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountCreateParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountExpand.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountExpand.java index 3f1d35c5b5fee..5a0a1a7c8e34e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountExpand.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountExpand.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Defines values for StorageAccountExpand. */ @@ -36,7 +33,6 @@ public enum StorageAccountExpand { * @param value the serialized value to parse. * @return the parsed StorageAccountExpand object, or null if unable to parse. */ - @JsonCreator public static StorageAccountExpand fromString(String value) { if (value == null) { return null; @@ -53,7 +49,6 @@ public static StorageAccountExpand fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountInternetEndpoints.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountInternetEndpoints.java index 7ff1e6a0b1b58..d11730e698424 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountInternetEndpoints.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountInternetEndpoints.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing * endpoint. */ @Immutable -public final class StorageAccountInternetEndpoints { +public final class StorageAccountInternetEndpoints implements JsonSerializable { /* * Gets the blob endpoint. */ - @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) private String blob; /* * Gets the file endpoint. */ - @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) private String file; /* * Gets the web endpoint. */ - @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) private String web; /* * Gets the dfs endpoint. */ - @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) private String dfs; /** @@ -86,4 +86,46 @@ public String dfs() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountInternetEndpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountInternetEndpoints 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 StorageAccountInternetEndpoints. + */ + public static StorageAccountInternetEndpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountInternetEndpoints deserializedStorageAccountInternetEndpoints + = new StorageAccountInternetEndpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blob".equals(fieldName)) { + deserializedStorageAccountInternetEndpoints.blob = reader.getString(); + } else if ("file".equals(fieldName)) { + deserializedStorageAccountInternetEndpoints.file = reader.getString(); + } else if ("web".equals(fieldName)) { + deserializedStorageAccountInternetEndpoints.web = reader.getString(); + } else if ("dfs".equals(fieldName)) { + deserializedStorageAccountInternetEndpoints.dfs = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountInternetEndpoints; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountKey.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountKey.java index 3acd0bd5f26b9..26a6e6f63a82d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountKey.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountKey.java @@ -5,36 +5,37 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * An access key for the storage account. */ @Immutable -public final class StorageAccountKey { +public final class StorageAccountKey implements JsonSerializable { /* * Name of the key. */ - @JsonProperty(value = "keyName", access = JsonProperty.Access.WRITE_ONLY) private String keyName; /* * Base 64-encoded value of the key. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; /* * Permissions for the key -- read-only or full permissions. */ - @JsonProperty(value = "permissions", access = JsonProperty.Access.WRITE_ONLY) private KeyPermission permissions; /* * Creation time of the key, in round trip date format. */ - @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime creationTime; /** @@ -86,4 +87,46 @@ public OffsetDateTime creationTime() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountKey from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountKey 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 StorageAccountKey. + */ + public static StorageAccountKey fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountKey deserializedStorageAccountKey = new StorageAccountKey(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyName".equals(fieldName)) { + deserializedStorageAccountKey.keyName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedStorageAccountKey.value = reader.getString(); + } else if ("permissions".equals(fieldName)) { + deserializedStorageAccountKey.permissions = KeyPermission.fromString(reader.getString()); + } else if ("creationTime".equals(fieldName)) { + deserializedStorageAccountKey.creationTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountKey; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountListResult.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountListResult.java index 11af34a1e8ffd..064c614fb6cd9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountListResult.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.StorageAccountInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response from the List Storage Accounts operation. */ @Immutable -public final class StorageAccountListResult { +public final class StorageAccountListResult implements JsonSerializable { /* * Gets the list of storage accounts and their properties. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Request URL that can be used to query next page of storage accounts. Returned when total number of requested * storage accounts exceed maximum page size. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -62,4 +64,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountListResult 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 StorageAccountListResult. + */ + public static StorageAccountListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountListResult deserializedStorageAccountListResult = new StorageAccountListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> StorageAccountInner.fromJson(reader1)); + deserializedStorageAccountListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStorageAccountListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountMicrosoftEndpoints.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountMicrosoftEndpoints.java index 10195c53459b9..66f830eb8286b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountMicrosoftEndpoints.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountMicrosoftEndpoints.java @@ -5,48 +5,46 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft * routing endpoint. */ @Immutable -public final class StorageAccountMicrosoftEndpoints { +public final class StorageAccountMicrosoftEndpoints implements JsonSerializable { /* * Gets the blob endpoint. */ - @JsonProperty(value = "blob", access = JsonProperty.Access.WRITE_ONLY) private String blob; /* * Gets the queue endpoint. */ - @JsonProperty(value = "queue", access = JsonProperty.Access.WRITE_ONLY) private String queue; /* * Gets the table endpoint. */ - @JsonProperty(value = "table", access = JsonProperty.Access.WRITE_ONLY) private String table; /* * Gets the file endpoint. */ - @JsonProperty(value = "file", access = JsonProperty.Access.WRITE_ONLY) private String file; /* * Gets the web endpoint. */ - @JsonProperty(value = "web", access = JsonProperty.Access.WRITE_ONLY) private String web; /* * Gets the dfs endpoint. */ - @JsonProperty(value = "dfs", access = JsonProperty.Access.WRITE_ONLY) private String dfs; /** @@ -116,4 +114,50 @@ public String dfs() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountMicrosoftEndpoints from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountMicrosoftEndpoints 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 StorageAccountMicrosoftEndpoints. + */ + public static StorageAccountMicrosoftEndpoints fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountMicrosoftEndpoints deserializedStorageAccountMicrosoftEndpoints + = new StorageAccountMicrosoftEndpoints(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blob".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.blob = reader.getString(); + } else if ("queue".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.queue = reader.getString(); + } else if ("table".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.table = reader.getString(); + } else if ("file".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.file = reader.getString(); + } else if ("web".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.web = reader.getString(); + } else if ("dfs".equals(fieldName)) { + deserializedStorageAccountMicrosoftEndpoints.dfs = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountMicrosoftEndpoints; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountRegenerateKeyParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountRegenerateKeyParameters.java index 4e555c96ba8bb..97aec2df95f4a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountRegenerateKeyParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountRegenerateKeyParameters.java @@ -6,17 +6,21 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The parameters used to regenerate the storage account key. */ @Fluent -public final class StorageAccountRegenerateKeyParameters { +public final class StorageAccountRegenerateKeyParameters + implements JsonSerializable { /* * The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. */ - @JsonProperty(value = "keyName", required = true) private String keyName; /** @@ -61,4 +65,42 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(StorageAccountRegenerateKeyParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyName", this.keyName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountRegenerateKeyParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountRegenerateKeyParameters 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 StorageAccountRegenerateKeyParameters. + */ + public static StorageAccountRegenerateKeyParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountRegenerateKeyParameters deserializedStorageAccountRegenerateKeyParameters + = new StorageAccountRegenerateKeyParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyName".equals(fieldName)) { + deserializedStorageAccountRegenerateKeyParameters.keyName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountRegenerateKeyParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountSkuConversionStatus.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountSkuConversionStatus.java index bbf84197d9074..7ff95f6cfaae8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountSkuConversionStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountSkuConversionStatus.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.storage.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; /** * This defines the sku conversion status object for asynchronous sku conversions. */ @Fluent -public final class StorageAccountSkuConversionStatus { +public final class StorageAccountSkuConversionStatus implements JsonSerializable { /* * This property indicates the current sku conversion status. */ - @JsonProperty(value = "skuConversionStatus", access = JsonProperty.Access.WRITE_ONLY) private SkuConversionStatus skuConversionStatus; /* * This property represents the target sku name to which the account sku is being converted asynchronously. */ - @JsonProperty(value = "targetSkuName") private SkuName targetSkuName; /* * This property represents the sku conversion start time. */ - @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) private String startTime; /* * This property represents the sku conversion end time. */ - @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) private String endTime; /** @@ -98,4 +98,49 @@ public String endTime() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("targetSkuName", this.targetSkuName == null ? null : this.targetSkuName.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountSkuConversionStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountSkuConversionStatus 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 StorageAccountSkuConversionStatus. + */ + public static StorageAccountSkuConversionStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountSkuConversionStatus deserializedStorageAccountSkuConversionStatus + = new StorageAccountSkuConversionStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("skuConversionStatus".equals(fieldName)) { + deserializedStorageAccountSkuConversionStatus.skuConversionStatus + = SkuConversionStatus.fromString(reader.getString()); + } else if ("targetSkuName".equals(fieldName)) { + deserializedStorageAccountSkuConversionStatus.targetSkuName + = SkuName.fromString(reader.getString()); + } else if ("startTime".equals(fieldName)) { + deserializedStorageAccountSkuConversionStatus.startTime = reader.getString(); + } else if ("endTime".equals(fieldName)) { + deserializedStorageAccountSkuConversionStatus.endTime = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountSkuConversionStatus; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java index 26b3bd4bfd69d..e11ae3d9b3d06 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java @@ -5,21 +5,23 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.StorageAccountPropertiesUpdateParameters; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** * The parameters that can be provided when updating the storage account properties. */ @Fluent -public final class StorageAccountUpdateParameters { +public final class StorageAccountUpdateParameters implements JsonSerializable { /* * Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, * nor can accounts of those SKU names be updated to any other value. */ - @JsonProperty(value = "sku") private Sku sku; /* @@ -27,26 +29,21 @@ public final class StorageAccountUpdateParameters { * this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a * key no greater in length than 128 characters and a value no greater in length than 256 characters. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The identity of the resource. */ - @JsonProperty(value = "identity") private Identity identity; /* * The parameters used when updating a storage account. */ - @JsonProperty(value = "properties") private StorageAccountPropertiesUpdateParameters innerProperties; /* * Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. */ - @JsonProperty(value = "kind") private Kind kind; /** @@ -724,4 +721,55 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageAccountUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageAccountUpdateParameters 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 StorageAccountUpdateParameters. + */ + public static StorageAccountUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageAccountUpdateParameters deserializedStorageAccountUpdateParameters + = new StorageAccountUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sku".equals(fieldName)) { + deserializedStorageAccountUpdateParameters.sku = Sku.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedStorageAccountUpdateParameters.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedStorageAccountUpdateParameters.identity = Identity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedStorageAccountUpdateParameters.innerProperties + = StorageAccountPropertiesUpdateParameters.fromJson(reader); + } else if ("kind".equals(fieldName)) { + deserializedStorageAccountUpdateParameters.kind = Kind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageAccountUpdateParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSkuListResult.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSkuListResult.java index 7bc3a6158c4f0..e85ecc514e84d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSkuListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageSkuListResult.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.SkuInformationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response from the List Storage SKUs operation. */ @Immutable -public final class StorageSkuListResult { +public final class StorageSkuListResult implements JsonSerializable { /* * Get the list result of storage SKUs and their properties. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /** @@ -45,4 +48,41 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageSkuListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageSkuListResult 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 StorageSkuListResult. + */ + public static StorageSkuListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageSkuListResult deserializedStorageSkuListResult = new StorageSkuListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SkuInformationInner.fromJson(reader1)); + deserializedStorageSkuListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedStorageSkuListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentExecutionContext.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentExecutionContext.java index 29acfc2b76793..aac9053e7b2e2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentExecutionContext.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentExecutionContext.java @@ -6,23 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Execution context of the storage task assignment. */ @Fluent -public final class StorageTaskAssignmentExecutionContext { +public final class StorageTaskAssignmentExecutionContext + implements JsonSerializable { /* * Execution target of the storage task assignment */ - @JsonProperty(value = "target") private ExecutionTarget target; /* * Execution trigger of the storage task assignment */ - @JsonProperty(value = "trigger", required = true) private ExecutionTrigger trigger; /** @@ -90,4 +93,45 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentExecutionContext.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trigger", this.trigger); + jsonWriter.writeJsonField("target", this.target); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentExecutionContext from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentExecutionContext 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 StorageTaskAssignmentExecutionContext. + */ + public static StorageTaskAssignmentExecutionContext fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentExecutionContext deserializedStorageTaskAssignmentExecutionContext + = new StorageTaskAssignmentExecutionContext(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trigger".equals(fieldName)) { + deserializedStorageTaskAssignmentExecutionContext.trigger = ExecutionTrigger.fromJson(reader); + } else if ("target".equals(fieldName)) { + deserializedStorageTaskAssignmentExecutionContext.target = ExecutionTarget.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentExecutionContext; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentProperties.java index 82974152a9df0..1a019326dc971 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentProperties.java @@ -6,53 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Properties of the storage task assignment. */ @Fluent -public final class StorageTaskAssignmentProperties { +public final class StorageTaskAssignmentProperties implements JsonSerializable { /* * Id of the corresponding storage task */ - @JsonProperty(value = "taskId", required = true) private String taskId; /* * Whether the storage task assignment is enabled or not */ - @JsonProperty(value = "enabled", required = true) private boolean enabled; /* * Text that describes the purpose of the storage task assignment */ - @JsonProperty(value = "description", required = true) private String description; /* * The storage task assignment execution context */ - @JsonProperty(value = "executionContext", required = true) private StorageTaskAssignmentExecutionContext executionContext; /* * The storage task assignment report */ - @JsonProperty(value = "report", required = true) private StorageTaskAssignmentReport report; /* * Represents the provisioning state of the storage task assignment. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * Run status of storage task assignment */ - @JsonProperty(value = "runStatus") private StorageTaskReportProperties runStatus; /** @@ -227,4 +224,62 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("taskId", this.taskId); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("executionContext", this.executionContext); + jsonWriter.writeJsonField("report", this.report); + jsonWriter.writeJsonField("runStatus", this.runStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentProperties 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 StorageTaskAssignmentProperties. + */ + public static StorageTaskAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentProperties deserializedStorageTaskAssignmentProperties + = new StorageTaskAssignmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskId".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.taskId = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.enabled = reader.getBoolean(); + } else if ("description".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.description = reader.getString(); + } else if ("executionContext".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.executionContext + = StorageTaskAssignmentExecutionContext.fromJson(reader); + } else if ("report".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.report = StorageTaskAssignmentReport.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("runStatus".equals(fieldName)) { + deserializedStorageTaskAssignmentProperties.runStatus + = StorageTaskReportProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentReport.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentReport.java index a2a37e72d6f9a..ca5d3fac78284 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentReport.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentReport.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The storage task assignment report. */ @Fluent -public final class StorageTaskAssignmentReport { +public final class StorageTaskAssignmentReport implements JsonSerializable { /* * The container prefix for the location of storage task assignment report */ - @JsonProperty(value = "prefix", required = true) private String prefix; /** @@ -59,4 +62,41 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentReport.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("prefix", this.prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentReport from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentReport 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 StorageTaskAssignmentReport. + */ + public static StorageTaskAssignmentReport fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentReport deserializedStorageTaskAssignmentReport = new StorageTaskAssignmentReport(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefix".equals(fieldName)) { + deserializedStorageTaskAssignmentReport.prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentReport; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateExecutionContext.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateExecutionContext.java index de6eeea8e3698..4ab1c93a3cc0c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateExecutionContext.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateExecutionContext.java @@ -5,23 +5,26 @@ package com.azure.resourcemanager.storage.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; /** * Execution context of the storage task assignment update. */ @Fluent -public final class StorageTaskAssignmentUpdateExecutionContext { +public final class StorageTaskAssignmentUpdateExecutionContext + implements JsonSerializable { /* * Execution target of the storage task assignment */ - @JsonProperty(value = "target") private ExecutionTarget target; /* * Execution trigger of the storage task assignment */ - @JsonProperty(value = "trigger") private ExecutionTriggerUpdate trigger; /** @@ -83,4 +86,45 @@ public void validate() { trigger().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("target", this.target); + jsonWriter.writeJsonField("trigger", this.trigger); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentUpdateExecutionContext from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentUpdateExecutionContext 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 StorageTaskAssignmentUpdateExecutionContext. + */ + public static StorageTaskAssignmentUpdateExecutionContext fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentUpdateExecutionContext deserializedStorageTaskAssignmentUpdateExecutionContext + = new StorageTaskAssignmentUpdateExecutionContext(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("target".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateExecutionContext.target = ExecutionTarget.fromJson(reader); + } else if ("trigger".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateExecutionContext.trigger + = ExecutionTriggerUpdate.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentUpdateExecutionContext; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateParameters.java index c396ddb8021e0..351a4cd9a477d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateParameters.java @@ -5,17 +5,21 @@ package com.azure.resourcemanager.storage.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; /** * Parameters of the storage task assignment update request. */ @Fluent -public final class StorageTaskAssignmentUpdateParameters { +public final class StorageTaskAssignmentUpdateParameters + implements JsonSerializable { /* * Properties of the storage task assignment. */ - @JsonProperty(value = "properties") private StorageTaskAssignmentUpdateProperties properties; /** @@ -54,4 +58,42 @@ 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 StorageTaskAssignmentUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentUpdateParameters 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 StorageTaskAssignmentUpdateParameters. + */ + public static StorageTaskAssignmentUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentUpdateParameters deserializedStorageTaskAssignmentUpdateParameters + = new StorageTaskAssignmentUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateParameters.properties + = StorageTaskAssignmentUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentUpdateParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateProperties.java index 9934386a492d8..9e1a1f6ce90fd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateProperties.java @@ -5,53 +5,51 @@ package com.azure.resourcemanager.storage.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; /** * Properties of the storage task update assignment. */ @Fluent -public final class StorageTaskAssignmentUpdateProperties { +public final class StorageTaskAssignmentUpdateProperties + implements JsonSerializable { /* * Id of the corresponding storage task */ - @JsonProperty(value = "taskId", access = JsonProperty.Access.WRITE_ONLY) private String taskId; /* * Whether the storage task assignment is enabled or not */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * Text that describes the purpose of the storage task assignment */ - @JsonProperty(value = "description") private String description; /* * The storage task assignment execution context */ - @JsonProperty(value = "executionContext") private StorageTaskAssignmentUpdateExecutionContext executionContext; /* * The storage task assignment report */ - @JsonProperty(value = "report") private StorageTaskAssignmentUpdateReport report; /* * Represents the provisioning state of the storage task assignment. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * Run status of storage task assignment */ - @JsonProperty(value = "runStatus") private StorageTaskReportProperties runStatus; /** @@ -195,4 +193,62 @@ public void validate() { runStatus().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("executionContext", this.executionContext); + jsonWriter.writeJsonField("report", this.report); + jsonWriter.writeJsonField("runStatus", this.runStatus); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentUpdateProperties 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 StorageTaskAssignmentUpdateProperties. + */ + public static StorageTaskAssignmentUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentUpdateProperties deserializedStorageTaskAssignmentUpdateProperties + = new StorageTaskAssignmentUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskId".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.taskId = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.enabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.description = reader.getString(); + } else if ("executionContext".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.executionContext + = StorageTaskAssignmentUpdateExecutionContext.fromJson(reader); + } else if ("report".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.report + = StorageTaskAssignmentUpdateReport.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("runStatus".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateProperties.runStatus + = StorageTaskReportProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentUpdateProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateReport.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateReport.java index 0e3b0683c0b76..6976f2eb97556 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateReport.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateReport.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.storage.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 storage task assignment report. */ @Fluent -public final class StorageTaskAssignmentUpdateReport { +public final class StorageTaskAssignmentUpdateReport implements JsonSerializable { /* * The prefix of the storage task assignment report */ - @JsonProperty(value = "prefix") private String prefix; /** @@ -51,4 +54,41 @@ public StorageTaskAssignmentUpdateReport withPrefix(String prefix) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("prefix", this.prefix); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentUpdateReport from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentUpdateReport 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 StorageTaskAssignmentUpdateReport. + */ + public static StorageTaskAssignmentUpdateReport fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentUpdateReport deserializedStorageTaskAssignmentUpdateReport + = new StorageTaskAssignmentUpdateReport(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("prefix".equals(fieldName)) { + deserializedStorageTaskAssignmentUpdateReport.prefix = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentUpdateReport; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentsList.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentsList.java index cd4cfa295e535..1360cf1f832c9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentsList.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentsList.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.StorageTaskAssignmentInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * List of storage task assignments for the storage account. */ @Immutable -public final class StorageTaskAssignmentsList { +public final class StorageTaskAssignmentsList implements JsonSerializable { /* * Gets the list of storage task assignments and their properties. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Request URL that can be used to query next page of storage task assignments. Returned when total number of * requested storage task assignments exceed maximum page size. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -62,4 +64,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskAssignmentsList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskAssignmentsList 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 StorageTaskAssignmentsList. + */ + public static StorageTaskAssignmentsList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskAssignmentsList deserializedStorageTaskAssignmentsList = new StorageTaskAssignmentsList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> StorageTaskAssignmentInner.fromJson(reader1)); + deserializedStorageTaskAssignmentsList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStorageTaskAssignmentsList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskAssignmentsList; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskReportProperties.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskReportProperties.java index f7dc262974b7f..2b0606d79bb0d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskReportProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskReportProperties.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Storage task execution report for a run instance. */ @Immutable -public final class StorageTaskReportProperties { +public final class StorageTaskReportProperties implements JsonSerializable { /* * Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. */ - @JsonProperty(value = "taskAssignmentId", access = JsonProperty.Access.WRITE_ONLY) private String taskAssignmentId; /* * Represents the Storage Account Id where the storage task definition was applied and executed. */ - @JsonProperty(value = "storageAccountId", access = JsonProperty.Access.WRITE_ONLY) private String storageAccountId; /* @@ -30,7 +32,6 @@ public final class StorageTaskReportProperties { * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- * operators */ - @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) private String startTime; /* @@ -39,7 +40,6 @@ public final class StorageTaskReportProperties { * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- * operators */ - @JsonProperty(value = "finishTime", access = JsonProperty.Access.WRITE_ONLY) private String finishTime; /* @@ -49,7 +49,6 @@ public final class StorageTaskReportProperties { * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- * operators */ - @JsonProperty(value = "objectsTargetedCount", access = JsonProperty.Access.WRITE_ONLY) private String objectsTargetedCount; /* @@ -58,7 +57,6 @@ public final class StorageTaskReportProperties { * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- * operators */ - @JsonProperty(value = "objectsOperatedOnCount", access = JsonProperty.Access.WRITE_ONLY) private String objectsOperatedOnCount; /* @@ -67,7 +65,6 @@ public final class StorageTaskReportProperties { * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- * operators */ - @JsonProperty(value = "objectFailedCount", access = JsonProperty.Access.WRITE_ONLY) private String objectFailedCount; /* @@ -76,44 +73,37 @@ public final class StorageTaskReportProperties { * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- * operators */ - @JsonProperty(value = "objectsSucceededCount", access = JsonProperty.Access.WRITE_ONLY) private String objectsSucceededCount; /* * Well known Azure Storage error code that represents the error encountered during execution of the run instance. */ - @JsonProperty(value = "runStatusError", access = JsonProperty.Access.WRITE_ONLY) private String runStatusError; /* * Represents the status of the execution. */ - @JsonProperty(value = "runStatusEnum", access = JsonProperty.Access.WRITE_ONLY) private RunStatusEnum runStatusEnum; /* * Full path to the verbose report stored in the reporting container as specified in the assignment execution * context for the storage account. */ - @JsonProperty(value = "summaryReportPath", access = JsonProperty.Access.WRITE_ONLY) private String summaryReportPath; /* * Storage Task Arm Id. */ - @JsonProperty(value = "taskId", access = JsonProperty.Access.WRITE_ONLY) private String taskId; /* * Storage Task Version */ - @JsonProperty(value = "taskVersion", access = JsonProperty.Access.WRITE_ONLY) private String taskVersion; /* * Represents the overall result of the execution for the run instance */ - @JsonProperty(value = "runResult", access = JsonProperty.Access.WRITE_ONLY) private RunResult runResult; /** @@ -275,4 +265,66 @@ public RunResult runResult() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskReportProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskReportProperties 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 StorageTaskReportProperties. + */ + public static StorageTaskReportProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskReportProperties deserializedStorageTaskReportProperties = new StorageTaskReportProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskAssignmentId".equals(fieldName)) { + deserializedStorageTaskReportProperties.taskAssignmentId = reader.getString(); + } else if ("storageAccountId".equals(fieldName)) { + deserializedStorageTaskReportProperties.storageAccountId = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedStorageTaskReportProperties.startTime = reader.getString(); + } else if ("finishTime".equals(fieldName)) { + deserializedStorageTaskReportProperties.finishTime = reader.getString(); + } else if ("objectsTargetedCount".equals(fieldName)) { + deserializedStorageTaskReportProperties.objectsTargetedCount = reader.getString(); + } else if ("objectsOperatedOnCount".equals(fieldName)) { + deserializedStorageTaskReportProperties.objectsOperatedOnCount = reader.getString(); + } else if ("objectFailedCount".equals(fieldName)) { + deserializedStorageTaskReportProperties.objectFailedCount = reader.getString(); + } else if ("objectsSucceededCount".equals(fieldName)) { + deserializedStorageTaskReportProperties.objectsSucceededCount = reader.getString(); + } else if ("runStatusError".equals(fieldName)) { + deserializedStorageTaskReportProperties.runStatusError = reader.getString(); + } else if ("runStatusEnum".equals(fieldName)) { + deserializedStorageTaskReportProperties.runStatusEnum + = RunStatusEnum.fromString(reader.getString()); + } else if ("summaryReportPath".equals(fieldName)) { + deserializedStorageTaskReportProperties.summaryReportPath = reader.getString(); + } else if ("taskId".equals(fieldName)) { + deserializedStorageTaskReportProperties.taskId = reader.getString(); + } else if ("taskVersion".equals(fieldName)) { + deserializedStorageTaskReportProperties.taskVersion = reader.getString(); + } else if ("runResult".equals(fieldName)) { + deserializedStorageTaskReportProperties.runResult = RunResult.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskReportProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskReportSummary.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskReportSummary.java index ef521e4c0e1fe..60bd7b92df4c6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskReportSummary.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskReportSummary.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.StorageTaskReportInstanceInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Fetch Storage Tasks Run Summary. */ @Immutable -public final class StorageTaskReportSummary { +public final class StorageTaskReportSummary implements JsonSerializable { /* * Gets storage tasks run result summary. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * Request URL that can be used to query next page of storage task run results summary. Returned when the number of * run instances and summary reports exceed maximum page size. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -62,4 +64,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskReportSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskReportSummary 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 StorageTaskReportSummary. + */ + public static StorageTaskReportSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskReportSummary deserializedStorageTaskReportSummary = new StorageTaskReportSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> StorageTaskReportInstanceInner.fromJson(reader1)); + deserializedStorageTaskReportSummary.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedStorageTaskReportSummary.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskReportSummary; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TableAccessPolicy.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TableAccessPolicy.java index 9db47f2b8ba07..cebc5623dfce8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TableAccessPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TableAccessPolicy.java @@ -5,31 +5,34 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * Table Access Policy Properties Object. */ @Fluent -public final class TableAccessPolicy { +public final class TableAccessPolicy implements JsonSerializable { /* * Start time of the access policy */ - @JsonProperty(value = "startTime") private OffsetDateTime startTime; /* * Expiry time of the access policy */ - @JsonProperty(value = "expiryTime") private OffsetDateTime expiryTime; /* * Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' */ - @JsonProperty(value = "permission", required = true) private String permission; /** @@ -113,4 +116,51 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(TableAccessPolicy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("permission", this.permission); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("expiryTime", + this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableAccessPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableAccessPolicy 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 TableAccessPolicy. + */ + public static TableAccessPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableAccessPolicy deserializedTableAccessPolicy = new TableAccessPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("permission".equals(fieldName)) { + deserializedTableAccessPolicy.permission = reader.getString(); + } else if ("startTime".equals(fieldName)) { + deserializedTableAccessPolicy.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expiryTime".equals(fieldName)) { + deserializedTableAccessPolicy.expiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTableAccessPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TableSignedIdentifier.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TableSignedIdentifier.java index e3df7111bcec6..e0a340a90e4ad 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TableSignedIdentifier.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TableSignedIdentifier.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Object to set Table Access Policy. */ @Fluent -public final class TableSignedIdentifier { +public final class TableSignedIdentifier implements JsonSerializable { /* * unique-64-character-value of the stored access policy. */ - @JsonProperty(value = "id", required = true) private String id; /* * Access policy */ - @JsonProperty(value = "accessPolicy") private TableAccessPolicy accessPolicy; /** @@ -87,4 +89,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(TableSignedIdentifier.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("accessPolicy", this.accessPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableSignedIdentifier from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableSignedIdentifier 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 TableSignedIdentifier. + */ + public static TableSignedIdentifier fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableSignedIdentifier deserializedTableSignedIdentifier = new TableSignedIdentifier(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTableSignedIdentifier.id = reader.getString(); + } else if ("accessPolicy".equals(fieldName)) { + deserializedTableSignedIdentifier.accessPolicy = TableAccessPolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTableSignedIdentifier; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagFilter.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagFilter.java index 3818fc45c6a6a..00a8931b17507 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagFilter.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagFilter.java @@ -6,30 +6,31 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Blob index tag based filtering for blob objects. */ @Fluent -public final class TagFilter { +public final class TagFilter implements JsonSerializable { /* * This is the filter tag name, it can have 1 - 128 characters */ - @JsonProperty(value = "name", required = true) private String name; /* * This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is * currently supported */ - @JsonProperty(value = "op", required = true) private String op; /* * This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters */ - @JsonProperty(value = "value", required = true) private String value; /** @@ -122,4 +123,47 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(TagFilter.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("op", this.op); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagFilter 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 TagFilter. + */ + public static TagFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagFilter deserializedTagFilter = new TagFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedTagFilter.name = reader.getString(); + } else if ("op".equals(fieldName)) { + deserializedTagFilter.op = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedTagFilter.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagFilter; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagProperty.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagProperty.java index f473d4556a50f..2ebce781c9466 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagProperty.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagProperty.java @@ -5,42 +5,42 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * A tag of the LegalHold of a blob container. */ @Immutable -public final class TagProperty { +public final class TagProperty implements JsonSerializable { /* * The tag value. */ - @JsonProperty(value = "tag", access = JsonProperty.Access.WRITE_ONLY) private String tag; /* * Returns the date and time the tag was added. */ - @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime timestamp; /* * Returns the Object ID of the user who added the tag. */ - @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) private String objectIdentifier; /* * Returns the Tenant ID that issued the token for the user who added the tag. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; /* * Returns the User Principal Name of the user who added the tag. */ - @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) private String upn; /** @@ -101,4 +101,48 @@ public String upn() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TagProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TagProperty 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 TagProperty. + */ + public static TagProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TagProperty deserializedTagProperty = new TagProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tag".equals(fieldName)) { + deserializedTagProperty.tag = reader.getString(); + } else if ("timestamp".equals(fieldName)) { + deserializedTagProperty.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("objectIdentifier".equals(fieldName)) { + deserializedTagProperty.objectIdentifier = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedTagProperty.tenantId = reader.getString(); + } else if ("upn".equals(fieldName)) { + deserializedTagProperty.upn = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTagProperty; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerParameters.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerParameters.java index 2110528059c4d..f703b76b67f59 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerParameters.java @@ -5,47 +5,48 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The trigger parameters update for the storage task assignment execution. */ @Fluent -public final class TriggerParameters { +public final class TriggerParameters implements JsonSerializable { /* * When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; * this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' */ - @JsonProperty(value = "startFrom") private OffsetDateTime startFrom; /* * Run interval of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; * this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' */ - @JsonProperty(value = "interval") private Integer interval; /* * Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is * 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' */ - @JsonProperty(value = "intervalUnit") private IntervalUnit intervalUnit; /* * When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this * property should not be present when ExecutionTrigger.properties.type is 'RunOnce' */ - @JsonProperty(value = "endBy") private OffsetDateTime endBy; /* * When to start task execution. This is an optional field when ExecutionTrigger.properties.type is 'RunOnce'; this * property should not be present when ExecutionTrigger.properties.type is 'OnSchedule' */ - @JsonProperty(value = "startOn") private OffsetDateTime startOn; /** @@ -181,4 +182,58 @@ public TriggerParameters withStartOn(OffsetDateTime startOn) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startFrom", + this.startFrom == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startFrom)); + jsonWriter.writeNumberField("interval", this.interval); + jsonWriter.writeStringField("intervalUnit", this.intervalUnit == null ? null : this.intervalUnit.toString()); + jsonWriter.writeStringField("endBy", + this.endBy == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endBy)); + jsonWriter.writeStringField("startOn", + this.startOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startOn)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggerParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggerParameters 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 TriggerParameters. + */ + public static TriggerParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggerParameters deserializedTriggerParameters = new TriggerParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startFrom".equals(fieldName)) { + deserializedTriggerParameters.startFrom = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("interval".equals(fieldName)) { + deserializedTriggerParameters.interval = reader.getNullable(JsonReader::getInt); + } else if ("intervalUnit".equals(fieldName)) { + deserializedTriggerParameters.intervalUnit = IntervalUnit.fromString(reader.getString()); + } else if ("endBy".equals(fieldName)) { + deserializedTriggerParameters.endBy = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startOn".equals(fieldName)) { + deserializedTriggerParameters.startOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggerParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerParametersUpdate.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerParametersUpdate.java index 40e9e5c0c6516..be72a6303ed5f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerParametersUpdate.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerParametersUpdate.java @@ -5,47 +5,48 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; /** * The trigger parameters update for the storage task assignment execution. */ @Fluent -public final class TriggerParametersUpdate { +public final class TriggerParametersUpdate implements JsonSerializable { /* * When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this * property should not be present when ExecutionTrigger.properties.type is 'RunOnce' */ - @JsonProperty(value = "startFrom") private OffsetDateTime startFrom; /* * Run interval of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; * this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' */ - @JsonProperty(value = "interval") private Integer interval; /* * Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is * 'OnSchedule'; this property should not be present when ExecutionTrigger.properties.type is 'RunOnce' */ - @JsonProperty(value = "intervalUnit") private IntervalUnit intervalUnit; /* * When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this * property should not be present when ExecutionTrigger.properties.type is 'RunOnce' */ - @JsonProperty(value = "endBy") private OffsetDateTime endBy; /* * When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'RunOnce'; this * property should not be present when ExecutionTrigger.properties.type is 'OnSchedule' */ - @JsonProperty(value = "startOn") private OffsetDateTime startOn; /** @@ -179,4 +180,58 @@ public TriggerParametersUpdate withStartOn(OffsetDateTime startOn) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("startFrom", + this.startFrom == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startFrom)); + jsonWriter.writeNumberField("interval", this.interval); + jsonWriter.writeStringField("intervalUnit", this.intervalUnit == null ? null : this.intervalUnit.toString()); + jsonWriter.writeStringField("endBy", + this.endBy == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endBy)); + jsonWriter.writeStringField("startOn", + this.startOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startOn)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TriggerParametersUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TriggerParametersUpdate 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 TriggerParametersUpdate. + */ + public static TriggerParametersUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TriggerParametersUpdate deserializedTriggerParametersUpdate = new TriggerParametersUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startFrom".equals(fieldName)) { + deserializedTriggerParametersUpdate.startFrom = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("interval".equals(fieldName)) { + deserializedTriggerParametersUpdate.interval = reader.getNullable(JsonReader::getInt); + } else if ("intervalUnit".equals(fieldName)) { + deserializedTriggerParametersUpdate.intervalUnit = IntervalUnit.fromString(reader.getString()); + } else if ("endBy".equals(fieldName)) { + deserializedTriggerParametersUpdate.endBy = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startOn".equals(fieldName)) { + deserializedTriggerParametersUpdate.startOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedTriggerParametersUpdate; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerType.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerType.java index b35f35396c14a..caae7314d3c7c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerType.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerType.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * The trigger type of the storage task assignment execution. */ @@ -36,7 +33,6 @@ public enum TriggerType { * @param value the serialized value to parse. * @return the parsed TriggerType object, or null if unable to parse. */ - @JsonCreator public static TriggerType fromString(String value) { if (value == null) { return null; @@ -53,7 +49,6 @@ public static TriggerType fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UpdateHistoryProperty.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UpdateHistoryProperty.java index 49415761e0bd6..33240a8a59891 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UpdateHistoryProperty.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UpdateHistoryProperty.java @@ -5,48 +5,47 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * An update history of the ImmutabilityPolicy of a blob container. */ @Fluent -public final class UpdateHistoryProperty { +public final class UpdateHistoryProperty implements JsonSerializable { /* * The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. */ - @JsonProperty(value = "update", access = JsonProperty.Access.WRITE_ONLY) private ImmutabilityPolicyUpdateType update; /* * The immutability period for the blobs in the container since the policy creation, in days. */ - @JsonProperty(value = "immutabilityPeriodSinceCreationInDays", access = JsonProperty.Access.WRITE_ONLY) private Integer immutabilityPeriodSinceCreationInDays; /* * Returns the date and time the ImmutabilityPolicy was updated. */ - @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime timestamp; /* * Returns the Object ID of the user who updated the ImmutabilityPolicy. */ - @JsonProperty(value = "objectIdentifier", access = JsonProperty.Access.WRITE_ONLY) private String objectIdentifier; /* * Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; /* * Returns the User Principal Name of the user who updated the ImmutabilityPolicy. */ - @JsonProperty(value = "upn", access = JsonProperty.Access.WRITE_ONLY) private String upn; /* @@ -55,7 +54,6 @@ public final class UpdateHistoryProperty { * and any existing blocks cannot be modified or deleted. This property cannot be changed with * ExtendImmutabilityPolicy API. */ - @JsonProperty(value = "allowProtectedAppendWrites") private Boolean allowProtectedAppendWrites; /* @@ -65,7 +63,6 @@ public final class UpdateHistoryProperty { * ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are * mutually exclusive. */ - @JsonProperty(value = "allowProtectedAppendWritesAll") private Boolean allowProtectedAppendWritesAll; /** @@ -192,4 +189,60 @@ public UpdateHistoryProperty withAllowProtectedAppendWritesAll(Boolean allowProt */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowProtectedAppendWrites", this.allowProtectedAppendWrites); + jsonWriter.writeBooleanField("allowProtectedAppendWritesAll", this.allowProtectedAppendWritesAll); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateHistoryProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateHistoryProperty 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 UpdateHistoryProperty. + */ + public static UpdateHistoryProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateHistoryProperty deserializedUpdateHistoryProperty = new UpdateHistoryProperty(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("update".equals(fieldName)) { + deserializedUpdateHistoryProperty.update + = ImmutabilityPolicyUpdateType.fromString(reader.getString()); + } else if ("immutabilityPeriodSinceCreationInDays".equals(fieldName)) { + deserializedUpdateHistoryProperty.immutabilityPeriodSinceCreationInDays + = reader.getNullable(JsonReader::getInt); + } else if ("timestamp".equals(fieldName)) { + deserializedUpdateHistoryProperty.timestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("objectIdentifier".equals(fieldName)) { + deserializedUpdateHistoryProperty.objectIdentifier = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedUpdateHistoryProperty.tenantId = reader.getString(); + } else if ("upn".equals(fieldName)) { + deserializedUpdateHistoryProperty.upn = reader.getString(); + } else if ("allowProtectedAppendWrites".equals(fieldName)) { + deserializedUpdateHistoryProperty.allowProtectedAppendWrites + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowProtectedAppendWritesAll".equals(fieldName)) { + deserializedUpdateHistoryProperty.allowProtectedAppendWritesAll + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedUpdateHistoryProperty; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageListResult.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageListResult.java index b116021d4b2fe..4509f3d48f5a9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageListResult.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.storage.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.storage.fluent.models.UsageInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response from the List Usages operation. */ @Fluent -public final class UsageListResult { +public final class UsageListResult implements JsonSerializable { /* * Gets or sets the list of Storage Resource Usages. */ - @JsonProperty(value = "value") private List value; /** @@ -56,4 +59,41 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageListResult 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 UsageListResult. + */ + public static UsageListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageListResult deserializedUsageListResult = new UsageListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> UsageInner.fromJson(reader1)); + deserializedUsageListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedUsageListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageName.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageName.java index 796d7b0ac6402..2f4849580d686 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageName.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageName.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The usage names that can be used; currently limited to StorageAccount. */ @Immutable -public final class UsageName { +public final class UsageName implements JsonSerializable { /* * Gets a string describing the resource name. */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; /* * Gets a localized string describing the resource name. */ - @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) private String localizedValue; /** @@ -55,4 +57,41 @@ public String localizedValue() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageName from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageName 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 UsageName. + */ + public static UsageName fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageName deserializedUsageName = new UsageName(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedUsageName.value = reader.getString(); + } else if ("localizedValue".equals(fieldName)) { + deserializedUsageName.localizedValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageName; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageUnit.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageUnit.java index 9985c7ef80cf4..03c5a5db1d75e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageUnit.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageUnit.java @@ -4,9 +4,6 @@ package com.azure.resourcemanager.storage.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - /** * Gets the unit of measurement. */ @@ -56,7 +53,6 @@ public enum UsageUnit { * @param value the serialized value to parse. * @return the parsed UsageUnit object, or null if unable to parse. */ - @JsonCreator public static UsageUnit fromString(String value) { if (value == null) { return null; @@ -73,7 +69,6 @@ public static UsageUnit fromString(String value) { /** * {@inheritDoc} */ - @JsonValue @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UserAssignedIdentity.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UserAssignedIdentity.java index 4017f3305ad02..41913c4a7aba5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UserAssignedIdentity.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UserAssignedIdentity.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.storage.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * UserAssignedIdentity for the resource. */ @Immutable -public final class UserAssignedIdentity { +public final class UserAssignedIdentity implements JsonSerializable { /* * The principal ID of the identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private String principalId; /* * The client ID of the identity. */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private String clientId; /** @@ -55,4 +57,41 @@ public String clientId() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/VirtualNetworkRule.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/VirtualNetworkRule.java index b4a95bedd3362..1704f344552fc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/VirtualNetworkRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/VirtualNetworkRule.java @@ -6,31 +6,32 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Virtual Network rule. */ @Fluent -public final class VirtualNetworkRule { +public final class VirtualNetworkRule implements JsonSerializable { /* * Resource ID of a subnet, for example: * /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName} * /subnets/{subnetName}. */ - @JsonProperty(value = "id", required = true) private String virtualNetworkResourceId; /* * The action of virtual network rule. */ - @JsonProperty(value = "action") private Action action; /* * Gets the state of virtual network rule. */ - @JsonProperty(value = "state") private State state; /** @@ -115,4 +116,47 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.virtualNetworkResourceId); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkRule 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 VirtualNetworkRule. + */ + public static VirtualNetworkRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkRule deserializedVirtualNetworkRule = new VirtualNetworkRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualNetworkRule.virtualNetworkResourceId = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedVirtualNetworkRule.action = Action.fromString(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedVirtualNetworkRule.state = State.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage/proxy-config.json b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage/proxy-config.json index d52d9e8e88f44..7e3bc84f4ddf3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage/proxy-config.json +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage/proxy-config.json @@ -1 +1 @@ -[ [ "com.azure.resourcemanager.storage.implementation.BlobContainersClientImpl$BlobContainersService" ], [ "com.azure.resourcemanager.storage.implementation.BlobInventoryPoliciesClientImpl$BlobInventoryPoliciesService" ], [ "com.azure.resourcemanager.storage.implementation.BlobServicesClientImpl$BlobServicesService" ], [ "com.azure.resourcemanager.storage.implementation.DeletedAccountsClientImpl$DeletedAccountsService" ], [ "com.azure.resourcemanager.storage.implementation.EncryptionScopesClientImpl$EncryptionScopesService" ], [ "com.azure.resourcemanager.storage.implementation.FileServicesClientImpl$FileServicesService" ], [ "com.azure.resourcemanager.storage.implementation.FileSharesClientImpl$FileSharesService" ], [ "com.azure.resourcemanager.storage.implementation.LocalUsersOperationsClientImpl$LocalUsersOperationsService" ], [ "com.azure.resourcemanager.storage.implementation.ManagementPoliciesClientImpl$ManagementPoliciesService" ], [ "com.azure.resourcemanager.storage.implementation.NetworkSecurityPerimeterConfigurationsClientImpl$NetworkSecurityPerimeterConfigurationsService" ], [ "com.azure.resourcemanager.storage.implementation.ObjectReplicationPoliciesOperationsClientImpl$ObjectReplicationPoliciesOperationsService" ], [ "com.azure.resourcemanager.storage.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.storage.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService" ], [ "com.azure.resourcemanager.storage.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService" ], [ "com.azure.resourcemanager.storage.implementation.QueueServicesClientImpl$QueueServicesService" ], [ "com.azure.resourcemanager.storage.implementation.QueuesClientImpl$QueuesService" ], [ "com.azure.resourcemanager.storage.implementation.SkusClientImpl$SkusService" ], [ "com.azure.resourcemanager.storage.implementation.StorageAccountsClientImpl$StorageAccountsService" ], [ "com.azure.resourcemanager.storage.implementation.StorageTaskAssignmentInstancesReportsClientImpl$StorageTaskAssignmentInstancesReportsService" ], [ "com.azure.resourcemanager.storage.implementation.StorageTaskAssignmentsClientImpl$StorageTaskAssignmentsService" ], [ "com.azure.resourcemanager.storage.implementation.StorageTaskAssignmentsInstancesReportsClientImpl$StorageTaskAssignmentsInstancesReportsService" ], [ "com.azure.resourcemanager.storage.implementation.TableServicesClientImpl$TableServicesService" ], [ "com.azure.resourcemanager.storage.implementation.TablesClientImpl$TablesService" ], [ "com.azure.resourcemanager.storage.implementation.UsagesClientImpl$UsagesService" ] ] \ No newline at end of file +[["com.azure.resourcemanager.storage.implementation.BlobContainersClientImpl$BlobContainersService"],["com.azure.resourcemanager.storage.implementation.BlobInventoryPoliciesClientImpl$BlobInventoryPoliciesService"],["com.azure.resourcemanager.storage.implementation.BlobServicesClientImpl$BlobServicesService"],["com.azure.resourcemanager.storage.implementation.DeletedAccountsClientImpl$DeletedAccountsService"],["com.azure.resourcemanager.storage.implementation.EncryptionScopesClientImpl$EncryptionScopesService"],["com.azure.resourcemanager.storage.implementation.FileServicesClientImpl$FileServicesService"],["com.azure.resourcemanager.storage.implementation.FileSharesClientImpl$FileSharesService"],["com.azure.resourcemanager.storage.implementation.LocalUsersOperationsClientImpl$LocalUsersOperationsService"],["com.azure.resourcemanager.storage.implementation.ManagementPoliciesClientImpl$ManagementPoliciesService"],["com.azure.resourcemanager.storage.implementation.NetworkSecurityPerimeterConfigurationsClientImpl$NetworkSecurityPerimeterConfigurationsService"],["com.azure.resourcemanager.storage.implementation.ObjectReplicationPoliciesOperationsClientImpl$ObjectReplicationPoliciesOperationsService"],["com.azure.resourcemanager.storage.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.storage.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.storage.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.storage.implementation.QueueServicesClientImpl$QueueServicesService"],["com.azure.resourcemanager.storage.implementation.QueuesClientImpl$QueuesService"],["com.azure.resourcemanager.storage.implementation.SkusClientImpl$SkusService"],["com.azure.resourcemanager.storage.implementation.StorageAccountsClientImpl$StorageAccountsService"],["com.azure.resourcemanager.storage.implementation.StorageTaskAssignmentInstancesReportsClientImpl$StorageTaskAssignmentInstancesReportsService"],["com.azure.resourcemanager.storage.implementation.StorageTaskAssignmentsClientImpl$StorageTaskAssignmentsService"],["com.azure.resourcemanager.storage.implementation.StorageTaskAssignmentsInstancesReportsClientImpl$StorageTaskAssignmentsInstancesReportsService"],["com.azure.resourcemanager.storage.implementation.TableServicesClientImpl$TableServicesService"],["com.azure.resourcemanager.storage.implementation.TablesClientImpl$TablesService"],["com.azure.resourcemanager.storage.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage/reflect-config.json b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage/reflect-config.json index 771a3fd466e04..0637a088a01e8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage/reflect-config.json +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage/reflect-config.json @@ -1,1406 +1 @@ -[ { - "name" : "com.azure.resourcemanager.storage.fluent.models.BlobContainerInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.BlobInventoryPolicyInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.BlobInventoryPolicyProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.BlobRestoreStatusInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.BlobServicePropertiesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.BlobServicePropertiesProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.CheckNameAvailabilityResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ContainerProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.DeletedAccountInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.DeletedAccountProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.EncryptionScopeInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.EncryptionScopeProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.FileServiceItemsInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.FileServicePropertiesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.FileServicePropertiesProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.FileShareInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.FileShareItemInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.FileShareProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyProperty", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.LeaseContainerResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.LeaseShareResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.LegalHoldInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ListAccountSasResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ListContainerItemInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ListQueueInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ListQueueProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ListQueueServicesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ListServiceSasResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ListTableServicesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.LocalUserInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.LocalUserKeysInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.LocalUserProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.LocalUserRegeneratePasswordResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ManagementPolicyInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ManagementPolicyProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.NetworkSecurityPerimeterConfigurationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.NetworkSecurityPerimeterConfigurationProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ObjectReplicationPolicyInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.ObjectReplicationPolicyProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.OperationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.OperationProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.PrivateEndpointConnectionInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.PrivateEndpointConnectionProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.PrivateLinkResourceListResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.PrivateLinkResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.QueueProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.QueueServicePropertiesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.QueueServicePropertiesProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.SkuInformationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.StorageAccountInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.StorageAccountListKeysResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.StorageAccountMigrationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.StorageAccountMigrationProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.StorageAccountPropertiesCreateParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.StorageAccountPropertiesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.StorageAccountPropertiesUpdateParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.StorageQueueInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.StorageTaskAssignmentInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.StorageTaskReportInstanceInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.TableInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.TableProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.TableServicePropertiesInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.TableServicePropertiesProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.fluent.models.UsageInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.AccessPolicy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.AccessTier", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.AccountImmutabilityPolicyProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.AccountImmutabilityPolicyState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.AccountSasParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.AccountStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Action", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ActiveDirectoryProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ActiveDirectoryPropertiesAccountType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.AllowedCopyScope", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.AzureEntityResource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.AzureFilesIdentityBasedAuthentication", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobContainersCreateOrUpdateImmutabilityPolicyHeaders", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobContainersDeleteImmutabilityPolicyHeaders", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobContainersExtendImmutabilityPolicyHeaders", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobContainersGetImmutabilityPolicyHeaders", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobContainersLockImmutabilityPolicyHeaders", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobInventoryCreationTime", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobInventoryPolicyDefinition", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobInventoryPolicyFilter", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobInventoryPolicyName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobInventoryPolicyRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobInventoryPolicySchema", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobRestoreParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobRestoreProgressStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobRestoreRange", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.BlobServiceItems", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Bypass", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ChangeFeed", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.CorsRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.CorsRuleAllowedMethodsItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.CorsRules", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.CustomDomain", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.DateAfterCreation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.DateAfterModification", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.DefaultAction", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.DefaultSharePermission", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.DeleteRetentionPolicy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.DeletedAccountListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.DeletedShare", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Dimension", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.DirectoryServiceOptions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.DnsEndpointType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.EnabledProtocols", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Encryption", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.EncryptionIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.EncryptionScopeKeyVaultProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.EncryptionScopeListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.EncryptionScopeSource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.EncryptionScopeState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.EncryptionService", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.EncryptionServices", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Endpoints", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ExecutionTarget", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ExecutionTrigger", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ExecutionTriggerUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ExpirationAction", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ExtendedLocation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ExtendedLocationTypes", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.FailoverType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.FileShareItems", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.FileSharesLeaseHeaders", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Format", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.GeoReplicationStats", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.GeoReplicationStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.HttpProtocol", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Identity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.IdentityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ImmutabilityPolicyProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ImmutabilityPolicyState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ImmutabilityPolicyUpdateType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ImmutableStorageAccount", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ImmutableStorageWithVersioning", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.IntervalUnit", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.InventoryRuleType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.IpRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.IssueType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.KeyCreationTime", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.KeyPermission", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.KeyPolicy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.KeySource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.KeyType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.KeyVaultProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Kind", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LargeFileSharesState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LastAccessTimeTrackingPolicy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LeaseContainerRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LeaseContainerRequestAction", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LeaseDuration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LeaseShareAction", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LeaseShareRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LeaseState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LeaseStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LegalHoldProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ListBlobInventoryPolicy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ListContainerItems", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ListContainersInclude", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ListEncryptionScopesInclude", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ListKeyExpand", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ListLocalUserIncludeParam", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ListQueueResource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ListTableResource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.LocalUsers", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ManagementPolicyAction", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ManagementPolicyBaseBlob", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ManagementPolicyDefinition", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ManagementPolicyFilter", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ManagementPolicyName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ManagementPolicyRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ManagementPolicySchema", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ManagementPolicySnapShot", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ManagementPolicyVersion", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.MetricSpecification", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.MigrationName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.MigrationState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.MigrationStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.MinimumTlsVersion", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Multichannel", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Name", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.NetworkRuleSet", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.NetworkSecurityPerimeter", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.NetworkSecurityPerimeterConfigurationList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.NetworkSecurityPerimeterConfigurationPropertiesProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.NetworkSecurityPerimeterConfigurationProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.NspAccessRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.NspAccessRuleDirection", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.NspAccessRuleProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.NspAccessRulePropertiesSubscriptionsItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ObjectReplicationPolicies", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ObjectReplicationPolicyFilter", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ObjectReplicationPolicyRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ObjectType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.OperationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PermissionScope", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Permissions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PostFailoverRedundancy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PostPlannedFailoverRedundancy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PrivateEndpoint", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PrivateEndpointConnectionListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PrivateEndpointConnectionProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PrivateEndpointServiceConnectionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PrivateLinkResource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PrivateLinkServiceConnectionState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ProtectedAppendWritesHistory", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ProtocolSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ProvisioningIssue", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ProvisioningIssueProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PublicAccess", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.PublicNetworkAccess", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Reason", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ReasonCode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ResourceAccessRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ResourceAssociationAccessMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.RestorePolicyProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Restriction", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.RootSquashType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.RoutingChoice", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.RoutingPreference", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.RuleType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.RunResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.RunStatusEnum", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.SasPolicy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Schedule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ServiceSasParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ServiceSpecification", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Services", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Severity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.ShareAccessTier", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.SignedIdentifier", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.SignedResource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.SignedResourceTypes", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.Sku", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.SkuCapability", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.SkuConversionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.SkuName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.SkuTier", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.SmbSetting", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.SshPublicKey", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.State", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageAccountCheckNameAvailabilityParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageAccountCreateParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageAccountExpand", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageAccountInternetEndpoints", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageAccountKey", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageAccountListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageAccountMicrosoftEndpoints", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageAccountRegenerateKeyParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageAccountSkuConversionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageAccountUpdateParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageSkuListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageTaskAssignmentExecutionContext", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageTaskAssignmentProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageTaskAssignmentReport", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageTaskAssignmentUpdateExecutionContext", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageTaskAssignmentUpdateParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageTaskAssignmentUpdateProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageTaskAssignmentUpdateReport", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageTaskAssignmentsList", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageTaskReportProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.StorageTaskReportSummary", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.TableAccessPolicy", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.TableSignedIdentifier", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.TagFilter", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.TagProperty", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.TriggerParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.TriggerParametersUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.TriggerType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.UpdateHistoryProperty", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.UsageListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.UsageName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.UsageUnit", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.UserAssignedIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.storage.models.VirtualNetworkRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[] \ No newline at end of file From 86727a90dc3ad82de0c812fee28ec025a6bc5882 Mon Sep 17 00:00:00 2001 From: xiaofeicao Date: Fri, 2 Aug 2024 11:12:29 +0800 Subject: [PATCH 03/19] keyvault regen --- .../fluent/KeyVaultManagementClient.java | 51 +- .../keyvault/fluent/KeysClient.java | 304 ++++ .../keyvault/fluent/ManagedHsmKeysClient.java | 317 ++++ .../keyvault/fluent/ManagedHsmsClient.java | 160 +- .../MhsmPrivateEndpointConnectionsClient.java | 161 +- .../MhsmPrivateLinkResourcesClient.java | 22 +- .../keyvault/fluent/MhsmRegionsClient.java | 10 +- .../keyvault/fluent/OperationsClient.java | 10 +- .../PrivateEndpointConnectionsClient.java | 123 +- .../fluent/PrivateLinkResourcesClient.java | 22 +- .../keyvault/fluent/SecretsClient.java | 285 ++++ .../keyvault/fluent/VaultsClient.java | 190 +-- .../CheckMhsmNameAvailabilityResultInner.java | 69 +- .../CheckNameAvailabilityResultInner.java | 68 +- .../fluent/models/DeletedManagedHsmInner.java | 74 +- .../fluent/models/DeletedVaultInner.java | 74 +- .../keyvault/fluent/models/KeyInner.java | 359 ++++ .../keyvault/fluent/models/KeyProperties.java | 316 ++++ .../fluent/models/ManagedHsmInner.java | 155 +- .../fluent/models/ManagedHsmKeyInner.java | 350 ++++ .../models/ManagedHsmKeyProperties.java | 316 ++++ .../models/MhsmGeoReplicatedRegionInner.java | 73 +- .../MhsmPrivateEndpointConnectionInner.java | 184 +- ...smPrivateEndpointConnectionProperties.java | 89 +- ...hsmPrivateLinkResourceListResultInner.java | 63 +- .../MhsmPrivateLinkResourceProperties.java | 73 +- .../fluent/models/OperationInner.java | 93 +- .../fluent/models/OperationProperties.java | 59 +- .../PrivateEndpointConnectionInner.java | 151 +- .../PrivateEndpointConnectionProperties.java | 88 +- .../PrivateLinkResourceListResultInner.java | 62 +- .../models/PrivateLinkResourceProperties.java | 73 +- .../keyvault/fluent/models/SecretInner.java | 181 ++ .../VaultAccessPolicyParametersInner.java | 122 +- .../keyvault/fluent/models/VaultInner.java | 133 +- .../keyvault/fluent/models/package-info.java | 4 +- .../keyvault/fluent/package-info.java | 4 +- .../KeyVaultManagementClientBuilder.java | 48 +- .../KeyVaultManagementClientImpl.java | 145 +- .../implementation/KeysClientImpl.java | 961 +++++++++++ .../ManagedHsmKeysClientImpl.java | 979 +++++++++++ .../implementation/ManagedHsmsClientImpl.java | 1325 +++++---------- ...mPrivateEndpointConnectionsClientImpl.java | 687 +++----- .../MhsmPrivateLinkResourcesClientImpl.java | 110 +- .../implementation/MhsmRegionsClientImpl.java | 209 +-- .../implementation/OperationsClientImpl.java | 151 +- .../PrivateEndpointConnectionsClientImpl.java | 638 +++---- .../PrivateLinkResourcesClientImpl.java | 110 +- .../implementation/SecretsClientImpl.java | 782 +++++++++ .../implementation/VaultsClientImpl.java | 1486 ++++++----------- .../keyvault/models/AccessPolicyEntry.java | 98 +- .../models/AccessPolicyUpdateKind.java | 31 +- .../keyvault/models/Action.java | 93 ++ .../keyvault/models/ActionsRequired.java | 16 +- .../keyvault/models/ActivationStatus.java | 28 +- .../keyvault/models/Attributes.java | 234 +++ .../models/CertificatePermissions.java | 80 +- .../CheckMhsmNameAvailabilityParameters.java | 69 +- .../keyvault/models/CreateMode.java | 27 +- .../models/DeletedManagedHsmListResult.java | 69 +- .../models/DeletedManagedHsmProperties.java | 88 +- .../models/DeletedVaultListResult.java | 68 +- .../models/DeletedVaultProperties.java | 88 +- .../models/DeletionRecoveryLevel.java | 64 + .../keyvault/models/DimensionProperties.java | 75 +- .../keyvault/models/Error.java | 160 +- .../keyvault/models/ErrorException.java | 12 +- ...GeoReplicationRegionProvisioningState.java | 36 +- .../keyvault/models/IpRule.java | 63 +- .../keyvault/models/JsonWebKeyCurveName.java | 61 + .../keyvault/models/JsonWebKeyOperation.java | 81 + .../keyvault/models/JsonWebKeyType.java | 61 + .../keyvault/models/KeyAttributes.java | 229 +++ .../keyvault/models/KeyCreateParameters.java | 134 ++ .../keyvault/models/KeyListResult.java | 127 ++ .../keyvault/models/KeyPermissions.java | 96 +- .../keyvault/models/KeyReleasePolicy.java | 134 ++ .../models/KeyRotationPolicyActionType.java | 56 + .../models/KeyRotationPolicyAttributes.java | 127 ++ .../keyvault/models/LifetimeAction.java | 127 ++ .../keyvault/models/LogSpecification.java | 75 +- .../keyvault/models/ManagedHsmAction.java | 93 ++ .../models/ManagedHsmKeyAttributes.java | 230 +++ .../models/ManagedHsmKeyCreateParameters.java | 136 ++ .../models/ManagedHsmKeyListResult.java | 127 ++ .../models/ManagedHsmKeyReleasePolicy.java | 134 ++ ...ManagedHsmKeyRotationPolicyAttributes.java | 129 ++ .../models/ManagedHsmLifetimeAction.java | 127 ++ .../keyvault/models/ManagedHsmListResult.java | 68 +- .../keyvault/models/ManagedHsmProperties.java | 167 +- .../keyvault/models/ManagedHsmResource.java | 147 +- .../models/ManagedHsmRotationPolicy.java | 132 ++ .../ManagedHsmSecurityDomainProperties.java | 63 +- .../keyvault/models/ManagedHsmSku.java | 78 +- .../keyvault/models/ManagedHsmSkuFamily.java | 16 +- .../keyvault/models/ManagedHsmSkuName.java | 31 +- .../keyvault/models/ManagedHsmTrigger.java | 127 ++ .../models/ManagedServiceIdentity.java | 111 +- .../models/ManagedServiceIdentityType.java | 32 +- .../keyvault/models/MetricSpecification.java | 145 +- .../keyvault/models/MhsmNetworkRuleSet.java | 91 +- .../keyvault/models/MhsmPrivateEndpoint.java | 56 +- .../MhsmPrivateEndpointConnectionItem.java | 95 +- ...mPrivateEndpointConnectionsListResult.java | 71 +- ...mPrivateEndpointConnectionsPutHeaders.java | 19 +- ...PrivateEndpointConnectionsPutResponse.java | 16 +- .../models/MhsmPrivateLinkResource.java | 162 +- ...MhsmPrivateLinkServiceConnectionState.java | 80 +- .../models/MhsmRegionsListResult.java | 69 +- .../models/MhsmVirtualNetworkRule.java | 65 +- .../keyvault/models/MhsmipRule.java | 65 +- .../keyvault/models/NetworkRuleAction.java | 16 +- .../models/NetworkRuleBypassOptions.java | 16 +- .../keyvault/models/NetworkRuleSet.java | 91 +- .../keyvault/models/OperationDisplay.java | 85 +- .../keyvault/models/OperationListResult.java | 64 +- .../keyvault/models/Permissions.java | 95 +- .../keyvault/models/PrivateEndpoint.java | 56 +- .../models/PrivateEndpointConnectionItem.java | 95 +- .../PrivateEndpointConnectionListResult.java | 71 +- ...teEndpointConnectionProvisioningState.java | 36 +- .../PrivateEndpointConnectionsPutHeaders.java | 19 +- ...PrivateEndpointConnectionsPutResponse.java | 16 +- ...rivateEndpointServiceConnectionStatus.java | 28 +- .../keyvault/models/PrivateLinkResource.java | 129 +- .../PrivateLinkServiceConnectionState.java | 79 +- .../keyvault/models/ProvisioningState.java | 44 +- .../ProxyResourceWithoutSystemData.java | 150 ++ .../keyvault/models/PublicNetworkAccess.java | 20 +- .../keyvault/models/Reason.java | 27 +- .../keyvault/models/ResourceListResult.java | 68 +- .../keyvault/models/RotationPolicy.java | 131 ++ .../keyvault/models/SecretAttributes.java | 157 ++ .../SecretCreateOrUpdateParameters.java | 135 ++ .../keyvault/models/SecretListResult.java | 127 ++ .../models/SecretPatchParameters.java | 126 ++ .../models/SecretPatchProperties.java | 152 ++ .../keyvault/models/SecretPermissions.java | 48 +- .../keyvault/models/SecretProperties.java | 190 +++ .../keyvault/models/ServiceSpecification.java | 73 +- .../resourcemanager/keyvault/models/Sku.java | 74 +- .../keyvault/models/SkuFamily.java | 16 +- .../keyvault/models/SkuName.java | 27 +- .../keyvault/models/StoragePermissions.java | 72 +- .../keyvault/models/Trigger.java | 127 ++ .../keyvault/models/UserAssignedIdentity.java | 63 +- .../models/VaultAccessPolicyProperties.java | 70 +- .../VaultCheckNameAvailabilityParameters.java | 76 +- .../models/VaultCreateOrUpdateParameters.java | 94 +- .../keyvault/models/VaultListResult.java | 68 +- .../keyvault/models/VaultPatchParameters.java | 70 +- .../keyvault/models/VaultPatchProperties.java | 166 +- .../keyvault/models/VaultProperties.java | 221 ++- .../models/VaultProvisioningState.java | 20 +- .../keyvault/models/VirtualNetworkRule.java | 74 +- .../keyvault/models/package-info.java | 4 +- .../keyvault/package-info.java | 4 +- .../proxy-config.json | 2 +- .../reflect-config.json | 452 +---- .../KeysCreateIfNotExistSamples.java | 33 + .../keyvault/generated/KeysGetSamples.java | 27 + .../generated/KeysGetVersionSamples.java | 28 + .../keyvault/generated/KeysListSamples.java | 27 + .../generated/KeysListVersionsSamples.java | 27 + ...ManagedHsmKeysCreateIfNotExistSamples.java | 34 + .../generated/ManagedHsmKeysGetSamples.java | 28 + .../ManagedHsmKeysGetVersionSamples.java | 29 + .../generated/ManagedHsmKeysListSamples.java | 27 + .../ManagedHsmKeysListVersionsSamples.java | 29 + ...dHsmsCheckMhsmNameAvailabilitySamples.java | 16 +- .../ManagedHsmsCreateOrUpdateSamples.java | 27 +- .../generated/ManagedHsmsDeleteSamples.java | 12 +- .../ManagedHsmsGetByResourceGroupSamples.java | 12 +- .../ManagedHsmsGetDeletedSamples.java | 12 +- ...ManagedHsmsListByResourceGroupSamples.java | 12 +- .../ManagedHsmsListDeletedSamples.java | 13 +- .../generated/ManagedHsmsListSamples.java | 9 +- .../ManagedHsmsPurgeDeletedSamples.java | 13 +- .../generated/ManagedHsmsUpdateSamples.java | 16 +- ...ivateEndpointConnectionsDeleteSamples.java | 12 +- ...mPrivateEndpointConnectionsGetSamples.java | 12 +- ...pointConnectionsListByResourceSamples.java | 12 +- ...mPrivateEndpointConnectionsPutSamples.java | 24 +- ...inkResourcesListByMhsmResourceSamples.java | 12 +- .../MhsmRegionsListByResourceSamples.java | 12 +- .../generated/OperationsListSamples.java | 9 +- ...ivateEndpointConnectionsDeleteSamples.java | 12 +- .../PrivateEndpointConnectionsGetSamples.java | 12 +- ...pointConnectionsListByResourceSamples.java | 12 +- .../PrivateEndpointConnectionsPutSamples.java | 27 +- ...rivateLinkResourcesListByVaultSamples.java | 13 +- .../SecretsCreateOrUpdateSamples.java | 32 + .../keyvault/generated/SecretsGetSamples.java | 27 + .../generated/SecretsListSamples.java | 27 + .../generated/SecretsUpdateSamples.java | 32 + .../VaultsCheckNameAvailabilitySamples.java | 17 +- .../VaultsCreateOrUpdateSamples.java | 157 +- .../generated/VaultsDeleteSamples.java | 12 +- .../VaultsGetByResourceGroupSamples.java | 12 +- .../generated/VaultsGetDeletedSamples.java | 12 +- .../VaultsListByResourceGroupSamples.java | 13 +- .../VaultsListBySubscriptionSamples.java | 10 +- .../generated/VaultsListDeletedSamples.java | 13 +- .../keyvault/generated/VaultsListSamples.java | 9 +- .../generated/VaultsPurgeDeletedSamples.java | 12 +- .../VaultsUpdateAccessPolicySamples.java | 37 +- .../generated/VaultsUpdateSamples.java | 105 +- 207 files changed, 17549 insertions(+), 5730 deletions(-) create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeysClient.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/ManagedHsmKeysClient.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/SecretsClient.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/KeyInner.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/KeyProperties.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmKeyInner.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmKeyProperties.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/SecretInner.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeysClientImpl.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/ManagedHsmKeysClientImpl.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/SecretsClientImpl.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Action.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Attributes.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletionRecoveryLevel.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyCurveName.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyOperation.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyType.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyAttributes.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyCreateParameters.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyListResult.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyReleasePolicy.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyRotationPolicyActionType.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyRotationPolicyAttributes.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LifetimeAction.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmAction.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyAttributes.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyCreateParameters.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyListResult.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyReleasePolicy.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyRotationPolicyAttributes.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmLifetimeAction.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmRotationPolicy.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmTrigger.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ProxyResourceWithoutSystemData.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/RotationPolicy.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretAttributes.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretCreateOrUpdateParameters.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretListResult.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPatchParameters.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPatchProperties.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretProperties.java create mode 100644 sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Trigger.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysCreateIfNotExistSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysGetSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysGetVersionSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysListSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysListVersionsSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysCreateIfNotExistSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysGetSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysGetVersionSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysListSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysListVersionsSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsCreateOrUpdateSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsGetSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsListSamples.java create mode 100644 sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsUpdateSamples.java diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeyVaultManagementClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeyVaultManagementClient.java index 727ecaa8c913e..db184ede44fc3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeyVaultManagementClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeyVaultManagementClient.java @@ -7,97 +7,120 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for KeyVaultManagementClient class. */ +/** + * The interface for KeyVaultManagementClient class. + */ public interface KeyVaultManagementClient { /** * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms * part of the URI for every service call. - * + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); + /** + * Gets the KeysClient object to access its operations. + * + * @return the KeysClient object. + */ + KeysClient getKeys(); + + /** + * Gets the ManagedHsmKeysClient object to access its operations. + * + * @return the ManagedHsmKeysClient object. + */ + ManagedHsmKeysClient getManagedHsmKeys(); + /** * Gets the VaultsClient object to access its operations. - * + * * @return the VaultsClient object. */ VaultsClient getVaults(); /** * Gets the PrivateEndpointConnectionsClient object to access its operations. - * + * * @return the PrivateEndpointConnectionsClient object. */ PrivateEndpointConnectionsClient getPrivateEndpointConnections(); /** * Gets the PrivateLinkResourcesClient object to access its operations. - * + * * @return the PrivateLinkResourcesClient object. */ PrivateLinkResourcesClient getPrivateLinkResources(); /** * Gets the ManagedHsmsClient object to access its operations. - * + * * @return the ManagedHsmsClient object. */ ManagedHsmsClient getManagedHsms(); /** * Gets the MhsmPrivateEndpointConnectionsClient object to access its operations. - * + * * @return the MhsmPrivateEndpointConnectionsClient object. */ MhsmPrivateEndpointConnectionsClient getMhsmPrivateEndpointConnections(); /** * Gets the MhsmPrivateLinkResourcesClient object to access its operations. - * + * * @return the MhsmPrivateLinkResourcesClient object. */ MhsmPrivateLinkResourcesClient getMhsmPrivateLinkResources(); /** * Gets the MhsmRegionsClient object to access its operations. - * + * * @return the MhsmRegionsClient object. */ MhsmRegionsClient getMhsmRegions(); /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); + + /** + * Gets the SecretsClient object to access its operations. + * + * @return the SecretsClient object. + */ + SecretsClient getSecrets(); } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeysClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeysClient.java new file mode 100644 index 0000000000000..a2fb16d6f6d50 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/KeysClient.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.fluent.models.KeyInner; +import com.azure.resourcemanager.keyvault.models.KeyCreateParameters; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in KeysClient. + */ +public interface KeysClient { + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createIfNotExistWithResponseAsync(String resourceGroupName, String vaultName, + String keyName, KeyCreateParameters parameters); + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createIfNotExistAsync(String resourceGroupName, String vaultName, String keyName, + KeyCreateParameters parameters); + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createIfNotExistWithResponse(String resourceGroupName, String vaultName, String keyName, + KeyCreateParameters parameters, Context context); + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KeyInner createIfNotExist(String resourceGroupName, String vaultName, String keyName, + KeyCreateParameters parameters); + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String vaultName, String keyName); + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String vaultName, String keyName); + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, String keyName, Context context); + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KeyInner get(String resourceGroupName, String vaultName, String keyName); + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String vaultName); + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getVersionWithResponseAsync(String resourceGroupName, String vaultName, String keyName, + String keyVersion); + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getVersionAsync(String resourceGroupName, String vaultName, String keyName, String keyVersion); + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVersionWithResponse(String resourceGroupName, String vaultName, String keyName, + String keyVersion, Context context); + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KeyInner getVersion(String resourceGroupName, String vaultName, String keyName, String keyVersion); + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listVersionsAsync(String resourceGroupName, String vaultName, String keyName); + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String resourceGroupName, String vaultName, String keyName); + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String resourceGroupName, String vaultName, String keyName, Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/ManagedHsmKeysClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/ManagedHsmKeysClient.java new file mode 100644 index 0000000000000..5abfdc2a711de --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/ManagedHsmKeysClient.java @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.fluent.models.ManagedHsmKeyInner; +import com.azure.resourcemanager.keyvault.models.ManagedHsmKeyCreateParameters; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ManagedHsmKeysClient. + */ +public interface ManagedHsmKeysClient { + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createIfNotExistWithResponseAsync(String resourceGroupName, String name, + String keyName, ManagedHsmKeyCreateParameters parameters); + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createIfNotExistAsync(String resourceGroupName, String name, String keyName, + ManagedHsmKeyCreateParameters parameters); + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createIfNotExistWithResponse(String resourceGroupName, String name, String keyName, + ManagedHsmKeyCreateParameters parameters, Context context); + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedHsmKeyInner createIfNotExist(String resourceGroupName, String name, String keyName, + ManagedHsmKeyCreateParameters parameters); + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified managed HSM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String name, String keyName); + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified managed HSM on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String name, String keyName); + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified managed HSM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String name, String keyName, + Context context); + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedHsmKeyInner get(String resourceGroupName, String name, String keyName); + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String name); + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String name); + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String name, Context context); + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified managed HSM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getVersionWithResponseAsync(String resourceGroupName, String name, + String keyName, String keyVersion); + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified managed HSM on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getVersionAsync(String resourceGroupName, String name, String keyName, String keyVersion); + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param keyVersion The version of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified managed HSM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getVersionWithResponse(String resourceGroupName, String name, String keyName, + String keyVersion, Context context); + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedHsmKeyInner getVersion(String resourceGroupName, String name, String keyName, String keyVersion); + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listVersionsAsync(String resourceGroupName, String name, String keyName); + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String resourceGroupName, String name, String keyName); + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listVersions(String resourceGroupName, String name, String keyName, + Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/ManagedHsmsClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/ManagedHsmsClient.java index 3cb5e1a2cee0e..9dfd9aa97cc00 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/ManagedHsmsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/ManagedHsmsClient.java @@ -24,28 +24,30 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ManagedHsmsClient. */ +/** + * An instance of this class provides access to all the operations defined in ManagedHsmsClient. + */ public interface ManagedHsmsClient extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, ManagedHsmInner parameters); + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String name, + ManagedHsmInner parameters); /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -55,12 +57,12 @@ Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ManagedHsmInner> beginCreateOrUpdateAsync( - String resourceGroupName, String name, ManagedHsmInner parameters); + PollerFlux, ManagedHsmInner> beginCreateOrUpdateAsync(String resourceGroupName, + String name, ManagedHsmInner parameters); /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -70,12 +72,12 @@ PollerFlux, ManagedHsmInner> beginCreateOrUpdateAsyn * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedHsmInner> beginCreateOrUpdate( - String resourceGroupName, String name, ManagedHsmInner parameters); + SyncPoller, ManagedHsmInner> beginCreateOrUpdate(String resourceGroupName, String name, + ManagedHsmInner parameters); /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -86,12 +88,12 @@ SyncPoller, ManagedHsmInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedHsmInner> beginCreateOrUpdate( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context); + SyncPoller, ManagedHsmInner> beginCreateOrUpdate(String resourceGroupName, String name, + ManagedHsmInner parameters, Context context); /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -105,7 +107,7 @@ SyncPoller, ManagedHsmInner> beginCreateOrUpdate( /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -119,7 +121,7 @@ SyncPoller, ManagedHsmInner> beginCreateOrUpdate( /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -134,23 +136,23 @@ SyncPoller, ManagedHsmInner> beginCreateOrUpdate( /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync( - String resourceGroupName, String name, ManagedHsmInner parameters); + Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ManagedHsmInner parameters); /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -160,12 +162,12 @@ Mono>> updateWithResponseAsync( * @return the {@link PollerFlux} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ManagedHsmInner> beginUpdateAsync( - String resourceGroupName, String name, ManagedHsmInner parameters); + PollerFlux, ManagedHsmInner> beginUpdateAsync(String resourceGroupName, String name, + ManagedHsmInner parameters); /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -175,12 +177,12 @@ PollerFlux, ManagedHsmInner> beginUpdateAsync( * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedHsmInner> beginUpdate( - String resourceGroupName, String name, ManagedHsmInner parameters); + SyncPoller, ManagedHsmInner> beginUpdate(String resourceGroupName, String name, + ManagedHsmInner parameters); /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -191,12 +193,12 @@ SyncPoller, ManagedHsmInner> beginUpdate( * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedHsmInner> beginUpdate( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context); + SyncPoller, ManagedHsmInner> beginUpdate(String resourceGroupName, String name, + ManagedHsmInner parameters, Context context); /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -210,7 +212,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -224,7 +226,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -239,7 +241,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -252,7 +254,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -265,7 +267,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -278,7 +280,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @param context The context to associate with this operation. @@ -292,7 +294,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -305,7 +307,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -317,7 +319,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @param context The context to associate with this operation. @@ -330,7 +332,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Gets the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -343,7 +345,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Gets the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -356,7 +358,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Gets the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -370,7 +372,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Gets the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -384,7 +386,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -398,7 +400,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. @@ -411,7 +413,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. @@ -424,7 +426,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param top Maximum number of results to return. * @param context The context to associate with this operation. @@ -438,7 +440,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. @@ -450,7 +452,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of managed HSM Pools as paginated response with {@link PagedFlux}. @@ -460,7 +462,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of managed HSM Pools as paginated response with {@link PagedIterable}. @@ -470,7 +472,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -483,7 +485,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the deleted managed HSMs associated with the subscription. - * + * * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of deleted managed HSM Pools as paginated response with {@link PagedFlux}. @@ -493,7 +495,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the deleted managed HSMs associated with the subscription. - * + * * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of deleted managed HSM Pools as paginated response with {@link PagedIterable}. @@ -503,7 +505,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * The List operation gets information about the deleted managed HSMs associated with the subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. @@ -515,7 +517,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Gets the specified deleted managed HSM. - * + * * @param name The name of the deleted managed HSM. * @param location The location of the deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -528,7 +530,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Gets the specified deleted managed HSM. - * + * * @param name The name of the deleted managed HSM. * @param location The location of the deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -541,7 +543,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Gets the specified deleted managed HSM. - * + * * @param name The name of the deleted managed HSM. * @param location The location of the deleted managed HSM. * @param context The context to associate with this operation. @@ -555,7 +557,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Gets the specified deleted managed HSM. - * + * * @param name The name of the deleted managed HSM. * @param location The location of the deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -568,7 +570,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -581,7 +583,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -594,7 +596,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -607,7 +609,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @param context The context to associate with this operation. @@ -621,7 +623,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -634,7 +636,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -646,7 +648,7 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @param context The context to associate with this operation. @@ -659,21 +661,21 @@ SyncPoller, ManagedHsmInner> beginUpdate( /** * Checks that the managed hsm name is valid and is not already in use. - * + * * @param mhsmName The name of the managed hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the CheckMhsmNameAvailability operation response along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkMhsmNameAvailabilityWithResponseAsync( - CheckMhsmNameAvailabilityParameters mhsmName); + Mono> + checkMhsmNameAvailabilityWithResponseAsync(CheckMhsmNameAvailabilityParameters mhsmName); /** * Checks that the managed hsm name is valid and is not already in use. - * + * * @param mhsmName The name of the managed hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -681,12 +683,12 @@ Mono> checkMhsmNameAvailabilityWi * @return the CheckMhsmNameAvailability operation response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkMhsmNameAvailabilityAsync( - CheckMhsmNameAvailabilityParameters mhsmName); + Mono + checkMhsmNameAvailabilityAsync(CheckMhsmNameAvailabilityParameters mhsmName); /** * Checks that the managed hsm name is valid and is not already in use. - * + * * @param mhsmName The name of the managed hsm. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -695,12 +697,12 @@ Mono checkMhsmNameAvailabilityAsync( * @return the CheckMhsmNameAvailability operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkMhsmNameAvailabilityWithResponse( - CheckMhsmNameAvailabilityParameters mhsmName, Context context); + Response + checkMhsmNameAvailabilityWithResponse(CheckMhsmNameAvailabilityParameters mhsmName, Context context); /** * Checks that the managed hsm name is valid and is not already in use. - * + * * @param mhsmName The name of the managed hsm. * @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-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmPrivateEndpointConnectionsClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmPrivateEndpointConnectionsClient.java index f1005f941a90f..7956a4cd6ed0d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmPrivateEndpointConnectionsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmPrivateEndpointConnectionsClient.java @@ -19,39 +19,41 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MhsmPrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in MhsmPrivateEndpointConnectionsClient. + */ public interface MhsmPrivateEndpointConnectionsClient { /** * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listByResourceAsync(String resourceGroupName, String name); /** * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResource(String resourceGroupName, String name); /** * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -59,71 +61,71 @@ public interface MhsmPrivateEndpointConnectionsClient { * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResource( - String resourceGroupName, String name, Context context); + PagedIterable listByResource(String resourceGroupName, String name, + Context context); /** * Gets the specified private endpoint connection associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the managed HSM Pool along with {@link - * Response} on successful completion of {@link Mono}. + * @return the specified private endpoint connection associated with the managed HSM Pool along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String name, String privateEndpointConnectionName); + Mono> getWithResponseAsync(String resourceGroupName, String name, + String privateEndpointConnectionName); /** * Gets the specified private endpoint connection associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the managed HSM Pool on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String name, String privateEndpointConnectionName); + Mono getAsync(String resourceGroupName, String name, + String privateEndpointConnectionName); /** * Gets the specified private endpoint connection associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the managed HSM Pool along with {@link - * Response}. + * @return the specified private endpoint connection associated with the managed HSM Pool along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context); + Response getWithResponse(String resourceGroupName, String name, + String privateEndpointConnectionName, Context context); /** * Gets the specified private endpoint connection associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.keyvault.models.ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -134,11 +136,11 @@ Response getWithResponse( /** * Updates the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param properties The intended state of private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -146,19 +148,16 @@ Response getWithResponse( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono putWithResponseAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - MhsmPrivateEndpointConnectionInner properties); + Mono putWithResponseAsync(String resourceGroupName, String name, + String privateEndpointConnectionName, MhsmPrivateEndpointConnectionInner properties); /** * Updates the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param properties The intended state of private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -166,19 +165,16 @@ Mono putWithResponseAsync( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono putAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - MhsmPrivateEndpointConnectionInner properties); + Mono putAsync(String resourceGroupName, String name, + String privateEndpointConnectionName, MhsmPrivateEndpointConnectionInner properties); /** * Updates the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param properties The intended state of private endpoint connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -187,20 +183,16 @@ Mono putAsync( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - MhsmPrivateEndpointConnectionsPutResponse putWithResponse( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - MhsmPrivateEndpointConnectionInner properties, - Context context); + MhsmPrivateEndpointConnectionsPutResponse putWithResponse(String resourceGroupName, String name, + String privateEndpointConnectionName, MhsmPrivateEndpointConnectionInner properties, Context context); /** * Updates the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param properties The intended state of private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -208,68 +200,65 @@ MhsmPrivateEndpointConnectionsPutResponse putWithResponse( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - MhsmPrivateEndpointConnectionInner put( - String resourceGroupName, - String name, - String privateEndpointConnectionName, + MhsmPrivateEndpointConnectionInner put(String resourceGroupName, String name, String privateEndpointConnectionName, MhsmPrivateEndpointConnectionInner properties); /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String name, String privateEndpointConnectionName); + Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, MhsmPrivateEndpointConnectionInner> beginDeleteAsync( - String resourceGroupName, String name, String privateEndpointConnectionName); + PollerFlux, MhsmPrivateEndpointConnectionInner> + beginDeleteAsync(String resourceGroupName, String name, String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MhsmPrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String name, String privateEndpointConnectionName); + SyncPoller, MhsmPrivateEndpointConnectionInner> + beginDelete(String resourceGroupName, String name, String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @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. @@ -277,48 +266,48 @@ SyncPoller, MhsmPrivateEndpointCo * @return the {@link SyncPoller} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MhsmPrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context); + SyncPoller, MhsmPrivateEndpointConnectionInner> + beginDelete(String resourceGroupName, String name, String privateEndpointConnectionName, Context context); /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, String name, String privateEndpointConnectionName); + Mono deleteAsync(String resourceGroupName, String name, + String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - MhsmPrivateEndpointConnectionInner delete( - String resourceGroupName, String name, String privateEndpointConnectionName); + MhsmPrivateEndpointConnectionInner delete(String resourceGroupName, String name, + String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @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. @@ -326,6 +315,6 @@ MhsmPrivateEndpointConnectionInner delete( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - MhsmPrivateEndpointConnectionInner delete( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context); + MhsmPrivateEndpointConnectionInner delete(String resourceGroupName, String name, + String privateEndpointConnectionName, Context context); } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmPrivateLinkResourcesClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmPrivateLinkResourcesClient.java index 09dc356fde71d..8a594c4f7fab9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmPrivateLinkResourcesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmPrivateLinkResourcesClient.java @@ -11,26 +11,28 @@ import com.azure.resourcemanager.keyvault.fluent.models.MhsmPrivateLinkResourceListResultInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MhsmPrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in MhsmPrivateLinkResourcesClient. + */ public interface MhsmPrivateLinkResourcesClient { /** * Gets the private link resources supported for the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources supported for the managed hsm pool along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listByMhsmResourceWithResponseAsync( - String resourceGroupName, String name); + Mono> listByMhsmResourceWithResponseAsync(String resourceGroupName, + String name); /** * Gets the private link resources supported for the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -43,7 +45,7 @@ Mono> listByMhsmResourceWithRes /** * Gets the private link resources supported for the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -53,12 +55,12 @@ Mono> listByMhsmResourceWithRes * @return the private link resources supported for the managed hsm pool along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listByMhsmResourceWithResponse( - String resourceGroupName, String name, Context context); + Response listByMhsmResourceWithResponse(String resourceGroupName, + String name, Context context); /** * Gets the private link resources supported for the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmRegionsClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmRegionsClient.java index 41cb3123963ad..8e26b25484f77 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmRegionsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/MhsmRegionsClient.java @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.keyvault.fluent.models.MhsmGeoReplicatedRegionInner; -/** An instance of this class provides access to all the operations defined in MhsmRegionsClient. */ +/** + * An instance of this class provides access to all the operations defined in MhsmRegionsClient. + */ public interface MhsmRegionsClient { /** * The List operation gets information about the regions associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -28,7 +30,7 @@ public interface MhsmRegionsClient { /** * The List operation gets information about the regions associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -41,7 +43,7 @@ public interface MhsmRegionsClient { /** * The List operation gets information about the regions associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/OperationsClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/OperationsClient.java index f1914490c0f79..e0141febf1ed2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/OperationsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/OperationsClient.java @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.keyvault.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * Lists all of the available Key Vault Rest API operations. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list Storage operations as paginated response with {@link PagedFlux}. @@ -25,7 +27,7 @@ public interface OperationsClient { /** * Lists all of the available Key Vault Rest API operations. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. @@ -35,7 +37,7 @@ public interface OperationsClient { /** * Lists all of the available Key Vault Rest API operations. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateEndpointConnectionsClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateEndpointConnectionsClient.java index 5ab8f7f6b1305..90dcfac99ffb4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateEndpointConnectionsClient.java @@ -19,11 +19,13 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ public interface PrivateEndpointConnectionsClient { /** * Gets the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -31,15 +33,15 @@ public interface PrivateEndpointConnectionsClient { * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the key vault along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); + Mono> getWithResponseAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName); /** * Gets the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -47,15 +49,15 @@ Mono> getWithResponseAsync( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the key vault on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); + Mono getAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName); /** * Gets the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -66,12 +68,12 @@ Mono getAsync( * @return the specified private endpoint connection associated with the key vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); + Response getWithResponse(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, Context context); /** * Gets the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -81,12 +83,12 @@ Response getWithResponse( * @return the specified private endpoint connection associated with the key vault. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); + PrivateEndpointConnectionInner get(String resourceGroupName, String vaultName, + String privateEndpointConnectionName); /** * Updates the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -97,15 +99,12 @@ PrivateEndpointConnectionInner get( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono putWithResponseAsync( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); + Mono putWithResponseAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties); /** * Updates the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -116,15 +115,12 @@ Mono putWithResponseAsync( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono putAsync( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); + Mono putAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties); /** * Updates the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -136,16 +132,12 @@ Mono putAsync( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionsPutResponse putWithResponse( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context); + PrivateEndpointConnectionsPutResponse putWithResponse(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context); /** * Updates the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -156,31 +148,28 @@ PrivateEndpointConnectionsPutResponse putWithResponse( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner put( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, + PrivateEndpointConnectionInner put(String resourceGroupName, String vaultName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties); /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); + Mono>> deleteWithResponseAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -190,12 +179,12 @@ Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, PrivateEndpointConnectionInner> beginDeleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); + PollerFlux, PrivateEndpointConnectionInner> + beginDeleteAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -205,12 +194,12 @@ PollerFlux, PrivateEndpointConnection * @return the {@link SyncPoller} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); + SyncPoller, PrivateEndpointConnectionInner> + beginDelete(String resourceGroupName, String vaultName, String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -221,12 +210,12 @@ SyncPoller, PrivateEndpointConnection * @return the {@link SyncPoller} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); + SyncPoller, PrivateEndpointConnectionInner> + beginDelete(String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -236,12 +225,12 @@ SyncPoller, PrivateEndpointConnection * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); + Mono deleteAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -251,12 +240,12 @@ Mono deleteAsync( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner delete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName); + PrivateEndpointConnectionInner delete(String resourceGroupName, String vaultName, + String privateEndpointConnectionName); /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -267,12 +256,12 @@ PrivateEndpointConnectionInner delete( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner delete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context); + PrivateEndpointConnectionInner delete(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, Context context); /** * The List operation gets information about the private endpoint connections associated with the vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -285,7 +274,7 @@ PrivateEndpointConnectionInner delete( /** * The List operation gets information about the private endpoint connections associated with the vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -298,7 +287,7 @@ PrivateEndpointConnectionInner delete( /** * The List operation gets information about the private endpoint connections associated with the vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param context The context to associate with this operation. @@ -308,6 +297,6 @@ PrivateEndpointConnectionInner delete( * @return list of private endpoint connections as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResource( - String resourceGroupName, String vaultName, Context context); + PagedIterable listByResource(String resourceGroupName, String vaultName, + Context context); } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateLinkResourcesClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateLinkResourcesClient.java index aafa6a11d234a..5c57db511172f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateLinkResourcesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/PrivateLinkResourcesClient.java @@ -11,26 +11,28 @@ import com.azure.resourcemanager.keyvault.fluent.models.PrivateLinkResourceListResultInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ public interface PrivateLinkResourcesClient { /** * Gets the private link resources supported for the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources supported for the key vault along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> listByVaultWithResponseAsync( - String resourceGroupName, String vaultName); + Mono> listByVaultWithResponseAsync(String resourceGroupName, + String vaultName); /** * Gets the private link resources supported for the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -43,7 +45,7 @@ Mono> listByVaultWithResponseAsync( /** * Gets the private link resources supported for the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param context The context to associate with this operation. @@ -53,12 +55,12 @@ Mono> listByVaultWithResponseAsync( * @return the private link resources supported for the key vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listByVaultWithResponse( - String resourceGroupName, String vaultName, Context context); + Response listByVaultWithResponse(String resourceGroupName, String vaultName, + Context context); /** * Gets the private link resources supported for the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/SecretsClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/SecretsClient.java new file mode 100644 index 0000000000000..434cbff08f721 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/SecretsClient.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.keyvault.fluent.models.SecretInner; +import com.azure.resourcemanager.keyvault.models.SecretCreateOrUpdateParameters; +import com.azure.resourcemanager.keyvault.models.SecretPatchParameters; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SecretsClient. + */ +public interface SecretsClient { + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal + * use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @param parameters Parameters to create or update the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String vaultName, + String secretName, SecretCreateOrUpdateParameters parameters); + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal + * use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @param parameters Parameters to create or update the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String vaultName, String secretName, + SecretCreateOrUpdateParameters parameters); + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal + * use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @param parameters Parameters to create or update the secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String vaultName, String secretName, + SecretCreateOrUpdateParameters parameters, Context context); + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal + * use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @param parameters Parameters to create or update the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner createOrUpdate(String resourceGroupName, String vaultName, String secretName, + SecretCreateOrUpdateParameters parameters); + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. + * Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. + * @param parameters Parameters to patch the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateWithResponseAsync(String resourceGroupName, String vaultName, String secretName, + SecretPatchParameters parameters); + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. + * Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. + * @param parameters Parameters to patch the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String vaultName, String secretName, + SecretPatchParameters parameters); + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. + * Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. + * @param parameters Parameters to patch the secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String vaultName, String secretName, + SecretPatchParameters parameters, Context context); + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. + * Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. + * @param parameters Parameters to patch the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner update(String resourceGroupName, String vaultName, String secretName, SecretPatchParameters parameters); + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the + * data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String vaultName, String secretName); + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the + * data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String vaultName, String secretName); + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the + * data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, String secretName, + Context context); + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the + * data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SecretInner get(String resourceGroupName, String vaultName, String secretName); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String vaultName, Integer top); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String vaultName); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Integer top, Context context); +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/VaultsClient.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/VaultsClient.java index 5c806493dbdbb..f477e8af55517 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/VaultsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/VaultsClient.java @@ -28,27 +28,29 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in VaultsClient. */ +/** + * An instance of this class provides access to all the operations defined in VaultsClient. + */ public interface VaultsClient extends InnerSupportsGet, InnerSupportsDelete { /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters); /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -58,12 +60,12 @@ Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, VaultInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); + PollerFlux, VaultInner> beginCreateOrUpdateAsync(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters); /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -73,12 +75,12 @@ PollerFlux, VaultInner> beginCreateOrUpdateAsync( * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VaultInner> beginCreateOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); + SyncPoller, VaultInner> beginCreateOrUpdate(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters); /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -89,12 +91,12 @@ SyncPoller, VaultInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, VaultInner> beginCreateOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context); + SyncPoller, VaultInner> beginCreateOrUpdate(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters, Context context); /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -104,12 +106,12 @@ SyncPoller, VaultInner> beginCreateOrUpdate( * @return resource information with extended details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters); + Mono createOrUpdateAsync(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters); /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -123,7 +125,7 @@ Mono createOrUpdateAsync( /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -134,28 +136,28 @@ Mono createOrUpdateAsync( * @return resource information with extended details. */ @ServiceMethod(returns = ReturnType.SINGLE) - VaultInner createOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context); + VaultInner createOrUpdate(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, + Context context); /** * Update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to patch the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String resourceGroupName, String vaultName, VaultPatchParameters parameters); + Mono> updateWithResponseAsync(String resourceGroupName, String vaultName, + VaultPatchParameters parameters); /** * Update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to patch the vault. @@ -169,7 +171,7 @@ Mono> updateWithResponseAsync( /** * Update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to patch the vault. @@ -180,12 +182,12 @@ Mono> updateWithResponseAsync( * @return resource information with extended details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String vaultName, VaultPatchParameters parameters, Context context); + Response updateWithResponse(String resourceGroupName, String vaultName, VaultPatchParameters parameters, + Context context); /** * Update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to patch the vault. @@ -199,7 +201,7 @@ Response updateWithResponse( /** * Deletes the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -212,7 +214,7 @@ Response updateWithResponse( /** * Deletes the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -225,7 +227,7 @@ Response updateWithResponse( /** * Deletes the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault to delete. * @param context The context to associate with this operation. @@ -239,7 +241,7 @@ Response updateWithResponse( /** * Deletes the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -251,7 +253,7 @@ Response updateWithResponse( /** * Gets the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -264,7 +266,7 @@ Response updateWithResponse( /** * Gets the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -277,7 +279,7 @@ Response updateWithResponse( /** * Gets the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault. * @param context The context to associate with this operation. @@ -291,7 +293,7 @@ Response updateWithResponse( /** * Gets the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -304,7 +306,7 @@ Response updateWithResponse( /** * Update access policies in a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault. * @param operationKind Name of the operation. @@ -313,18 +315,15 @@ Response updateWithResponse( * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return parameters for updating the access policy in a vault along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateAccessPolicyWithResponseAsync( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyParametersInner parameters); + Mono> updateAccessPolicyWithResponseAsync(String resourceGroupName, + String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyParametersInner parameters); /** * Update access policies in a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault. * @param operationKind Name of the operation. @@ -335,15 +334,12 @@ Mono> updateAccessPolicyWithResponseA * @return parameters for updating the access policy in a vault on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAccessPolicyAsync( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyParametersInner parameters); + Mono updateAccessPolicyAsync(String resourceGroupName, String vaultName, + AccessPolicyUpdateKind operationKind, VaultAccessPolicyParametersInner parameters); /** * Update access policies in a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault. * @param operationKind Name of the operation. @@ -355,16 +351,13 @@ Mono updateAccessPolicyAsync( * @return parameters for updating the access policy in a vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateAccessPolicyWithResponse( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyParametersInner parameters, + Response updateAccessPolicyWithResponse(String resourceGroupName, + String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyParametersInner parameters, Context context); /** * Update access policies in a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault. * @param operationKind Name of the operation. @@ -375,16 +368,13 @@ Response updateAccessPolicyWithResponse( * @return parameters for updating the access policy in a vault. */ @ServiceMethod(returns = ReturnType.SINGLE) - VaultAccessPolicyParametersInner updateAccessPolicy( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyParametersInner parameters); + VaultAccessPolicyParametersInner updateAccessPolicy(String resourceGroupName, String vaultName, + AccessPolicyUpdateKind operationKind, VaultAccessPolicyParametersInner parameters); /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -398,7 +388,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -411,7 +401,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -424,7 +414,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param top Maximum number of results to return. * @param context The context to associate with this operation. @@ -438,7 +428,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -450,7 +440,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of vaults as paginated response with {@link PagedFlux}. @@ -460,7 +450,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of vaults as paginated response with {@link PagedIterable}. @@ -470,7 +460,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -483,7 +473,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Gets information about the deleted vaults in a subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the deleted vaults in a subscription as paginated response with {@link PagedFlux}. @@ -493,7 +483,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Gets information about the deleted vaults in a subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the deleted vaults in a subscription as paginated response with {@link PagedIterable}. @@ -503,7 +493,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Gets information about the deleted vaults in a subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -515,7 +505,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Gets the deleted Azure key vault. - * + * * @param vaultName The name of the vault. * @param location The location of the deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -528,7 +518,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Gets the deleted Azure key vault. - * + * * @param vaultName The name of the vault. * @param location The location of the deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -541,7 +531,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Gets the deleted Azure key vault. - * + * * @param vaultName The name of the vault. * @param location The location of the deleted vault. * @param context The context to associate with this operation. @@ -555,7 +545,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Gets the deleted Azure key vault. - * + * * @param vaultName The name of the vault. * @param location The location of the deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -568,7 +558,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -581,7 +571,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -594,7 +584,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -607,7 +597,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @param context The context to associate with this operation. @@ -621,7 +611,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -634,7 +624,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -646,7 +636,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @param context The context to associate with this operation. @@ -659,7 +649,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -671,7 +661,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of vault resources as paginated response with {@link PagedFlux}. @@ -681,7 +671,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of vault resources as paginated response with {@link PagedIterable}. @@ -691,7 +681,7 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -704,21 +694,21 @@ VaultAccessPolicyParametersInner updateAccessPolicy( /** * Checks that the vault name is valid and is not already in use. - * + * * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the CheckNameAvailability operation response along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkNameAvailabilityWithResponseAsync( - VaultCheckNameAvailabilityParameters vaultName); + Mono> + checkNameAvailabilityWithResponseAsync(VaultCheckNameAvailabilityParameters vaultName); /** * Checks that the vault name is valid and is not already in use. - * + * * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -730,7 +720,7 @@ Mono> checkNameAvailabilityWithRespon /** * Checks that the vault name is valid and is not already in use. - * + * * @param vaultName The name of the vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -739,12 +729,12 @@ Mono> checkNameAvailabilityWithRespon * @return the CheckNameAvailability operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - VaultCheckNameAvailabilityParameters vaultName, Context context); + Response + checkNameAvailabilityWithResponse(VaultCheckNameAvailabilityParameters vaultName, Context context); /** * Checks that the vault name is valid and is not already in use. - * + * * @param vaultName The name of the vault. * @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-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckMhsmNameAvailabilityResultInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckMhsmNameAvailabilityResultInner.java index 71115cf9dcc5d..60614bda366b3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckMhsmNameAvailabilityResultInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckMhsmNameAvailabilityResultInner.java @@ -5,40 +5,46 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.Reason; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The CheckMhsmNameAvailability operation response. */ +/** + * The CheckMhsmNameAvailability operation response. + */ @Immutable -public final class CheckMhsmNameAvailabilityResultInner { +public final class CheckMhsmNameAvailabilityResultInner + implements JsonSerializable { /* * A boolean value that indicates whether the name is available for you to use. If true, the name is available. If * false, the name has already been taken or is invalid and cannot be used. */ - @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) private Boolean nameAvailable; /* * The reason that a managed hsm name could not be used. The reason element is only returned if NameAvailable is * false. */ - @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) private Reason reason; /* * An error message explaining the Reason value in more detail. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; - /** Creates an instance of CheckMhsmNameAvailabilityResultInner class. */ + /** + * Creates an instance of CheckMhsmNameAvailabilityResultInner class. + */ public CheckMhsmNameAvailabilityResultInner() { } /** * Get the nameAvailable property: A boolean value that indicates whether the name is available for you to use. If * true, the name is available. If false, the name has already been taken or is invalid and cannot be used. - * + * * @return the nameAvailable value. */ public Boolean nameAvailable() { @@ -48,7 +54,7 @@ public Boolean nameAvailable() { /** * Get the reason property: The reason that a managed hsm name could not be used. The reason element is only * returned if NameAvailable is false. - * + * * @return the reason value. */ public Reason reason() { @@ -57,7 +63,7 @@ public Reason reason() { /** * Get the message property: An error message explaining the Reason value in more detail. - * + * * @return the message value. */ public String message() { @@ -66,9 +72,50 @@ public String message() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckMhsmNameAvailabilityResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckMhsmNameAvailabilityResultInner 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 CheckMhsmNameAvailabilityResultInner. + */ + public static CheckMhsmNameAvailabilityResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckMhsmNameAvailabilityResultInner deserializedCheckMhsmNameAvailabilityResultInner + = new CheckMhsmNameAvailabilityResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckMhsmNameAvailabilityResultInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckMhsmNameAvailabilityResultInner.reason = Reason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedCheckMhsmNameAvailabilityResultInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckMhsmNameAvailabilityResultInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckNameAvailabilityResultInner.java index 1ad888c3b92c2..30d89e369d022 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckNameAvailabilityResultInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/CheckNameAvailabilityResultInner.java @@ -5,39 +5,44 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.Reason; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The CheckNameAvailability operation response. */ +/** + * The CheckNameAvailability operation response. + */ @Immutable -public final class CheckNameAvailabilityResultInner { +public final class CheckNameAvailabilityResultInner implements JsonSerializable { /* * A boolean value that indicates whether the name is available for you to use. If true, the name is available. If * false, the name has already been taken or is invalid and cannot be used. */ - @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) private Boolean nameAvailable; /* * The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. */ - @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) private Reason reason; /* * An error message explaining the Reason value in more detail. */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; - /** Creates an instance of CheckNameAvailabilityResultInner class. */ + /** + * Creates an instance of CheckNameAvailabilityResultInner class. + */ public CheckNameAvailabilityResultInner() { } /** * Get the nameAvailable property: A boolean value that indicates whether the name is available for you to use. If * true, the name is available. If false, the name has already been taken or is invalid and cannot be used. - * + * * @return the nameAvailable value. */ public Boolean nameAvailable() { @@ -47,7 +52,7 @@ public Boolean nameAvailable() { /** * Get the reason property: The reason that a vault name could not be used. The Reason element is only returned if * NameAvailable is false. - * + * * @return the reason value. */ public Reason reason() { @@ -56,7 +61,7 @@ public Reason reason() { /** * Get the message property: An error message explaining the Reason value in more detail. - * + * * @return the message value. */ public String message() { @@ -65,9 +70,50 @@ public String message() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityResultInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityResultInner. + */ + public static CheckNameAvailabilityResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityResultInner deserializedCheckNameAvailabilityResultInner + = new CheckNameAvailabilityResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.reason = Reason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedCheckNameAvailabilityResultInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityResultInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedManagedHsmInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedManagedHsmInner.java index 4ebb47a2dea63..2ac22141e538b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedManagedHsmInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedManagedHsmInner.java @@ -5,43 +5,47 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.DeletedManagedHsmProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** The DeletedManagedHsm model. */ +/** + * The DeletedManagedHsm model. + */ @Fluent -public final class DeletedManagedHsmInner { +public final class DeletedManagedHsmInner implements JsonSerializable { /* * The Azure Resource Manager resource ID for the deleted managed HSM Pool. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The name of the managed HSM Pool. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The resource type of the managed HSM Pool. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * Properties of the deleted managed HSM */ - @JsonProperty(value = "properties") private DeletedManagedHsmProperties properties; - /** Creates an instance of DeletedManagedHsmInner class. */ + /** + * Creates an instance of DeletedManagedHsmInner class. + */ public DeletedManagedHsmInner() { } /** * Get the id property: The Azure Resource Manager resource ID for the deleted managed HSM Pool. - * + * * @return the id value. */ public String id() { @@ -50,7 +54,7 @@ public String id() { /** * Get the name property: The name of the managed HSM Pool. - * + * * @return the name value. */ public String name() { @@ -59,7 +63,7 @@ public String name() { /** * Get the type property: The resource type of the managed HSM Pool. - * + * * @return the type value. */ public String type() { @@ -68,7 +72,7 @@ public String type() { /** * Get the properties property: Properties of the deleted managed HSM. - * + * * @return the properties value. */ public DeletedManagedHsmProperties properties() { @@ -77,7 +81,7 @@ public DeletedManagedHsmProperties properties() { /** * Set the properties property: Properties of the deleted managed HSM. - * + * * @param properties the properties value to set. * @return the DeletedManagedHsmInner object itself. */ @@ -88,7 +92,7 @@ public DeletedManagedHsmInner withProperties(DeletedManagedHsmProperties propert /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -96,4 +100,46 @@ 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 DeletedManagedHsmInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedManagedHsmInner 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 DeletedManagedHsmInner. + */ + public static DeletedManagedHsmInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedManagedHsmInner deserializedDeletedManagedHsmInner = new DeletedManagedHsmInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDeletedManagedHsmInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDeletedManagedHsmInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDeletedManagedHsmInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeletedManagedHsmInner.properties = DeletedManagedHsmProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedManagedHsmInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedVaultInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedVaultInner.java index 84631f849f4a8..07f1c53503837 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedVaultInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/DeletedVaultInner.java @@ -5,43 +5,47 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.DeletedVaultProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Deleted vault information with extended details. */ +/** + * Deleted vault information with extended details. + */ @Fluent -public final class DeletedVaultInner { +public final class DeletedVaultInner implements JsonSerializable { /* * The resource ID for the deleted key vault. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The name of the key vault. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The resource type of the key vault. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * Properties of the vault */ - @JsonProperty(value = "properties") private DeletedVaultProperties properties; - /** Creates an instance of DeletedVaultInner class. */ + /** + * Creates an instance of DeletedVaultInner class. + */ public DeletedVaultInner() { } /** * Get the id property: The resource ID for the deleted key vault. - * + * * @return the id value. */ public String id() { @@ -50,7 +54,7 @@ public String id() { /** * Get the name property: The name of the key vault. - * + * * @return the name value. */ public String name() { @@ -59,7 +63,7 @@ public String name() { /** * Get the type property: The resource type of the key vault. - * + * * @return the type value. */ public String type() { @@ -68,7 +72,7 @@ public String type() { /** * Get the properties property: Properties of the vault. - * + * * @return the properties value. */ public DeletedVaultProperties properties() { @@ -77,7 +81,7 @@ public DeletedVaultProperties properties() { /** * Set the properties property: Properties of the vault. - * + * * @param properties the properties value to set. * @return the DeletedVaultInner object itself. */ @@ -88,7 +92,7 @@ public DeletedVaultInner withProperties(DeletedVaultProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -96,4 +100,46 @@ 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 DeletedVaultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedVaultInner 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 DeletedVaultInner. + */ + public static DeletedVaultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedVaultInner deserializedDeletedVaultInner = new DeletedVaultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDeletedVaultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDeletedVaultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDeletedVaultInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeletedVaultInner.properties = DeletedVaultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedVaultInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/KeyInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/KeyInner.java new file mode 100644 index 0000000000000..197bd061449f4 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/KeyInner.java @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +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.keyvault.models.JsonWebKeyCurveName; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyOperation; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyType; +import com.azure.resourcemanager.keyvault.models.KeyAttributes; +import com.azure.resourcemanager.keyvault.models.KeyReleasePolicy; +import com.azure.resourcemanager.keyvault.models.RotationPolicy; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The key resource. + */ +@Fluent +public final class KeyInner extends Resource { + /* + * The properties of the key. + */ + private KeyProperties innerProperties = new KeyProperties(); + + /* + * 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 KeyInner class. + */ + public KeyInner() { + } + + /** + * Get the innerProperties property: The properties of the key. + * + * @return the innerProperties value. + */ + private KeyProperties 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; + } + + /** + * {@inheritDoc} + */ + @Override + public KeyInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public KeyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the attributes property: The attributes of the key. + * + * @return the attributes value. + */ + public KeyAttributes attributes() { + return this.innerProperties() == null ? null : this.innerProperties().attributes(); + } + + /** + * Set the attributes property: The attributes of the key. + * + * @param attributes the attributes value to set. + * @return the KeyInner object itself. + */ + public KeyInner withAttributes(KeyAttributes attributes) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withAttributes(attributes); + return this; + } + + /** + * Get the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @return the kty value. + */ + public JsonWebKeyType kty() { + return this.innerProperties() == null ? null : this.innerProperties().kty(); + } + + /** + * Set the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @param kty the kty value to set. + * @return the KeyInner object itself. + */ + public KeyInner withKty(JsonWebKeyType kty) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withKty(kty); + return this; + } + + /** + * Get the keyOps property: The keyOps property. + * + * @return the keyOps value. + */ + public List keyOps() { + return this.innerProperties() == null ? null : this.innerProperties().keyOps(); + } + + /** + * Set the keyOps property: The keyOps property. + * + * @param keyOps the keyOps value to set. + * @return the KeyInner object itself. + */ + public KeyInner withKeyOps(List keyOps) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withKeyOps(keyOps); + return this; + } + + /** + * Get the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @return the keySize value. + */ + public Integer keySize() { + return this.innerProperties() == null ? null : this.innerProperties().keySize(); + } + + /** + * Set the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param keySize the keySize value to set. + * @return the KeyInner object itself. + */ + public KeyInner withKeySize(Integer keySize) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withKeySize(keySize); + return this; + } + + /** + * Get the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @return the curveName value. + */ + public JsonWebKeyCurveName curveName() { + return this.innerProperties() == null ? null : this.innerProperties().curveName(); + } + + /** + * Set the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @param curveName the curveName value to set. + * @return the KeyInner object itself. + */ + public KeyInner withCurveName(JsonWebKeyCurveName curveName) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withCurveName(curveName); + return this; + } + + /** + * Get the keyUri property: The URI to retrieve the current version of the key. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.innerProperties() == null ? null : this.innerProperties().keyUri(); + } + + /** + * Get the keyUriWithVersion property: The URI to retrieve the specific version of the key. + * + * @return the keyUriWithVersion value. + */ + public String keyUriWithVersion() { + return this.innerProperties() == null ? null : this.innerProperties().keyUriWithVersion(); + } + + /** + * Get the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the rotationPolicy value. + */ + public RotationPolicy rotationPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().rotationPolicy(); + } + + /** + * Set the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param rotationPolicy the rotationPolicy value to set. + * @return the KeyInner object itself. + */ + public KeyInner withRotationPolicy(RotationPolicy rotationPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withRotationPolicy(rotationPolicy); + return this; + } + + /** + * Get the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the releasePolicy value. + */ + public KeyReleasePolicy releasePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().releasePolicy(); + } + + /** + * Set the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param releasePolicy the releasePolicy value to set. + * @return the KeyInner object itself. + */ + public KeyInner withReleasePolicy(KeyReleasePolicy releasePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new KeyProperties(); + } + this.innerProperties().withReleasePolicy(releasePolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property innerProperties in model KeyInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyInner.class); + + /** + * {@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.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyInner 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 KeyInner. + */ + public static KeyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyInner deserializedKeyInner = new KeyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedKeyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedKeyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedKeyInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedKeyInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKeyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedKeyInner.innerProperties = KeyProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyInner; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/KeyProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/KeyProperties.java new file mode 100644 index 0000000000000..30894ffb3689d --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/KeyProperties.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.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.keyvault.models.JsonWebKeyCurveName; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyOperation; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyType; +import com.azure.resourcemanager.keyvault.models.KeyAttributes; +import com.azure.resourcemanager.keyvault.models.KeyReleasePolicy; +import com.azure.resourcemanager.keyvault.models.RotationPolicy; +import java.io.IOException; +import java.util.List; + +/** + * The properties of the key. + */ +@Fluent +public final class KeyProperties implements JsonSerializable { + /* + * The attributes of the key. + */ + private KeyAttributes attributes; + + /* + * The type of the key. For valid values, see JsonWebKeyType. + */ + private JsonWebKeyType kty; + + /* + * The keyOps property. + */ + private List keyOps; + + /* + * The key size in bits. For example: 2048, 3072, or 4096 for RSA. + */ + private Integer keySize; + + /* + * The elliptic curve name. For valid values, see JsonWebKeyCurveName. + */ + private JsonWebKeyCurveName curveName; + + /* + * The URI to retrieve the current version of the key. + */ + private String keyUri; + + /* + * The URI to retrieve the specific version of the key. + */ + private String keyUriWithVersion; + + /* + * Key rotation policy in response. It will be used for both output and input. Omitted if empty + */ + private RotationPolicy rotationPolicy; + + /* + * Key release policy in response. It will be used for both output and input. Omitted if empty + */ + private KeyReleasePolicy releasePolicy; + + /** + * Creates an instance of KeyProperties class. + */ + public KeyProperties() { + } + + /** + * Get the attributes property: The attributes of the key. + * + * @return the attributes value. + */ + public KeyAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: The attributes of the key. + * + * @param attributes the attributes value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withAttributes(KeyAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @return the kty value. + */ + public JsonWebKeyType kty() { + return this.kty; + } + + /** + * Set the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @param kty the kty value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withKty(JsonWebKeyType kty) { + this.kty = kty; + return this; + } + + /** + * Get the keyOps property: The keyOps property. + * + * @return the keyOps value. + */ + public List keyOps() { + return this.keyOps; + } + + /** + * Set the keyOps property: The keyOps property. + * + * @param keyOps the keyOps value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withKeyOps(List keyOps) { + this.keyOps = keyOps; + return this; + } + + /** + * Get the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @return the keySize value. + */ + public Integer keySize() { + return this.keySize; + } + + /** + * Set the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param keySize the keySize value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withKeySize(Integer keySize) { + this.keySize = keySize; + return this; + } + + /** + * Get the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @return the curveName value. + */ + public JsonWebKeyCurveName curveName() { + return this.curveName; + } + + /** + * Set the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @param curveName the curveName value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withCurveName(JsonWebKeyCurveName curveName) { + this.curveName = curveName; + return this; + } + + /** + * Get the keyUri property: The URI to retrieve the current version of the key. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Get the keyUriWithVersion property: The URI to retrieve the specific version of the key. + * + * @return the keyUriWithVersion value. + */ + public String keyUriWithVersion() { + return this.keyUriWithVersion; + } + + /** + * Get the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the rotationPolicy value. + */ + public RotationPolicy rotationPolicy() { + return this.rotationPolicy; + } + + /** + * Set the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param rotationPolicy the rotationPolicy value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withRotationPolicy(RotationPolicy rotationPolicy) { + this.rotationPolicy = rotationPolicy; + return this; + } + + /** + * Get the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the releasePolicy value. + */ + public KeyReleasePolicy releasePolicy() { + return this.releasePolicy; + } + + /** + * Set the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param releasePolicy the releasePolicy value to set. + * @return the KeyProperties object itself. + */ + public KeyProperties withReleasePolicy(KeyReleasePolicy releasePolicy) { + this.releasePolicy = releasePolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributes() != null) { + attributes().validate(); + } + if (rotationPolicy() != null) { + rotationPolicy().validate(); + } + if (releasePolicy() != null) { + releasePolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("attributes", this.attributes); + jsonWriter.writeStringField("kty", this.kty == null ? null : this.kty.toString()); + jsonWriter.writeArrayField("keyOps", this.keyOps, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeNumberField("keySize", this.keySize); + jsonWriter.writeStringField("curveName", this.curveName == null ? null : this.curveName.toString()); + jsonWriter.writeJsonField("rotationPolicy", this.rotationPolicy); + jsonWriter.writeJsonField("release_policy", this.releasePolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyProperties 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 KeyProperties. + */ + public static KeyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyProperties deserializedKeyProperties = new KeyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributes".equals(fieldName)) { + deserializedKeyProperties.attributes = KeyAttributes.fromJson(reader); + } else if ("kty".equals(fieldName)) { + deserializedKeyProperties.kty = JsonWebKeyType.fromString(reader.getString()); + } else if ("keyOps".equals(fieldName)) { + List keyOps + = reader.readArray(reader1 -> JsonWebKeyOperation.fromString(reader1.getString())); + deserializedKeyProperties.keyOps = keyOps; + } else if ("keySize".equals(fieldName)) { + deserializedKeyProperties.keySize = reader.getNullable(JsonReader::getInt); + } else if ("curveName".equals(fieldName)) { + deserializedKeyProperties.curveName = JsonWebKeyCurveName.fromString(reader.getString()); + } else if ("keyUri".equals(fieldName)) { + deserializedKeyProperties.keyUri = reader.getString(); + } else if ("keyUriWithVersion".equals(fieldName)) { + deserializedKeyProperties.keyUriWithVersion = reader.getString(); + } else if ("rotationPolicy".equals(fieldName)) { + deserializedKeyProperties.rotationPolicy = RotationPolicy.fromJson(reader); + } else if ("release_policy".equals(fieldName)) { + deserializedKeyProperties.releasePolicy = KeyReleasePolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyProperties; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmInner.java index 463ea9b697af6..451ec9768b701 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmInner.java @@ -5,29 +5,56 @@ package com.azure.resourcemanager.keyvault.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.keyvault.models.ManagedHsmProperties; import com.azure.resourcemanager.keyvault.models.ManagedHsmResource; import com.azure.resourcemanager.keyvault.models.ManagedHsmSku; import com.azure.resourcemanager.keyvault.models.ManagedServiceIdentity; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Resource information with extended details. */ +/** + * Resource information with extended details. + */ @Fluent public final class ManagedHsmInner extends ManagedHsmResource { /* * Properties of the managed HSM */ - @JsonProperty(value = "properties") private ManagedHsmProperties properties; - /** Creates an instance of ManagedHsmInner class. */ + /* + * 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; + + /* + * Metadata pertaining to creation and last modification of the key vault resource. + */ + private SystemData systemData; + + /** + * Creates an instance of ManagedHsmInner class. + */ public ManagedHsmInner() { } /** * Get the properties property: Properties of the managed HSM. - * + * * @return the properties value. */ public ManagedHsmProperties properties() { @@ -36,7 +63,7 @@ public ManagedHsmProperties properties() { /** * Set the properties property: Properties of the managed HSM. - * + * * @param properties the properties value to set. * @return the ManagedHsmInner object itself. */ @@ -45,28 +72,76 @@ public ManagedHsmInner withProperties(ManagedHsmProperties properties) { return this; } - /** {@inheritDoc} */ + /** + * 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: Metadata pertaining to creation and last modification of the key vault resource. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * {@inheritDoc} + */ @Override public ManagedHsmInner withSku(ManagedHsmSku sku) { super.withSku(sku); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedHsmInner withIdentity(ManagedServiceIdentity identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedHsmInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedHsmInner withTags(Map tags) { super.withTags(tags); @@ -75,7 +150,7 @@ public ManagedHsmInner withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -85,4 +160,62 @@ 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("sku", sku()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmInner 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 ManagedHsmInner. + */ + public static ManagedHsmInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmInner deserializedManagedHsmInner = new ManagedHsmInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedHsmInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedHsmInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedHsmInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedManagedHsmInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedHsmInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedManagedHsmInner.withSku(ManagedHsmSku.fromJson(reader)); + } else if ("systemData".equals(fieldName)) { + deserializedManagedHsmInner.systemData = SystemData.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedManagedHsmInner.withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedManagedHsmInner.properties = ManagedHsmProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmKeyInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmKeyInner.java new file mode 100644 index 0000000000000..4af87e1c0ffda --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmKeyInner.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyCurveName; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyOperation; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyType; +import com.azure.resourcemanager.keyvault.models.ManagedHsmKeyAttributes; +import com.azure.resourcemanager.keyvault.models.ManagedHsmKeyReleasePolicy; +import com.azure.resourcemanager.keyvault.models.ManagedHsmRotationPolicy; +import com.azure.resourcemanager.keyvault.models.ProxyResourceWithoutSystemData; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The key resource. + */ +@Fluent +public final class ManagedHsmKeyInner extends ProxyResourceWithoutSystemData { + /* + * The properties of the key. + */ + private ManagedHsmKeyProperties innerProperties = new ManagedHsmKeyProperties(); + + /* + * 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 ManagedHsmKeyInner class. + */ + public ManagedHsmKeyInner() { + } + + /** + * Get the innerProperties property: The properties of the key. + * + * @return the innerProperties value. + */ + private ManagedHsmKeyProperties 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; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedHsmKeyInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the attributes property: The attributes of the key. + * + * @return the attributes value. + */ + public ManagedHsmKeyAttributes attributes() { + return this.innerProperties() == null ? null : this.innerProperties().attributes(); + } + + /** + * Set the attributes property: The attributes of the key. + * + * @param attributes the attributes value to set. + * @return the ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withAttributes(ManagedHsmKeyAttributes attributes) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + this.innerProperties().withAttributes(attributes); + return this; + } + + /** + * Get the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @return the kty value. + */ + public JsonWebKeyType kty() { + return this.innerProperties() == null ? null : this.innerProperties().kty(); + } + + /** + * Set the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @param kty the kty value to set. + * @return the ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withKty(JsonWebKeyType kty) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + this.innerProperties().withKty(kty); + return this; + } + + /** + * Get the keyOps property: The keyOps property. + * + * @return the keyOps value. + */ + public List keyOps() { + return this.innerProperties() == null ? null : this.innerProperties().keyOps(); + } + + /** + * Set the keyOps property: The keyOps property. + * + * @param keyOps the keyOps value to set. + * @return the ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withKeyOps(List keyOps) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + this.innerProperties().withKeyOps(keyOps); + return this; + } + + /** + * Get the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @return the keySize value. + */ + public Integer keySize() { + return this.innerProperties() == null ? null : this.innerProperties().keySize(); + } + + /** + * Set the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param keySize the keySize value to set. + * @return the ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withKeySize(Integer keySize) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + this.innerProperties().withKeySize(keySize); + return this; + } + + /** + * Get the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @return the curveName value. + */ + public JsonWebKeyCurveName curveName() { + return this.innerProperties() == null ? null : this.innerProperties().curveName(); + } + + /** + * Set the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @param curveName the curveName value to set. + * @return the ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withCurveName(JsonWebKeyCurveName curveName) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + this.innerProperties().withCurveName(curveName); + return this; + } + + /** + * Get the keyUri property: The URI to retrieve the current version of the key. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.innerProperties() == null ? null : this.innerProperties().keyUri(); + } + + /** + * Get the keyUriWithVersion property: The URI to retrieve the specific version of the key. + * + * @return the keyUriWithVersion value. + */ + public String keyUriWithVersion() { + return this.innerProperties() == null ? null : this.innerProperties().keyUriWithVersion(); + } + + /** + * Get the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the rotationPolicy value. + */ + public ManagedHsmRotationPolicy rotationPolicy() { + return this.innerProperties() == null ? null : this.innerProperties().rotationPolicy(); + } + + /** + * Set the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param rotationPolicy the rotationPolicy value to set. + * @return the ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withRotationPolicy(ManagedHsmRotationPolicy rotationPolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + this.innerProperties().withRotationPolicy(rotationPolicy); + return this; + } + + /** + * Get the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the releasePolicy value. + */ + public ManagedHsmKeyReleasePolicy releasePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().releasePolicy(); + } + + /** + * Set the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param releasePolicy the releasePolicy value to set. + * @return the ManagedHsmKeyInner object itself. + */ + public ManagedHsmKeyInner withReleasePolicy(ManagedHsmKeyReleasePolicy releasePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedHsmKeyProperties(); + } + this.innerProperties().withReleasePolicy(releasePolicy); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ManagedHsmKeyInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedHsmKeyInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmKeyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmKeyInner 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 ManagedHsmKeyInner. + */ + public static ManagedHsmKeyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmKeyInner deserializedManagedHsmKeyInner = new ManagedHsmKeyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedHsmKeyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedHsmKeyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedHsmKeyInner.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedHsmKeyInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedManagedHsmKeyInner.innerProperties = ManagedHsmKeyProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmKeyInner; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmKeyProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmKeyProperties.java new file mode 100644 index 0000000000000..13d1100913772 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/ManagedHsmKeyProperties.java @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.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.keyvault.models.JsonWebKeyCurveName; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyOperation; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyType; +import com.azure.resourcemanager.keyvault.models.ManagedHsmKeyAttributes; +import com.azure.resourcemanager.keyvault.models.ManagedHsmKeyReleasePolicy; +import com.azure.resourcemanager.keyvault.models.ManagedHsmRotationPolicy; +import java.io.IOException; +import java.util.List; + +/** + * The properties of the key. + */ +@Fluent +public final class ManagedHsmKeyProperties implements JsonSerializable { + /* + * The attributes of the key. + */ + private ManagedHsmKeyAttributes attributes; + + /* + * The type of the key. For valid values, see JsonWebKeyType. + */ + private JsonWebKeyType kty; + + /* + * The keyOps property. + */ + private List keyOps; + + /* + * The key size in bits. For example: 2048, 3072, or 4096 for RSA. + */ + private Integer keySize; + + /* + * The elliptic curve name. For valid values, see JsonWebKeyCurveName. + */ + private JsonWebKeyCurveName curveName; + + /* + * The URI to retrieve the current version of the key. + */ + private String keyUri; + + /* + * The URI to retrieve the specific version of the key. + */ + private String keyUriWithVersion; + + /* + * Key rotation policy in response. It will be used for both output and input. Omitted if empty + */ + private ManagedHsmRotationPolicy rotationPolicy; + + /* + * Key release policy in response. It will be used for both output and input. Omitted if empty + */ + private ManagedHsmKeyReleasePolicy releasePolicy; + + /** + * Creates an instance of ManagedHsmKeyProperties class. + */ + public ManagedHsmKeyProperties() { + } + + /** + * Get the attributes property: The attributes of the key. + * + * @return the attributes value. + */ + public ManagedHsmKeyAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: The attributes of the key. + * + * @param attributes the attributes value to set. + * @return the ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties withAttributes(ManagedHsmKeyAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @return the kty value. + */ + public JsonWebKeyType kty() { + return this.kty; + } + + /** + * Set the kty property: The type of the key. For valid values, see JsonWebKeyType. + * + * @param kty the kty value to set. + * @return the ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties withKty(JsonWebKeyType kty) { + this.kty = kty; + return this; + } + + /** + * Get the keyOps property: The keyOps property. + * + * @return the keyOps value. + */ + public List keyOps() { + return this.keyOps; + } + + /** + * Set the keyOps property: The keyOps property. + * + * @param keyOps the keyOps value to set. + * @return the ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties withKeyOps(List keyOps) { + this.keyOps = keyOps; + return this; + } + + /** + * Get the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @return the keySize value. + */ + public Integer keySize() { + return this.keySize; + } + + /** + * Set the keySize property: The key size in bits. For example: 2048, 3072, or 4096 for RSA. + * + * @param keySize the keySize value to set. + * @return the ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties withKeySize(Integer keySize) { + this.keySize = keySize; + return this; + } + + /** + * Get the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @return the curveName value. + */ + public JsonWebKeyCurveName curveName() { + return this.curveName; + } + + /** + * Set the curveName property: The elliptic curve name. For valid values, see JsonWebKeyCurveName. + * + * @param curveName the curveName value to set. + * @return the ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties withCurveName(JsonWebKeyCurveName curveName) { + this.curveName = curveName; + return this; + } + + /** + * Get the keyUri property: The URI to retrieve the current version of the key. + * + * @return the keyUri value. + */ + public String keyUri() { + return this.keyUri; + } + + /** + * Get the keyUriWithVersion property: The URI to retrieve the specific version of the key. + * + * @return the keyUriWithVersion value. + */ + public String keyUriWithVersion() { + return this.keyUriWithVersion; + } + + /** + * Get the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the rotationPolicy value. + */ + public ManagedHsmRotationPolicy rotationPolicy() { + return this.rotationPolicy; + } + + /** + * Set the rotationPolicy property: Key rotation policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param rotationPolicy the rotationPolicy value to set. + * @return the ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties withRotationPolicy(ManagedHsmRotationPolicy rotationPolicy) { + this.rotationPolicy = rotationPolicy; + return this; + } + + /** + * Get the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @return the releasePolicy value. + */ + public ManagedHsmKeyReleasePolicy releasePolicy() { + return this.releasePolicy; + } + + /** + * Set the releasePolicy property: Key release policy in response. It will be used for both output and input. + * Omitted if empty. + * + * @param releasePolicy the releasePolicy value to set. + * @return the ManagedHsmKeyProperties object itself. + */ + public ManagedHsmKeyProperties withReleasePolicy(ManagedHsmKeyReleasePolicy releasePolicy) { + this.releasePolicy = releasePolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributes() != null) { + attributes().validate(); + } + if (rotationPolicy() != null) { + rotationPolicy().validate(); + } + if (releasePolicy() != null) { + releasePolicy().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("attributes", this.attributes); + jsonWriter.writeStringField("kty", this.kty == null ? null : this.kty.toString()); + jsonWriter.writeArrayField("keyOps", this.keyOps, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeNumberField("keySize", this.keySize); + jsonWriter.writeStringField("curveName", this.curveName == null ? null : this.curveName.toString()); + jsonWriter.writeJsonField("rotationPolicy", this.rotationPolicy); + jsonWriter.writeJsonField("release_policy", this.releasePolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmKeyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmKeyProperties 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 ManagedHsmKeyProperties. + */ + public static ManagedHsmKeyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmKeyProperties deserializedManagedHsmKeyProperties = new ManagedHsmKeyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributes".equals(fieldName)) { + deserializedManagedHsmKeyProperties.attributes = ManagedHsmKeyAttributes.fromJson(reader); + } else if ("kty".equals(fieldName)) { + deserializedManagedHsmKeyProperties.kty = JsonWebKeyType.fromString(reader.getString()); + } else if ("keyOps".equals(fieldName)) { + List keyOps + = reader.readArray(reader1 -> JsonWebKeyOperation.fromString(reader1.getString())); + deserializedManagedHsmKeyProperties.keyOps = keyOps; + } else if ("keySize".equals(fieldName)) { + deserializedManagedHsmKeyProperties.keySize = reader.getNullable(JsonReader::getInt); + } else if ("curveName".equals(fieldName)) { + deserializedManagedHsmKeyProperties.curveName = JsonWebKeyCurveName.fromString(reader.getString()); + } else if ("keyUri".equals(fieldName)) { + deserializedManagedHsmKeyProperties.keyUri = reader.getString(); + } else if ("keyUriWithVersion".equals(fieldName)) { + deserializedManagedHsmKeyProperties.keyUriWithVersion = reader.getString(); + } else if ("rotationPolicy".equals(fieldName)) { + deserializedManagedHsmKeyProperties.rotationPolicy = ManagedHsmRotationPolicy.fromJson(reader); + } else if ("release_policy".equals(fieldName)) { + deserializedManagedHsmKeyProperties.releasePolicy = ManagedHsmKeyReleasePolicy.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmKeyProperties; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmGeoReplicatedRegionInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmGeoReplicatedRegionInner.java index 538ac1664df8f..becd961582246 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmGeoReplicatedRegionInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmGeoReplicatedRegionInner.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.GeoReplicationRegionProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** A region that this managed HSM Pool has been extended to. */ +/** + * A region that this managed HSM Pool has been extended to. + */ @Fluent -public final class MhsmGeoReplicatedRegionInner { +public final class MhsmGeoReplicatedRegionInner implements JsonSerializable { /* * Name of the geo replicated region. */ - @JsonProperty(value = "name") private String name; /* * Provisioning state of the geo replicated region. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private GeoReplicationRegionProvisioningState provisioningState; /* * A boolean value that indicates whether the region is the primary region or a secondary region. */ - @JsonProperty(value = "isPrimary") private Boolean isPrimary; - /** Creates an instance of MhsmGeoReplicatedRegionInner class. */ + /** + * Creates an instance of MhsmGeoReplicatedRegionInner class. + */ public MhsmGeoReplicatedRegionInner() { } /** * Get the name property: Name of the geo replicated region. - * + * * @return the name value. */ public String name() { @@ -44,7 +49,7 @@ public String name() { /** * Set the name property: Name of the geo replicated region. - * + * * @param name the name value to set. * @return the MhsmGeoReplicatedRegionInner object itself. */ @@ -55,7 +60,7 @@ public MhsmGeoReplicatedRegionInner withName(String name) { /** * Get the provisioningState property: Provisioning state of the geo replicated region. - * + * * @return the provisioningState value. */ public GeoReplicationRegionProvisioningState provisioningState() { @@ -65,7 +70,7 @@ public GeoReplicationRegionProvisioningState provisioningState() { /** * Get the isPrimary property: A boolean value that indicates whether the region is the primary region or a * secondary region. - * + * * @return the isPrimary value. */ public Boolean isPrimary() { @@ -75,7 +80,7 @@ public Boolean isPrimary() { /** * Set the isPrimary property: A boolean value that indicates whether the region is the primary region or a * secondary region. - * + * * @param isPrimary the isPrimary value to set. * @return the MhsmGeoReplicatedRegionInner object itself. */ @@ -86,9 +91,51 @@ public MhsmGeoReplicatedRegionInner withIsPrimary(Boolean isPrimary) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("isPrimary", this.isPrimary); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmGeoReplicatedRegionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmGeoReplicatedRegionInner 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 MhsmGeoReplicatedRegionInner. + */ + public static MhsmGeoReplicatedRegionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmGeoReplicatedRegionInner deserializedMhsmGeoReplicatedRegionInner = new MhsmGeoReplicatedRegionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMhsmGeoReplicatedRegionInner.name = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedMhsmGeoReplicatedRegionInner.provisioningState + = GeoReplicationRegionProvisioningState.fromString(reader.getString()); + } else if ("isPrimary".equals(fieldName)) { + deserializedMhsmGeoReplicatedRegionInner.isPrimary = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmGeoReplicatedRegionInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateEndpointConnectionInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateEndpointConnectionInner.java index 1456d0d6ccfb0..1db880774bc25 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateEndpointConnectionInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateEndpointConnectionInner.java @@ -5,37 +5,63 @@ package com.azure.resourcemanager.keyvault.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.keyvault.models.ManagedHsmResource; import com.azure.resourcemanager.keyvault.models.ManagedHsmSku; import com.azure.resourcemanager.keyvault.models.ManagedServiceIdentity; import com.azure.resourcemanager.keyvault.models.MhsmPrivateEndpoint; import com.azure.resourcemanager.keyvault.models.MhsmPrivateLinkServiceConnectionState; import com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Private endpoint connection resource. */ +/** + * Private endpoint connection resource. + */ @Fluent public final class MhsmPrivateEndpointConnectionInner extends ManagedHsmResource { /* * Resource properties. */ - @JsonProperty(value = "properties") private MhsmPrivateEndpointConnectionProperties innerProperties; /* * Modified whenever there is a change in the state of private endpoint connection. */ - @JsonProperty(value = "etag") private String etag; - /** Creates an instance of MhsmPrivateEndpointConnectionInner class. */ + /* + * 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; + + /* + * Metadata pertaining to creation and last modification of the key vault resource. + */ + private SystemData systemData; + + /** + * Creates an instance of MhsmPrivateEndpointConnectionInner class. + */ public MhsmPrivateEndpointConnectionInner() { } /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private MhsmPrivateEndpointConnectionProperties innerProperties() { @@ -44,7 +70,7 @@ private MhsmPrivateEndpointConnectionProperties innerProperties() { /** * Get the etag property: Modified whenever there is a change in the state of private endpoint connection. - * + * * @return the etag value. */ public String etag() { @@ -53,7 +79,7 @@ public String etag() { /** * Set the etag property: Modified whenever there is a change in the state of private endpoint connection. - * + * * @param etag the etag value to set. * @return the MhsmPrivateEndpointConnectionInner object itself. */ @@ -62,28 +88,76 @@ public MhsmPrivateEndpointConnectionInner withEtag(String etag) { return this; } - /** {@inheritDoc} */ + /** + * 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: Metadata pertaining to creation and last modification of the key vault resource. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * {@inheritDoc} + */ @Override public MhsmPrivateEndpointConnectionInner withSku(ManagedHsmSku sku) { super.withSku(sku); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MhsmPrivateEndpointConnectionInner withIdentity(ManagedServiceIdentity identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MhsmPrivateEndpointConnectionInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MhsmPrivateEndpointConnectionInner withTags(Map tags) { super.withTags(tags); @@ -92,7 +166,7 @@ public MhsmPrivateEndpointConnectionInner withTags(Map tags) { /** * Get the privateEndpoint property: Properties of the private endpoint object. - * + * * @return the privateEndpoint value. */ public MhsmPrivateEndpoint privateEndpoint() { @@ -101,7 +175,7 @@ public MhsmPrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: Properties of the private endpoint object. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the MhsmPrivateEndpointConnectionInner object itself. */ @@ -115,7 +189,7 @@ public MhsmPrivateEndpointConnectionInner withPrivateEndpoint(MhsmPrivateEndpoin /** * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @return the privateLinkServiceConnectionState value. */ public MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -124,12 +198,12 @@ public MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState() /** * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the MhsmPrivateEndpointConnectionInner object itself. */ - public MhsmPrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public MhsmPrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { if (this.innerProperties() == null) { this.innerProperties = new MhsmPrivateEndpointConnectionProperties(); } @@ -139,7 +213,7 @@ public MhsmPrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( /** * Get the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -148,12 +222,12 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Set the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @param provisioningState the provisioningState value to set. * @return the MhsmPrivateEndpointConnectionInner object itself. */ - public MhsmPrivateEndpointConnectionInner withProvisioningState( - PrivateEndpointConnectionProvisioningState provisioningState) { + public MhsmPrivateEndpointConnectionInner + withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { if (this.innerProperties() == null) { this.innerProperties = new MhsmPrivateEndpointConnectionProperties(); } @@ -163,7 +237,7 @@ public MhsmPrivateEndpointConnectionInner withProvisioningState( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -173,4 +247,68 @@ public void validate() { innerProperties().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("sku", sku()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmPrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmPrivateEndpointConnectionInner 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 MhsmPrivateEndpointConnectionInner. + */ + public static MhsmPrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmPrivateEndpointConnectionInner deserializedMhsmPrivateEndpointConnectionInner + = new MhsmPrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMhsmPrivateEndpointConnectionInner.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionInner.withSku(ManagedHsmSku.fromJson(reader)); + } else if ("systemData".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionInner + .withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionInner.innerProperties + = MhsmPrivateEndpointConnectionProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmPrivateEndpointConnectionInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateEndpointConnectionProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateEndpointConnectionProperties.java index a0f362bc1dd67..9edab92acc051 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateEndpointConnectionProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateEndpointConnectionProperties.java @@ -5,39 +5,45 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.MhsmPrivateEndpoint; import com.azure.resourcemanager.keyvault.models.MhsmPrivateLinkServiceConnectionState; import com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties of the private endpoint connection resource. */ +/** + * Properties of the private endpoint connection resource. + */ @Fluent -public final class MhsmPrivateEndpointConnectionProperties { +public final class MhsmPrivateEndpointConnectionProperties + implements JsonSerializable { /* * Properties of the private endpoint object. */ - @JsonProperty(value = "privateEndpoint") private MhsmPrivateEndpoint privateEndpoint; /* * Approval state of the private link connection. */ - @JsonProperty(value = "privateLinkServiceConnectionState") private MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState; /* * Provisioning state of the private endpoint connection. */ - @JsonProperty(value = "provisioningState") private PrivateEndpointConnectionProvisioningState provisioningState; - /** Creates an instance of MhsmPrivateEndpointConnectionProperties class. */ + /** + * Creates an instance of MhsmPrivateEndpointConnectionProperties class. + */ public MhsmPrivateEndpointConnectionProperties() { } /** * Get the privateEndpoint property: Properties of the private endpoint object. - * + * * @return the privateEndpoint value. */ public MhsmPrivateEndpoint privateEndpoint() { @@ -46,7 +52,7 @@ public MhsmPrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: Properties of the private endpoint object. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the MhsmPrivateEndpointConnectionProperties object itself. */ @@ -57,7 +63,7 @@ public MhsmPrivateEndpointConnectionProperties withPrivateEndpoint(MhsmPrivateEn /** * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @return the privateLinkServiceConnectionState value. */ public MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -66,19 +72,19 @@ public MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState() /** * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the MhsmPrivateEndpointConnectionProperties object itself. */ - public MhsmPrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public MhsmPrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; return this; } /** * Get the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -87,19 +93,19 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Set the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @param provisioningState the provisioningState value to set. * @return the MhsmPrivateEndpointConnectionProperties object itself. */ - public MhsmPrivateEndpointConnectionProperties withProvisioningState( - PrivateEndpointConnectionProvisioningState provisioningState) { + public MhsmPrivateEndpointConnectionProperties + withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { this.provisioningState = provisioningState; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -110,4 +116,51 @@ public void validate() { privateLinkServiceConnectionState().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmPrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmPrivateEndpointConnectionProperties 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 MhsmPrivateEndpointConnectionProperties. + */ + public static MhsmPrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmPrivateEndpointConnectionProperties deserializedMhsmPrivateEndpointConnectionProperties + = new MhsmPrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateEndpoint".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionProperties.privateEndpoint + = MhsmPrivateEndpoint.fromJson(reader); + } else if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = MhsmPrivateLinkServiceConnectionState.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmPrivateEndpointConnectionProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateLinkResourceListResultInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateLinkResourceListResultInner.java index a20273baa53eb..babd6778d88e0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateLinkResourceListResultInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateLinkResourceListResultInner.java @@ -5,26 +5,34 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.MhsmPrivateLinkResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A list of private link resources. */ +/** + * A list of private link resources. + */ @Fluent -public final class MhsmPrivateLinkResourceListResultInner { +public final class MhsmPrivateLinkResourceListResultInner + implements JsonSerializable { /* * Array of private link resources */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of MhsmPrivateLinkResourceListResultInner class. */ + /** + * Creates an instance of MhsmPrivateLinkResourceListResultInner class. + */ public MhsmPrivateLinkResourceListResultInner() { } /** * Get the value property: Array of private link resources. - * + * * @return the value value. */ public List value() { @@ -33,7 +41,7 @@ public List value() { /** * Set the value property: Array of private link resources. - * + * * @param value the value value to set. * @return the MhsmPrivateLinkResourceListResultInner object itself. */ @@ -44,7 +52,7 @@ public MhsmPrivateLinkResourceListResultInner withValue(List 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 MhsmPrivateLinkResourceListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmPrivateLinkResourceListResultInner 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 MhsmPrivateLinkResourceListResultInner. + */ + public static MhsmPrivateLinkResourceListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmPrivateLinkResourceListResultInner deserializedMhsmPrivateLinkResourceListResultInner + = new MhsmPrivateLinkResourceListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MhsmPrivateLinkResource.fromJson(reader1)); + deserializedMhsmPrivateLinkResourceListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmPrivateLinkResourceListResultInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateLinkResourceProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateLinkResourceProperties.java index aed7cde2484c6..b0241db7bbcb8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateLinkResourceProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/MhsmPrivateLinkResourceProperties.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.keyvault.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; import java.util.List; -/** Properties of a private link resource. */ +/** + * Properties of a private link resource. + */ @Fluent -public final class MhsmPrivateLinkResourceProperties { +public final class MhsmPrivateLinkResourceProperties implements JsonSerializable { /* * Group identifier of private link resource. */ - @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) private String groupId; /* * Required member names of private link resource. */ - @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) private List requiredMembers; /* * Required DNS zone names of the the private link resource. */ - @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; - /** Creates an instance of MhsmPrivateLinkResourceProperties class. */ + /** + * Creates an instance of MhsmPrivateLinkResourceProperties class. + */ public MhsmPrivateLinkResourceProperties() { } /** * Get the groupId property: Group identifier of private link resource. - * + * * @return the groupId value. */ public String groupId() { @@ -44,7 +49,7 @@ public String groupId() { /** * Get the requiredMembers property: Required member names of private link resource. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -53,7 +58,7 @@ public List requiredMembers() { /** * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. - * + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -62,7 +67,7 @@ public List requiredZoneNames() { /** * Set the requiredZoneNames property: Required DNS zone names of the the private link resource. - * + * * @param requiredZoneNames the requiredZoneNames value to set. * @return the MhsmPrivateLinkResourceProperties object itself. */ @@ -73,9 +78,53 @@ public MhsmPrivateLinkResourceProperties withRequiredZoneNames(List requ /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmPrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmPrivateLinkResourceProperties 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 MhsmPrivateLinkResourceProperties. + */ + public static MhsmPrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmPrivateLinkResourceProperties deserializedMhsmPrivateLinkResourceProperties + = new MhsmPrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedMhsmPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedMhsmPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedMhsmPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmPrivateLinkResourceProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationInner.java index ae014204ad147..ef7111ae4398a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationInner.java @@ -5,50 +5,53 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.OperationDisplay; import com.azure.resourcemanager.keyvault.models.ServiceSpecification; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Key Vault REST API operation definition. */ +/** + * Key Vault REST API operation definition. + */ @Fluent -public final class OperationInner { +public final class OperationInner implements JsonSerializable { /* * Operation name: {provider}/{resource}/{operation} */ - @JsonProperty(value = "name") private String name; /* * Display metadata associated with the operation. */ - @JsonProperty(value = "display") private OperationDisplay display; /* * The origin of operations. */ - @JsonProperty(value = "origin") private String origin; /* * Properties of operation, include metric specifications. */ - @JsonProperty(value = "properties") private OperationProperties innerOperationProperties; /* * Property to specify whether the action is a data action. */ - @JsonProperty(value = "isDataAction") private Boolean isDataAction; - /** Creates an instance of OperationInner class. */ + /** + * Creates an instance of OperationInner class. + */ public OperationInner() { } /** * Get the name property: Operation name: {provider}/{resource}/{operation}. - * + * * @return the name value. */ public String name() { @@ -57,7 +60,7 @@ public String name() { /** * Set the name property: Operation name: {provider}/{resource}/{operation}. - * + * * @param name the name value to set. * @return the OperationInner object itself. */ @@ -68,7 +71,7 @@ public OperationInner withName(String name) { /** * Get the display property: Display metadata associated with the operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -77,7 +80,7 @@ public OperationDisplay display() { /** * Set the display property: Display metadata associated with the operation. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -88,7 +91,7 @@ public OperationInner withDisplay(OperationDisplay display) { /** * Get the origin property: The origin of operations. - * + * * @return the origin value. */ public String origin() { @@ -97,7 +100,7 @@ public String origin() { /** * Set the origin property: The origin of operations. - * + * * @param origin the origin value to set. * @return the OperationInner object itself. */ @@ -108,7 +111,7 @@ public OperationInner withOrigin(String origin) { /** * Get the innerOperationProperties property: Properties of operation, include metric specifications. - * + * * @return the innerOperationProperties value. */ private OperationProperties innerOperationProperties() { @@ -117,7 +120,7 @@ private OperationProperties innerOperationProperties() { /** * Get the isDataAction property: Property to specify whether the action is a data action. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -126,7 +129,7 @@ public Boolean isDataAction() { /** * Set the isDataAction property: Property to specify whether the action is a data action. - * + * * @param isDataAction the isDataAction value to set. * @return the OperationInner object itself. */ @@ -137,7 +140,7 @@ public OperationInner withIsDataAction(Boolean isDataAction) { /** * Get the serviceSpecification property: One property of operation, include metric specifications. - * + * * @return the serviceSpecification value. */ public ServiceSpecification serviceSpecification() { @@ -146,7 +149,7 @@ public ServiceSpecification serviceSpecification() { /** * Set the serviceSpecification property: One property of operation, include metric specifications. - * + * * @param serviceSpecification the serviceSpecification value to set. * @return the OperationInner object itself. */ @@ -160,7 +163,7 @@ public OperationInner withServiceSpecification(ServiceSpecification serviceSpeci /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -171,4 +174,52 @@ public void validate() { innerOperationProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeStringField("origin", this.origin); + jsonWriter.writeJsonField("properties", this.innerOperationProperties); + jsonWriter.writeBooleanField("isDataAction", this.isDataAction); + 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 if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOperationInner.innerOperationProperties = OperationProperties.fromJson(reader); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationProperties.java index 09bc43e908a7b..3d35b9525b0bf 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/OperationProperties.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.ServiceSpecification; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties of operation, include metric specifications. */ +/** + * Properties of operation, include metric specifications. + */ @Fluent -public final class OperationProperties { +public final class OperationProperties implements JsonSerializable { /* * One property of operation, include metric specifications. */ - @JsonProperty(value = "serviceSpecification") private ServiceSpecification serviceSpecification; - /** Creates an instance of OperationProperties class. */ + /** + * Creates an instance of OperationProperties class. + */ public OperationProperties() { } /** * Get the serviceSpecification property: One property of operation, include metric specifications. - * + * * @return the serviceSpecification value. */ public ServiceSpecification serviceSpecification() { @@ -32,7 +39,7 @@ public ServiceSpecification serviceSpecification() { /** * Set the serviceSpecification property: One property of operation, include metric specifications. - * + * * @param serviceSpecification the serviceSpecification value to set. * @return the OperationProperties object itself. */ @@ -43,7 +50,7 @@ public OperationProperties withServiceSpecification(ServiceSpecification service /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -51,4 +58,40 @@ public void validate() { serviceSpecification().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationProperties 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 OperationProperties. + */ + public static OperationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationProperties deserializedOperationProperties = new OperationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSpecification".equals(fieldName)) { + deserializedOperationProperties.serviceSpecification = ServiceSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionInner.java index 548d5b442ff9f..73f528b893d7f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionInner.java @@ -6,34 +6,54 @@ 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.keyvault.models.PrivateEndpoint; import com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.keyvault.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Private endpoint connection resource. */ +/** + * Private endpoint connection resource. + */ @Fluent public final class PrivateEndpointConnectionInner extends Resource { /* * Resource properties. */ - @JsonProperty(value = "properties") private PrivateEndpointConnectionProperties innerProperties; /* * Modified whenever there is a change in the state of private endpoint connection. */ - @JsonProperty(value = "etag") private String etag; - /** Creates an instance of PrivateEndpointConnectionInner class. */ + /* + * 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 PrivateEndpointConnectionInner class. + */ public PrivateEndpointConnectionInner() { } /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private PrivateEndpointConnectionProperties innerProperties() { @@ -42,7 +62,7 @@ private PrivateEndpointConnectionProperties innerProperties() { /** * Get the etag property: Modified whenever there is a change in the state of private endpoint connection. - * + * * @return the etag value. */ public String etag() { @@ -51,7 +71,7 @@ public String etag() { /** * Set the etag property: Modified whenever there is a change in the state of private endpoint connection. - * + * * @param etag the etag value to set. * @return the PrivateEndpointConnectionInner object itself. */ @@ -60,14 +80,48 @@ public PrivateEndpointConnectionInner withEtag(String etag) { return this; } - /** {@inheritDoc} */ + /** + * 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} + */ @Override public PrivateEndpointConnectionInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PrivateEndpointConnectionInner withTags(Map tags) { super.withTags(tags); @@ -76,7 +130,7 @@ public PrivateEndpointConnectionInner withTags(Map tags) { /** * Get the privateEndpoint property: Properties of the private endpoint object. - * + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -85,7 +139,7 @@ public PrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: Properties of the private endpoint object. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionInner object itself. */ @@ -99,7 +153,7 @@ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privat /** * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -108,12 +162,12 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionInner object itself. */ - public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionInner + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { if (this.innerProperties() == null) { this.innerProperties = new PrivateEndpointConnectionProperties(); } @@ -123,7 +177,7 @@ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( /** * Get the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -132,12 +186,12 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Set the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @param provisioningState the provisioningState value to set. * @return the PrivateEndpointConnectionInner object itself. */ - public PrivateEndpointConnectionInner withProvisioningState( - PrivateEndpointConnectionProvisioningState provisioningState) { + public PrivateEndpointConnectionInner + withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { if (this.innerProperties() == null) { this.innerProperties = new PrivateEndpointConnectionProperties(); } @@ -147,7 +201,7 @@ public PrivateEndpointConnectionInner withProvisioningState( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -155,4 +209,59 @@ public void validate() { innerProperties().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.innerProperties); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionInner. + */ + public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner + = new PrivateEndpointConnectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionProperties.java index 6be7dd5eb9c62..59414c3b9f3a4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateEndpointConnectionProperties.java @@ -5,39 +5,45 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.PrivateEndpoint; import com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionProvisioningState; import com.azure.resourcemanager.keyvault.models.PrivateLinkServiceConnectionState; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Properties of the private endpoint connection resource. */ +/** + * Properties of the private endpoint connection resource. + */ @Fluent -public final class PrivateEndpointConnectionProperties { +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { /* * Properties of the private endpoint object. */ - @JsonProperty(value = "privateEndpoint") private PrivateEndpoint privateEndpoint; /* * Approval state of the private link connection. */ - @JsonProperty(value = "privateLinkServiceConnectionState") private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; /* * Provisioning state of the private endpoint connection. */ - @JsonProperty(value = "provisioningState") private PrivateEndpointConnectionProvisioningState provisioningState; - /** Creates an instance of PrivateEndpointConnectionProperties class. */ + /** + * Creates an instance of PrivateEndpointConnectionProperties class. + */ public PrivateEndpointConnectionProperties() { } /** * Get the privateEndpoint property: Properties of the private endpoint object. - * + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -46,7 +52,7 @@ public PrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: Properties of the private endpoint object. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionProperties object itself. */ @@ -57,7 +63,7 @@ public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint p /** * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -66,19 +72,19 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionProperties object itself. */ - public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionProperties + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; return this; } /** * Get the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -87,19 +93,19 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Set the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @param provisioningState the provisioningState value to set. * @return the PrivateEndpointConnectionProperties object itself. */ - public PrivateEndpointConnectionProperties withProvisioningState( - PrivateEndpointConnectionProvisioningState provisioningState) { + public PrivateEndpointConnectionProperties + withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { this.provisioningState = provisioningState; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -110,4 +116,50 @@ public void validate() { privateLinkServiceConnectionState().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); + } else if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = PrivateLinkServiceConnectionState.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceListResultInner.java index 457958ad995ce..9a7ee7ec70d66 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceListResultInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceListResultInner.java @@ -5,26 +5,33 @@ package com.azure.resourcemanager.keyvault.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.keyvault.models.PrivateLinkResource; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** A list of private link resources. */ +/** + * A list of private link resources. + */ @Fluent -public final class PrivateLinkResourceListResultInner { +public final class PrivateLinkResourceListResultInner implements JsonSerializable { /* * Array of private link resources */ - @JsonProperty(value = "value") private List value; - /** Creates an instance of PrivateLinkResourceListResultInner class. */ + /** + * Creates an instance of PrivateLinkResourceListResultInner class. + */ public PrivateLinkResourceListResultInner() { } /** * Get the value property: Array of private link resources. - * + * * @return the value value. */ public List value() { @@ -33,7 +40,7 @@ public List value() { /** * Set the value property: Array of private link resources. - * + * * @param value the value value to set. * @return the PrivateLinkResourceListResultInner object itself. */ @@ -44,7 +51,7 @@ public PrivateLinkResourceListResultInner withValue(List va /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -52,4 +59,43 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResultInner 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 PrivateLinkResourceListResultInner. + */ + public static PrivateLinkResourceListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResultInner deserializedPrivateLinkResourceListResultInner + = new PrivateLinkResourceListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResource.fromJson(reader1)); + deserializedPrivateLinkResourceListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResultInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceProperties.java index d6a936f8df89b..20273645093d6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/PrivateLinkResourceProperties.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.keyvault.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; import java.util.List; -/** Properties of a private link resource. */ +/** + * Properties of a private link resource. + */ @Fluent -public final class PrivateLinkResourceProperties { +public final class PrivateLinkResourceProperties implements JsonSerializable { /* * Group identifier of private link resource. */ - @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) private String groupId; /* * Required member names of private link resource. */ - @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) private List requiredMembers; /* * Required DNS zone names of the the private link resource. */ - @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; - /** Creates an instance of PrivateLinkResourceProperties class. */ + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ public PrivateLinkResourceProperties() { } /** * Get the groupId property: Group identifier of private link resource. - * + * * @return the groupId value. */ public String groupId() { @@ -44,7 +49,7 @@ public String groupId() { /** * Get the requiredMembers property: Required member names of private link resource. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -53,7 +58,7 @@ public List requiredMembers() { /** * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. - * + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -62,7 +67,7 @@ public List requiredZoneNames() { /** * Set the requiredZoneNames property: Required DNS zone names of the the private link resource. - * + * * @param requiredZoneNames the requiredZoneNames value to set. * @return the PrivateLinkResourceProperties object itself. */ @@ -73,9 +78,53 @@ public PrivateLinkResourceProperties withRequiredZoneNames(List required /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/SecretInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/SecretInner.java new file mode 100644 index 0000000000000..d13b04004bae7 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/SecretInner.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +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.keyvault.models.SecretProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Resource information with extended details. + */ +@Fluent +public final class SecretInner extends Resource { + /* + * Properties of the secret + */ + private SecretProperties 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 SecretInner class. + */ + public SecretInner() { + } + + /** + * Get the properties property: Properties of the secret. + * + * @return the properties value. + */ + public SecretProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the secret. + * + * @param properties the properties value to set. + * @return the SecretInner object itself. + */ + public SecretInner withProperties(SecretProperties properties) { + this.properties = 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; + } + + /** + * {@inheritDoc} + */ + @Override + public SecretInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SecretInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model SecretInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretInner.class); + + /** + * {@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 SecretInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretInner 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 SecretInner. + */ + public static SecretInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretInner deserializedSecretInner = new SecretInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSecretInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSecretInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSecretInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedSecretInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecretInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedSecretInner.properties = SecretProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretInner; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultAccessPolicyParametersInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultAccessPolicyParametersInner.java index cd7749c71a4a2..0317a3479d3bc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultAccessPolicyParametersInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultAccessPolicyParametersInner.java @@ -7,31 +7,51 @@ 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.keyvault.models.VaultAccessPolicyProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Parameters for updating the access policy in a vault. */ +/** + * Parameters for updating the access policy in a vault. + */ @Fluent public final class VaultAccessPolicyParametersInner extends ProxyResource { /* * The resource type of the access policy. */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; /* * Properties of the access policy */ - @JsonProperty(value = "properties", required = true) private VaultAccessPolicyProperties properties; - /** Creates an instance of VaultAccessPolicyParametersInner class. */ + /* + * 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 VaultAccessPolicyParametersInner class. + */ public VaultAccessPolicyParametersInner() { } /** * Get the location property: The resource type of the access policy. - * + * * @return the location value. */ public String location() { @@ -40,7 +60,7 @@ public String location() { /** * Get the properties property: Properties of the access policy. - * + * * @return the properties value. */ public VaultAccessPolicyProperties properties() { @@ -49,7 +69,7 @@ public VaultAccessPolicyProperties properties() { /** * Set the properties property: Properties of the access policy. - * + * * @param properties the properties value to set. * @return the VaultAccessPolicyParametersInner object itself. */ @@ -58,21 +78,97 @@ public VaultAccessPolicyParametersInner withProperties(VaultAccessPolicyProperti 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. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model VaultAccessPolicyParametersInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model VaultAccessPolicyParametersInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(VaultAccessPolicyParametersInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultAccessPolicyParametersInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultAccessPolicyParametersInner 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 VaultAccessPolicyParametersInner. + */ + public static VaultAccessPolicyParametersInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultAccessPolicyParametersInner deserializedVaultAccessPolicyParametersInner + = new VaultAccessPolicyParametersInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVaultAccessPolicyParametersInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVaultAccessPolicyParametersInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVaultAccessPolicyParametersInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVaultAccessPolicyParametersInner.properties + = VaultAccessPolicyProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedVaultAccessPolicyParametersInner.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultAccessPolicyParametersInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultInner.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultInner.java index 1eb4aca632178..4d393c0964959 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/VaultInner.java @@ -8,32 +8,52 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.keyvault.models.VaultProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; -/** Resource information with extended details. */ +/** + * Resource information with extended details. + */ @Fluent public final class VaultInner extends Resource { /* * System metadata for the key vault. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* * Properties of the vault */ - @JsonProperty(value = "properties", required = true) private VaultProperties properties; - /** Creates an instance of VaultInner class. */ + /* + * 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 VaultInner class. + */ public VaultInner() { } /** * Get the systemData property: System metadata for the key vault. - * + * * @return the systemData value. */ public SystemData systemData() { @@ -42,7 +62,7 @@ public SystemData systemData() { /** * Get the properties property: Properties of the vault. - * + * * @return the properties value. */ public VaultProperties properties() { @@ -51,7 +71,7 @@ public VaultProperties properties() { /** * Set the properties property: Properties of the vault. - * + * * @param properties the properties value to set. * @return the VaultInner object itself. */ @@ -60,14 +80,48 @@ public VaultInner withProperties(VaultProperties properties) { return this; } - /** {@inheritDoc} */ + /** + * 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} + */ @Override public VaultInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public VaultInner withTags(Map tags) { super.withTags(tags); @@ -76,18 +130,69 @@ public VaultInner withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model VaultInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model VaultInner")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(VaultInner.class); + + /** + * {@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 VaultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VaultInner. + */ + public static VaultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultInner deserializedVaultInner = new VaultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVaultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedVaultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedVaultInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedVaultInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVaultInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedVaultInner.properties = VaultProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedVaultInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/package-info.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/package-info.java index 529590757e997..4f1d5a9f4538e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/package-info.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for KeyVaultManagementClient. The Azure management API provides a RESTful - * set of web services that interact with Azure Key Vault. + * Package containing the inner data models for KeyVaultManagementClient. + * The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. */ package com.azure.resourcemanager.keyvault.fluent.models; diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/package-info.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/package-info.java index c43cea214c15a..d3136e8ec958d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/package-info.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/fluent/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for KeyVaultManagementClient. The Azure management API provides a RESTful set - * of web services that interact with Azure Key Vault. + * Package containing the service clients for KeyVaultManagementClient. + * The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. */ package com.azure.resourcemanager.keyvault.fluent; diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientBuilder.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientBuilder.java index 6a87a3b741b9b..70db20aa1536b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientBuilder.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientBuilder.java @@ -14,8 +14,10 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the KeyVaultManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {KeyVaultManagementClientImpl.class}) +/** + * A builder for creating a new instance of the KeyVaultManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { KeyVaultManagementClientImpl.class }) public final class KeyVaultManagementClientBuilder { /* * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of @@ -26,7 +28,7 @@ public final class KeyVaultManagementClientBuilder { /** * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms * part of the URI for every service call. - * + * * @param subscriptionId the subscriptionId value. * @return the KeyVaultManagementClientBuilder. */ @@ -42,7 +44,7 @@ public KeyVaultManagementClientBuilder subscriptionId(String subscriptionId) { /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the KeyVaultManagementClientBuilder. */ @@ -58,7 +60,7 @@ public KeyVaultManagementClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the KeyVaultManagementClientBuilder. */ @@ -74,7 +76,7 @@ public KeyVaultManagementClientBuilder environment(AzureEnvironment environment) /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the KeyVaultManagementClientBuilder. */ @@ -90,7 +92,7 @@ public KeyVaultManagementClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the KeyVaultManagementClientBuilder. */ @@ -106,7 +108,7 @@ public KeyVaultManagementClientBuilder defaultPollInterval(Duration defaultPollI /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the KeyVaultManagementClientBuilder. */ @@ -117,30 +119,22 @@ public KeyVaultManagementClientBuilder serializerAdapter(SerializerAdapter seria /** * Builds an instance of KeyVaultManagementClientImpl with the provided parameters. - * + * * @return an instance of KeyVaultManagementClientImpl. */ public KeyVaultManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - KeyVaultManagementClientImpl client = - new KeyVaultManagementClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - this.subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + KeyVaultManagementClientImpl client = new KeyVaultManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientImpl.java index 469fb99987dc5..28c9bdaf73620 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeyVaultManagementClientImpl.java @@ -8,7 +8,9 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.resourcemanager.keyvault.fluent.KeysClient; import com.azure.resourcemanager.keyvault.fluent.KeyVaultManagementClient; +import com.azure.resourcemanager.keyvault.fluent.ManagedHsmKeysClient; import com.azure.resourcemanager.keyvault.fluent.ManagedHsmsClient; import com.azure.resourcemanager.keyvault.fluent.MhsmPrivateEndpointConnectionsClient; import com.azure.resourcemanager.keyvault.fluent.MhsmPrivateLinkResourcesClient; @@ -16,11 +18,14 @@ import com.azure.resourcemanager.keyvault.fluent.OperationsClient; import com.azure.resourcemanager.keyvault.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.keyvault.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.keyvault.fluent.SecretsClient; import com.azure.resourcemanager.keyvault.fluent.VaultsClient; import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import java.time.Duration; -/** Initializes a new instance of the KeyVaultManagementClientImpl type. */ +/** + * Initializes a new instance of the KeyVaultManagementClientImpl type. + */ @ServiceClient(builder = KeyVaultManagementClientBuilder.class) public final class KeyVaultManagementClientImpl extends AzureServiceClient implements KeyVaultManagementClient { /** @@ -32,187 +37,250 @@ public final class KeyVaultManagementClientImpl extends AzureServiceClient imple /** * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms * part of the URI for every service call. - * + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The VaultsClient object to access its operations. */ + /** + * The KeysClient object to access its operations. + */ + private final KeysClient keys; + + /** + * Gets the KeysClient object to access its operations. + * + * @return the KeysClient object. + */ + public KeysClient getKeys() { + return this.keys; + } + + /** + * The ManagedHsmKeysClient object to access its operations. + */ + private final ManagedHsmKeysClient managedHsmKeys; + + /** + * Gets the ManagedHsmKeysClient object to access its operations. + * + * @return the ManagedHsmKeysClient object. + */ + public ManagedHsmKeysClient getManagedHsmKeys() { + return this.managedHsmKeys; + } + + /** + * The VaultsClient object to access its operations. + */ private final VaultsClient vaults; /** * Gets the VaultsClient object to access its operations. - * + * * @return the VaultsClient object. */ public VaultsClient getVaults() { return this.vaults; } - /** The PrivateEndpointConnectionsClient object to access its operations. */ + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ private final PrivateEndpointConnectionsClient privateEndpointConnections; /** * Gets the PrivateEndpointConnectionsClient object to access its operations. - * + * * @return the PrivateEndpointConnectionsClient object. */ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { return this.privateEndpointConnections; } - /** The PrivateLinkResourcesClient object to access its operations. */ + /** + * The PrivateLinkResourcesClient object to access its operations. + */ private final PrivateLinkResourcesClient privateLinkResources; /** * Gets the PrivateLinkResourcesClient object to access its operations. - * + * * @return the PrivateLinkResourcesClient object. */ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } - /** The ManagedHsmsClient object to access its operations. */ + /** + * The ManagedHsmsClient object to access its operations. + */ private final ManagedHsmsClient managedHsms; /** * Gets the ManagedHsmsClient object to access its operations. - * + * * @return the ManagedHsmsClient object. */ public ManagedHsmsClient getManagedHsms() { return this.managedHsms; } - /** The MhsmPrivateEndpointConnectionsClient object to access its operations. */ + /** + * The MhsmPrivateEndpointConnectionsClient object to access its operations. + */ private final MhsmPrivateEndpointConnectionsClient mhsmPrivateEndpointConnections; /** * Gets the MhsmPrivateEndpointConnectionsClient object to access its operations. - * + * * @return the MhsmPrivateEndpointConnectionsClient object. */ public MhsmPrivateEndpointConnectionsClient getMhsmPrivateEndpointConnections() { return this.mhsmPrivateEndpointConnections; } - /** The MhsmPrivateLinkResourcesClient object to access its operations. */ + /** + * The MhsmPrivateLinkResourcesClient object to access its operations. + */ private final MhsmPrivateLinkResourcesClient mhsmPrivateLinkResources; /** * Gets the MhsmPrivateLinkResourcesClient object to access its operations. - * + * * @return the MhsmPrivateLinkResourcesClient object. */ public MhsmPrivateLinkResourcesClient getMhsmPrivateLinkResources() { return this.mhsmPrivateLinkResources; } - /** The MhsmRegionsClient object to access its operations. */ + /** + * The MhsmRegionsClient object to access its operations. + */ private final MhsmRegionsClient mhsmRegions; /** * Gets the MhsmRegionsClient object to access its operations. - * + * * @return the MhsmRegionsClient object. */ public MhsmRegionsClient getMhsmRegions() { return this.mhsmRegions; } - /** The OperationsClient object to access its operations. */ + /** + * The OperationsClient object to access its operations. + */ private final OperationsClient operations; /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ public OperationsClient getOperations() { return this.operations; } + /** + * The SecretsClient object to access its operations. + */ + private final SecretsClient secrets; + + /** + * Gets the SecretsClient object to access its operations. + * + * @return the SecretsClient object. + */ + public SecretsClient getSecrets() { + return this.secrets; + } + /** * Initializes an instance of KeyVaultManagementClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. + * subscription ID forms part of the URI for every service call. * @param endpoint server parameter. */ - KeyVaultManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + KeyVaultManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { super(httpPipeline, serializerAdapter, environment); this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; @@ -220,6 +288,8 @@ public OperationsClient getOperations() { this.subscriptionId = subscriptionId; this.endpoint = endpoint; this.apiVersion = "2023-07-01"; + this.keys = new KeysClientImpl(this); + this.managedHsmKeys = new ManagedHsmKeysClientImpl(this); this.vaults = new VaultsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); @@ -228,5 +298,6 @@ public OperationsClient getOperations() { this.mhsmPrivateLinkResources = new MhsmPrivateLinkResourcesClientImpl(this); this.mhsmRegions = new MhsmRegionsClientImpl(this); this.operations = new OperationsClientImpl(this); + this.secrets = new SecretsClientImpl(this); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeysClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeysClientImpl.java new file mode 100644 index 0000000000000..f7f108ce13637 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/KeysClientImpl.java @@ -0,0 +1,961 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.keyvault.fluent.KeysClient; +import com.azure.resourcemanager.keyvault.fluent.models.KeyInner; +import com.azure.resourcemanager.keyvault.models.KeyCreateParameters; +import com.azure.resourcemanager.keyvault.models.KeyListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in KeysClient. + */ +public final class KeysClientImpl implements KeysClient { + /** + * The proxy service used to perform REST calls. + */ + private final KeysService service; + + /** + * The service client containing this operation class. + */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of KeysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + KeysClientImpl(KeyVaultManagementClientImpl client) { + this.service = RestProxy.create(KeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientKeys to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + public interface KeysService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createIfNotExist(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("keyName") String keyName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") KeyCreateParameters parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("keyName") String keyName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}/versions/{keyVersion}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVersion(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("keyName") String keyName, @PathParam("keyVersion") String keyVersion, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVersions(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("keyName") String keyName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVersionsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createIfNotExistWithResponseAsync(String resourceGroupName, String vaultName, + String keyName, KeyCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createIfNotExist(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, keyName, this.client.getApiVersion(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createIfNotExistWithResponseAsync(String resourceGroupName, String vaultName, + String keyName, KeyCreateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createIfNotExist(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vaultName, keyName, this.client.getApiVersion(), parameters, accept, context); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createIfNotExistAsync(String resourceGroupName, String vaultName, String keyName, + KeyCreateParameters parameters) { + return createIfNotExistWithResponseAsync(resourceGroupName, vaultName, keyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createIfNotExistWithResponse(String resourceGroupName, String vaultName, String keyName, + KeyCreateParameters parameters, Context context) { + return createIfNotExistWithResponseAsync(resourceGroupName, vaultName, keyName, parameters, context).block(); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the key vault which contains the key to be created. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KeyInner createIfNotExist(String resourceGroupName, String vaultName, String keyName, + KeyCreateParameters parameters) { + return createIfNotExistWithResponse(resourceGroupName, vaultName, keyName, parameters, Context.NONE).getValue(); + } + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String vaultName, String keyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, keyName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, String keyName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, vaultName, + keyName, this.client.getApiVersion(), accept, context); + } + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String vaultName, String keyName) { + return getWithResponseAsync(resourceGroupName, vaultName, keyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vaultName, String keyName, + Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, keyName, context).block(); + } + + /** + * Gets the current version of the specified key from the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key to be retrieved. + * @param keyName The name of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KeyInner get(String resourceGroupName, String vaultName, String keyName) { + return getWithResponse(resourceGroupName, vaultName, keyName, Context.NONE).getValue(); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String vaultName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String vaultName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, vaultName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName)); + } + + /** + * Lists the keys in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the keys to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, context)); + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getVersionWithResponseAsync(String resourceGroupName, String vaultName, + String keyName, String keyVersion) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (keyVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter keyVersion is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getVersion(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, keyName, keyVersion, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVersionWithResponseAsync(String resourceGroupName, String vaultName, + String keyName, String keyVersion, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (keyVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter keyVersion is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getVersion(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vaultName, keyName, keyVersion, this.client.getApiVersion(), accept, context); + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getVersionAsync(String resourceGroupName, String vaultName, String keyName, + String keyVersion) { + return getVersionWithResponseAsync(resourceGroupName, vaultName, keyName, keyVersion) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVersionWithResponse(String resourceGroupName, String vaultName, String keyName, + String keyVersion, Context context) { + return getVersionWithResponseAsync(resourceGroupName, vaultName, keyName, keyVersion, context).block(); + } + + /** + * Gets the specified version of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key version to be retrieved. + * @param keyName The name of the key version to be retrieved. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified key vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KeyInner getVersion(String resourceGroupName, String vaultName, String keyName, String keyVersion) { + return getVersionWithResponse(resourceGroupName, vaultName, keyName, keyVersion, Context.NONE).getValue(); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsSinglePageAsync(String resourceGroupName, String vaultName, + String keyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listVersions(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, keyName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsSinglePageAsync(String resourceGroupName, String vaultName, + String keyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVersions(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, vaultName, + keyName, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listVersionsAsync(String resourceGroupName, String vaultName, String keyName) { + return new PagedFlux<>(() -> listVersionsSinglePageAsync(resourceGroupName, vaultName, keyName), + nextLink -> listVersionsNextSinglePageAsync(nextLink)); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVersionsAsync(String resourceGroupName, String vaultName, String keyName, + Context context) { + return new PagedFlux<>(() -> listVersionsSinglePageAsync(resourceGroupName, vaultName, keyName, context), + nextLink -> listVersionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String resourceGroupName, String vaultName, String keyName) { + return new PagedIterable<>(listVersionsAsync(resourceGroupName, vaultName, keyName)); + } + + /** + * Lists the versions of the specified key in the specified key vault. + * + * @param resourceGroupName The name of the resource group which contains the specified key vault. + * @param vaultName The name of the vault which contains the key versions to be retrieved. + * @param keyName The name of the key versions to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String resourceGroupName, String vaultName, String keyName, + Context context) { + return new PagedIterable<>(listVersionsAsync(resourceGroupName, vaultName, keyName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listVersionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listVersionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/ManagedHsmKeysClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/ManagedHsmKeysClientImpl.java new file mode 100644 index 0000000000000..3d55d32435b02 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/ManagedHsmKeysClientImpl.java @@ -0,0 +1,979 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.keyvault.fluent.ManagedHsmKeysClient; +import com.azure.resourcemanager.keyvault.fluent.models.ManagedHsmKeyInner; +import com.azure.resourcemanager.keyvault.models.ManagedHsmKeyCreateParameters; +import com.azure.resourcemanager.keyvault.models.ManagedHsmKeyListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ManagedHsmKeysClient. + */ +public final class ManagedHsmKeysClientImpl implements ManagedHsmKeysClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedHsmKeysService service; + + /** + * The service client containing this operation class. + */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of ManagedHsmKeysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedHsmKeysClientImpl(KeyVaultManagementClientImpl client) { + this.service + = RestProxy.create(ManagedHsmKeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientManagedHsmKeys to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + public interface ManagedHsmKeysService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/keys/{keyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createIfNotExist(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @PathParam("keyName") String keyName, + @BodyParam("application/json") ManagedHsmKeyCreateParameters parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/keys/{keyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @PathParam("keyName") String keyName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/keys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/keys/{keyName}/versions/{keyVersion}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getVersion(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @PathParam("keyName") String keyName, @PathParam("keyVersion") String keyVersion, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/keys/{keyName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVersions(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @PathParam("keyName") String keyName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listVersionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createIfNotExistWithResponseAsync(String resourceGroupName, String name, + String keyName, ManagedHsmKeyCreateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createIfNotExist(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, name, this.client.getApiVersion(), keyName, parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createIfNotExistWithResponseAsync(String resourceGroupName, String name, + String keyName, ManagedHsmKeyCreateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createIfNotExist(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + name, this.client.getApiVersion(), keyName, parameters, accept, context); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createIfNotExistAsync(String resourceGroupName, String name, String keyName, + ManagedHsmKeyCreateParameters parameters) { + return createIfNotExistWithResponseAsync(resourceGroupName, name, keyName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createIfNotExistWithResponse(String resourceGroupName, String name, + String keyName, ManagedHsmKeyCreateParameters parameters, Context context) { + return createIfNotExistWithResponseAsync(resourceGroupName, name, keyName, parameters, context).block(); + } + + /** + * Creates the first version of a new key if it does not exist. If it already exists, then the existing key is + * returned without any write operations being performed. This API does not create subsequent versions, and does not + * update existing keys. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param parameters The parameters used to create the specified key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the key resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedHsmKeyInner createIfNotExist(String resourceGroupName, String name, String keyName, + ManagedHsmKeyCreateParameters parameters) { + return createIfNotExistWithResponse(resourceGroupName, name, keyName, parameters, Context.NONE).getValue(); + } + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified managed HSM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String name, + String keyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, name, keyName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified managed HSM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String name, + String keyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, keyName, + this.client.getApiVersion(), accept, context); + } + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified managed HSM on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String name, String keyName) { + return getWithResponseAsync(resourceGroupName, name, keyName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified managed HSM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String name, String keyName, + Context context) { + return getWithResponseAsync(resourceGroupName, name, keyName, context).block(); + } + + /** + * Gets the current version of the specified key from the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current version of the specified key from the specified managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedHsmKeyInner get(String resourceGroupName, String name, String keyName) { + return getWithResponse(resourceGroupName, name, keyName, Context.NONE).getValue(); + } + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, name, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String name, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String name) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, name), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String name, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, name, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String name) { + return new PagedIterable<>(listAsync(resourceGroupName, name)); + } + + /** + * Lists the keys in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String name, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, name, context)); + } + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified managed HSM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getVersionWithResponseAsync(String resourceGroupName, String name, + String keyName, String keyVersion) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (keyVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter keyVersion is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getVersion(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, name, keyName, keyVersion, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param keyVersion The version of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified managed HSM along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getVersionWithResponseAsync(String resourceGroupName, String name, + String keyName, String keyVersion, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (keyVersion == null) { + return Mono.error(new IllegalArgumentException("Parameter keyVersion is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getVersion(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, + keyName, keyVersion, this.client.getApiVersion(), accept, context); + } + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified managed HSM on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getVersionAsync(String resourceGroupName, String name, String keyName, + String keyVersion) { + return getVersionWithResponseAsync(resourceGroupName, name, keyName, keyVersion) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param keyVersion The version of the key to be retrieved. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified managed HSM along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getVersionWithResponse(String resourceGroupName, String name, String keyName, + String keyVersion, Context context) { + return getVersionWithResponseAsync(resourceGroupName, name, keyName, keyVersion, context).block(); + } + + /** + * Gets the specified version of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param keyVersion The version of the key to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified version of the specified key in the specified managed HSM. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedHsmKeyInner getVersion(String resourceGroupName, String name, String keyName, String keyVersion) { + return getVersionWithResponse(resourceGroupName, name, keyName, keyVersion, Context.NONE).getValue(); + } + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsSinglePageAsync(String resourceGroupName, String name, + String keyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listVersions(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, name, keyName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsSinglePageAsync(String resourceGroupName, String name, + String keyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listVersions(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, keyName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listVersionsAsync(String resourceGroupName, String name, String keyName) { + return new PagedFlux<>(() -> listVersionsSinglePageAsync(resourceGroupName, name, keyName), + nextLink -> listVersionsNextSinglePageAsync(nextLink)); + } + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listVersionsAsync(String resourceGroupName, String name, String keyName, + Context context) { + return new PagedFlux<>(() -> listVersionsSinglePageAsync(resourceGroupName, name, keyName, context), + nextLink -> listVersionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String resourceGroupName, String name, String keyName) { + return new PagedIterable<>(listVersionsAsync(resourceGroupName, name, keyName)); + } + + /** + * Lists the versions of the specified key in the specified managed HSM. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name The name of the Managed HSM Pool within the specified resource group. + * @param keyName The name of the key to be created. The value you provide may be copied globally for the purpose of + * running the service. The value provided should not include personally identifiable or sensitive information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String resourceGroupName, String name, String keyName, + Context context) { + return new PagedIterable<>(listVersionsAsync(resourceGroupName, name, keyName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listVersionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the page of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listVersionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listVersionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/ManagedHsmsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/ManagedHsmsClientImpl.java index 828adb93360e2..4031b9d77d17f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/ManagedHsmsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/ManagedHsmsClientImpl.java @@ -48,26 +48,29 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ManagedHsmsClient. */ -public final class ManagedHsmsClientImpl - implements InnerSupportsGet, - InnerSupportsListing, - InnerSupportsDelete, - ManagedHsmsClient { - /** The proxy service used to perform REST calls. */ +/** + * An instance of this class provides access to all the operations defined in ManagedHsmsClient. + */ +public final class ManagedHsmsClientImpl implements InnerSupportsGet, + InnerSupportsListing, InnerSupportsDelete, ManagedHsmsClient { + /** + * The proxy service used to perform REST calls. + */ private final ManagedHsmsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final KeyVaultManagementClientImpl client; /** * Initializes an instance of ManagedHsmsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ManagedHsmsClientImpl(KeyVaultManagementClientImpl client) { - this.service = - RestProxy.create(ManagedHsmsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(ManagedHsmsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -78,192 +81,140 @@ public final class ManagedHsmsClientImpl @Host("{$host}") @ServiceInterface(name = "KeyVaultManagementCl") public interface ManagedHsmsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ManagedHsmInner parameters, - @HeaderParam("Accept") String accept, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ManagedHsmInner parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ManagedHsmInner parameters, - @HeaderParam("Accept") String accept, + Mono>> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ManagedHsmInner parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}") - @ExpectedResponses({200, 204}) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs") - @ExpectedResponses({200}) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedManagedHSMs") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listDeleted( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> listDeleted(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono> getDeleted( - @HostParam("$host") String endpoint, - @PathParam("name") String name, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name}/purge") - @ExpectedResponses({202}) + Mono> getDeleted(@HostParam("$host") String endpoint, + @PathParam("name") String name, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name}/purge") + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono>> purgeDeleted( - @HostParam("$host") String endpoint, - @PathParam("name") String name, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono>> purgeDeleted(@HostParam("$host") String endpoint, + @PathParam("name") String name, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkMhsmNameAvailability") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkMhsmNameAvailability( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") CheckMhsmNameAvailabilityParameters mhsmName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) Mono> listDeletedNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, ManagedHsmInner parameters) { + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String name, + ManagedHsmInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -273,10 +224,8 @@ public Mono>> createOrUpdateWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -285,24 +234,14 @@ public Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, name, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -310,17 +249,15 @@ public Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String name, + ManagedHsmInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -330,10 +267,8 @@ private Mono>> createOrUpdateWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -342,21 +277,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), + this.client.getSubscriptionId(), parameters, accept, context); } /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -366,22 +293,16 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ManagedHsmInner> beginCreateOrUpdateAsync( - String resourceGroupName, String name, ManagedHsmInner parameters) { + public PollerFlux, ManagedHsmInner> beginCreateOrUpdateAsync(String resourceGroupName, + String name, ManagedHsmInner parameters) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ManagedHsmInner.class, - ManagedHsmInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedHsmInner.class, ManagedHsmInner.class, this.client.getContext()); } /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -392,20 +313,18 @@ public PollerFlux, ManagedHsmInner> beginCreateOrUpd * @return the {@link PollerFlux} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ManagedHsmInner> beginCreateOrUpdateAsync( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + private PollerFlux, ManagedHsmInner> beginCreateOrUpdateAsync(String resourceGroupName, + String name, ManagedHsmInner parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ManagedHsmInner.class, ManagedHsmInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, name, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedHsmInner.class, ManagedHsmInner.class, context); } /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -415,14 +334,14 @@ private PollerFlux, ManagedHsmInner> beginCreateOrUp * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedHsmInner> beginCreateOrUpdate( - String resourceGroupName, String name, ManagedHsmInner parameters) { + public SyncPoller, ManagedHsmInner> beginCreateOrUpdate(String resourceGroupName, + String name, ManagedHsmInner parameters) { return this.beginCreateOrUpdateAsync(resourceGroupName, name, parameters).getSyncPoller(); } /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -433,14 +352,14 @@ public SyncPoller, ManagedHsmInner> beginCreateOrUpd * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedHsmInner> beginCreateOrUpdate( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + public SyncPoller, ManagedHsmInner> beginCreateOrUpdate(String resourceGroupName, + String name, ManagedHsmInner parameters, Context context) { return this.beginCreateOrUpdateAsync(resourceGroupName, name, parameters, context).getSyncPoller(); } /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -450,16 +369,15 @@ public SyncPoller, ManagedHsmInner> beginCreateOrUpd * @return resource information with extended details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String name, ManagedHsmInner parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, name, parameters) - .last() + public Mono createOrUpdateAsync(String resourceGroupName, String name, + ManagedHsmInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, name, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -470,16 +388,15 @@ public Mono createOrUpdateAsync( * @return resource information with extended details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, parameters, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String name, ManagedHsmInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, parameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -495,7 +412,7 @@ public ManagedHsmInner createOrUpdate(String resourceGroupName, String name, Man /** * Create or update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to create or update the managed HSM Pool. @@ -506,31 +423,29 @@ public ManagedHsmInner createOrUpdate(String resourceGroupName, String name, Man * @return resource information with extended details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedHsmInner createOrUpdate( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + public ManagedHsmInner createOrUpdate(String resourceGroupName, String name, ManagedHsmInner parameters, + Context context) { return createOrUpdateAsync(resourceGroupName, name, parameters, context).block(); } /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync( - String resourceGroupName, String name, ManagedHsmInner parameters) { + public Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ManagedHsmInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -540,10 +455,8 @@ public Mono>> updateWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -552,24 +465,14 @@ public Mono>> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, name, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -577,17 +480,15 @@ public Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String name, + ManagedHsmInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -597,10 +498,8 @@ private Mono>> updateWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -609,21 +508,13 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.update(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), + this.client.getSubscriptionId(), parameters, accept, context); } /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -633,22 +524,16 @@ private Mono>> updateWithResponseAsync( * @return the {@link PollerFlux} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ManagedHsmInner> beginUpdateAsync( - String resourceGroupName, String name, ManagedHsmInner parameters) { + public PollerFlux, ManagedHsmInner> beginUpdateAsync(String resourceGroupName, + String name, ManagedHsmInner parameters) { Mono>> mono = updateWithResponseAsync(resourceGroupName, name, parameters); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - ManagedHsmInner.class, - ManagedHsmInner.class, - this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedHsmInner.class, ManagedHsmInner.class, this.client.getContext()); } /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -659,19 +544,17 @@ public PollerFlux, ManagedHsmInner> beginUpdateAsync * @return the {@link PollerFlux} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ManagedHsmInner> beginUpdateAsync( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + private PollerFlux, ManagedHsmInner> beginUpdateAsync(String resourceGroupName, + String name, ManagedHsmInner parameters, Context context) { context = this.client.mergeContext(context); Mono>> mono = updateWithResponseAsync(resourceGroupName, name, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ManagedHsmInner.class, ManagedHsmInner.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ManagedHsmInner.class, ManagedHsmInner.class, context); } /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -681,14 +564,14 @@ private PollerFlux, ManagedHsmInner> beginUpdateAsyn * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedHsmInner> beginUpdate( - String resourceGroupName, String name, ManagedHsmInner parameters) { + public SyncPoller, ManagedHsmInner> beginUpdate(String resourceGroupName, String name, + ManagedHsmInner parameters) { return this.beginUpdateAsync(resourceGroupName, name, parameters).getSyncPoller(); } /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -699,14 +582,14 @@ public SyncPoller, ManagedHsmInner> beginUpdate( * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedHsmInner> beginUpdate( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { + public SyncPoller, ManagedHsmInner> beginUpdate(String resourceGroupName, String name, + ManagedHsmInner parameters, Context context) { return this.beginUpdateAsync(resourceGroupName, name, parameters, context).getSyncPoller(); } /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -717,14 +600,13 @@ public SyncPoller, ManagedHsmInner> beginUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync(String resourceGroupName, String name, ManagedHsmInner parameters) { - return beginUpdateAsync(resourceGroupName, name, parameters) - .last() + return beginUpdateAsync(resourceGroupName, name, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -735,16 +617,15 @@ public Mono updateAsync(String resourceGroupName, String name, * @return resource information with extended details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String name, ManagedHsmInner parameters, Context context) { - return beginUpdateAsync(resourceGroupName, name, parameters, context) - .last() + private Mono updateAsync(String resourceGroupName, String name, ManagedHsmInner parameters, + Context context) { + return beginUpdateAsync(resourceGroupName, name, parameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -760,7 +641,7 @@ public ManagedHsmInner update(String resourceGroupName, String name, ManagedHsmI /** * Update a managed HSM Pool in the specified subscription. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param parameters Parameters to patch the managed HSM Pool. @@ -777,7 +658,7 @@ public ManagedHsmInner update(String resourceGroupName, String name, ManagedHsmI /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -788,10 +669,8 @@ public ManagedHsmInner update(String resourceGroupName, String name, ManagedHsmI @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -801,30 +680,19 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, name, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @param context The context to associate with this operation. @@ -834,13 +702,11 @@ public Mono>> deleteWithResponseAsync(String resourceG * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String name, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -850,27 +716,18 @@ private Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.delete(this.client.getEndpoint(), resourceGroupName, name, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -881,15 +738,13 @@ private Mono>> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @param context The context to associate with this operation. @@ -899,18 +754,17 @@ public PollerFlux, Void> beginDeleteAsync(String resourceGroupN * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String name, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -925,7 +779,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @param context The context to associate with this operation. @@ -941,7 +795,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -956,7 +810,7 @@ public Mono deleteAsync(String resourceGroupName, String name) { /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @param context The context to associate with this operation. @@ -972,7 +826,7 @@ private Mono deleteAsync(String resourceGroupName, String name, Context co /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -986,7 +840,7 @@ public void delete(String resourceGroupName, String name) { /** * Deletes the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool to delete. * @param context The context to associate with this operation. @@ -1001,7 +855,7 @@ public void delete(String resourceGroupName, String name, Context context) { /** * Gets the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1012,10 +866,8 @@ public void delete(String resourceGroupName, String name, Context context) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1025,30 +877,19 @@ public Mono> getByResourceGroupWithResponseAsync(Strin return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, name, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -1058,13 +899,11 @@ public Mono> getByResourceGroupWithResponseAsync(Strin * @return the specified managed HSM Pool along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String name, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1074,27 +913,18 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, name, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** * Gets the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1110,7 +940,7 @@ public Mono getByResourceGroupAsync(String resourceGroupName, S /** * Gets the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -1120,14 +950,14 @@ public Mono getByResourceGroupAsync(String resourceGroupName, S * @return the specified managed HSM Pool along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String name, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); } /** * Gets the specified managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name The name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1143,7 +973,7 @@ public ManagedHsmInner getByResourceGroup(String resourceGroupName, String name) /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1152,53 +982,33 @@ public ManagedHsmInner getByResourceGroup(String resourceGroupName, String name) * @return list of managed HSM Pools along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer top) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer top) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, top, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param top Maximum number of results to return. * @param context The context to associate with this operation. @@ -1208,50 +1018,33 @@ private Mono> listByResourceGroupSinglePageAsync( * @return list of managed HSM Pools along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer top, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Integer top, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, top, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1261,15 +1054,14 @@ private Mono> listByResourceGroupSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -1279,15 +1071,14 @@ public PagedFlux listByResourceGroupAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName) { final Integer top = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param top Maximum number of results to return. * @param context The context to associate with this operation. @@ -1297,17 +1088,16 @@ public PagedFlux listByResourceGroupAsync(String resourceGroupN * @return list of managed HSM Pools as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Integer top, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context), + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -1323,7 +1113,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNa /** * The List operation gets information about the managed HSM Pools associated with the subscription and within the * specified resource group. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param top Maximum number of results to return. * @param context The context to associate with this operation. @@ -1339,7 +1129,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNa /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -1349,44 +1139,25 @@ public PagedIterable listByResourceGroup(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), top, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1397,41 +1168,25 @@ private Mono> listSinglePageAsync(Integer top) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, + .list(this.client.getEndpoint(), top, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -1440,13 +1195,13 @@ private Mono> listSinglePageAsync(Integer top, Co */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(Integer top) { - return new PagedFlux<>( - () -> listSinglePageAsync(top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(top), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of managed HSM Pools as paginated response with {@link PagedFlux}. @@ -1454,13 +1209,13 @@ public PagedFlux listAsync(Integer top) { @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(top), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1470,14 +1225,13 @@ public PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(top, context), + return new PagedFlux<>(() -> listSinglePageAsync(top, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of managed HSM Pools as paginated response with {@link PagedIterable}. @@ -1490,7 +1244,7 @@ public PagedIterable list() { /** * The List operation gets information about the managed HSM Pools associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1505,109 +1259,76 @@ public PagedIterable list(Integer top, Context context) { /** * The List operation gets information about the deleted managed HSMs associated with the subscription. - * + * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deleted managed HSM Pools along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of deleted managed HSM Pools along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeletedSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listDeleted(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The List operation gets information about the deleted managed HSMs associated with the subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deleted managed HSM Pools along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of deleted managed HSM Pools along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeletedSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listDeleted(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * The List operation gets information about the deleted managed HSMs associated with the subscription. - * + * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of deleted managed HSM Pools as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDeletedAsync() { - return new PagedFlux<>( - () -> listDeletedSinglePageAsync(), nextLink -> listDeletedNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listDeletedSinglePageAsync(), + nextLink -> listDeletedNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the deleted managed HSMs associated with the subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -1616,13 +1337,13 @@ public PagedFlux listDeletedAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeletedAsync(Context context) { - return new PagedFlux<>( - () -> listDeletedSinglePageAsync(context), nextLink -> listDeletedNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listDeletedSinglePageAsync(context), + nextLink -> listDeletedNextSinglePageAsync(nextLink, context)); } /** * The List operation gets information about the deleted managed HSMs associated with the subscription. - * + * * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of deleted managed HSM Pools as paginated response with {@link PagedIterable}. @@ -1634,7 +1355,7 @@ public PagedIterable listDeleted() { /** * The List operation gets information about the deleted managed HSMs associated with the subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. @@ -1648,7 +1369,7 @@ public PagedIterable listDeleted(Context context) { /** * Gets the specified deleted managed HSM. - * + * * @param name The name of the deleted managed HSM. * @param location The location of the deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1659,10 +1380,8 @@ public PagedIterable listDeleted(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDeletedWithResponseAsync(String name, String location) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); @@ -1671,30 +1390,19 @@ public Mono> getDeletedWithResponseAsync(String return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getDeleted( - this.client.getEndpoint(), - name, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.getDeleted(this.client.getEndpoint(), name, location, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the specified deleted managed HSM. - * + * * @param name The name of the deleted managed HSM. * @param location The location of the deleted managed HSM. * @param context The context to associate with this operation. @@ -1704,13 +1412,11 @@ public Mono> getDeletedWithResponseAsync(String * @return the specified deleted managed HSM along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDeletedWithResponseAsync( - String name, String location, Context context) { + private Mono> getDeletedWithResponseAsync(String name, String location, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); @@ -1719,27 +1425,18 @@ private Mono> getDeletedWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getDeleted( - this.client.getEndpoint(), - name, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.getDeleted(this.client.getEndpoint(), name, location, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** * Gets the specified deleted managed HSM. - * + * * @param name The name of the deleted managed HSM. * @param location The location of the deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1754,7 +1451,7 @@ public Mono getDeletedAsync(String name, String location /** * Gets the specified deleted managed HSM. - * + * * @param name The name of the deleted managed HSM. * @param location The location of the deleted managed HSM. * @param context The context to associate with this operation. @@ -1770,7 +1467,7 @@ public Response getDeletedWithResponse(String name, Stri /** * Gets the specified deleted managed HSM. - * + * * @param name The name of the deleted managed HSM. * @param location The location of the deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1785,7 +1482,7 @@ public DeletedManagedHsmInner getDeleted(String name, String location) { /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1796,10 +1493,8 @@ public DeletedManagedHsmInner getDeleted(String name, String location) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> purgeDeletedWithResponseAsync(String name, String location) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); @@ -1808,30 +1503,19 @@ public Mono>> purgeDeletedWithResponseAsync(String nam return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .purgeDeleted( - this.client.getEndpoint(), - name, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.purgeDeleted(this.client.getEndpoint(), name, location, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @param context The context to associate with this operation. @@ -1841,13 +1525,11 @@ public Mono>> purgeDeletedWithResponseAsync(String nam * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> purgeDeletedWithResponseAsync( - String name, String location, Context context) { + private Mono>> purgeDeletedWithResponseAsync(String name, String location, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (name == null) { return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); @@ -1856,27 +1538,18 @@ private Mono>> purgeDeletedWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .purgeDeleted( - this.client.getEndpoint(), - name, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.purgeDeleted(this.client.getEndpoint(), name, location, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1887,15 +1560,13 @@ private Mono>> purgeDeletedWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, Void> beginPurgeDeletedAsync(String name, String location) { Mono>> mono = purgeDeletedWithResponseAsync(name, location); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @param context The context to associate with this operation. @@ -1908,14 +1579,13 @@ public PollerFlux, Void> beginPurgeDeletedAsync(String name, St private PollerFlux, Void> beginPurgeDeletedAsync(String name, String location, Context context) { context = this.client.mergeContext(context); Mono>> mono = purgeDeletedWithResponseAsync(name, location, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1930,7 +1600,7 @@ public SyncPoller, Void> beginPurgeDeleted(String name, String /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @param context The context to associate with this operation. @@ -1946,7 +1616,7 @@ public SyncPoller, Void> beginPurgeDeleted(String name, String /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1961,7 +1631,7 @@ public Mono purgeDeletedAsync(String name, String location) { /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @param context The context to associate with this operation. @@ -1977,7 +1647,7 @@ private Mono purgeDeletedAsync(String name, String location, Context conte /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1991,7 +1661,7 @@ public void purgeDeleted(String name, String location) { /** * Permanently deletes the specified managed HSM. - * + * * @param name The name of the soft-deleted managed HSM. * @param location The location of the soft-deleted managed HSM. * @param context The context to associate with this operation. @@ -2006,28 +1676,24 @@ public void purgeDeleted(String name, String location, Context context) { /** * Checks that the managed hsm name is valid and is not already in use. - * + * * @param mhsmName The name of the managed hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the CheckMhsmNameAvailability operation response along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkMhsmNameAvailabilityWithResponseAsync( - CheckMhsmNameAvailabilityParameters mhsmName) { + public Mono> + checkMhsmNameAvailabilityWithResponseAsync(CheckMhsmNameAvailabilityParameters mhsmName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (mhsmName == null) { return Mono.error(new IllegalArgumentException("Parameter mhsmName is required and cannot be null.")); @@ -2036,44 +1702,32 @@ public Mono> checkMhsmNameAvailab } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .checkMhsmNameAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - mhsmName, - accept, - context)) + .withContext(context -> service.checkMhsmNameAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), mhsmName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Checks that the managed hsm name is valid and is not already in use. - * + * * @param mhsmName The name of the managed hsm. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the CheckMhsmNameAvailability operation response along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkMhsmNameAvailabilityWithResponseAsync( - CheckMhsmNameAvailabilityParameters mhsmName, Context context) { + private Mono> + checkMhsmNameAvailabilityWithResponseAsync(CheckMhsmNameAvailabilityParameters mhsmName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (mhsmName == null) { return Mono.error(new IllegalArgumentException("Parameter mhsmName is required and cannot be null.")); @@ -2082,19 +1736,13 @@ private Mono> checkMhsmNameAvaila } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .checkMhsmNameAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - mhsmName, - accept, - context); + return service.checkMhsmNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), mhsmName, accept, context); } /** * Checks that the managed hsm name is valid and is not already in use. - * + * * @param mhsmName The name of the managed hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2102,14 +1750,14 @@ private Mono> checkMhsmNameAvaila * @return the CheckMhsmNameAvailability operation response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkMhsmNameAvailabilityAsync( - CheckMhsmNameAvailabilityParameters mhsmName) { + public Mono + checkMhsmNameAvailabilityAsync(CheckMhsmNameAvailabilityParameters mhsmName) { return checkMhsmNameAvailabilityWithResponseAsync(mhsmName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Checks that the managed hsm name is valid and is not already in use. - * + * * @param mhsmName The name of the managed hsm. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2118,14 +1766,14 @@ public Mono checkMhsmNameAvailabilityAsync * @return the CheckMhsmNameAvailability operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkMhsmNameAvailabilityWithResponse( - CheckMhsmNameAvailabilityParameters mhsmName, Context context) { + public Response + checkMhsmNameAvailabilityWithResponse(CheckMhsmNameAvailabilityParameters mhsmName, Context context) { return checkMhsmNameAvailabilityWithResponseAsync(mhsmName, context).block(); } /** * Checks that the managed hsm name is valid and is not already in use. - * + * * @param mhsmName The name of the managed hsm. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2133,16 +1781,15 @@ public Response checkMhsmNameAvailabilityW * @return the CheckMhsmNameAvailability operation response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckMhsmNameAvailabilityResultInner checkMhsmNameAvailability( - CheckMhsmNameAvailabilityParameters mhsmName) { + public CheckMhsmNameAvailabilityResultInner + checkMhsmNameAvailability(CheckMhsmNameAvailabilityParameters mhsmName) { return checkMhsmNameAvailabilityWithResponse(mhsmName, Context.NONE).getValue(); } /** * 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 ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2154,32 +1801,22 @@ private Mono> listByResourceGroupNextSinglePageAs return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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 ErrorException thrown if the request is rejected by server. @@ -2187,37 +1824,26 @@ private Mono> listByResourceGroupNextSinglePageAs * @return list of managed HSM Pools along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -2229,32 +1855,22 @@ private Mono> listBySubscriptionNextSinglePageAsy return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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 ErrorException thrown if the request is rejected by server. @@ -2262,42 +1878,31 @@ private Mono> listBySubscriptionNextSinglePageAsy * @return list of managed HSM Pools along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. + * + * @param 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 ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of deleted managed HSM Pools along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of deleted managed HSM Pools along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeletedNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listDeletedNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listDeletedNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listDeletedNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmPrivateEndpointConnectionsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmPrivateEndpointConnectionsClientImpl.java index 67e44896ebac2..3686db13b293a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmPrivateEndpointConnectionsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmPrivateEndpointConnectionsClientImpl.java @@ -40,26 +40,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MhsmPrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in MhsmPrivateEndpointConnectionsClient. + */ public final class MhsmPrivateEndpointConnectionsClientImpl implements MhsmPrivateEndpointConnectionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final MhsmPrivateEndpointConnectionsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final KeyVaultManagementClientImpl client; /** * Initializes an instance of MhsmPrivateEndpointConnectionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ MhsmPrivateEndpointConnectionsClientImpl(KeyVaultManagementClientImpl client) { - this.service = - RestProxy - .create( - MhsmPrivateEndpointConnectionsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); + this.service = RestProxy.create(MhsmPrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -70,102 +72,77 @@ public final class MhsmPrivateEndpointConnectionsClientImpl implements MhsmPriva @Host("{$host}") @ServiceInterface(name = "KeyVaultManagementCl") public interface MhsmPrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResource( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + Mono> listByResource(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono put( - @HostParam("$host") String endpoint, + Mono put(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") MhsmPrivateEndpointConnectionInner properties, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) Mono> listByResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync( - String resourceGroupName, String name) { + private Mono> + listByResourceSinglePageAsync(String resourceGroupName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -176,32 +153,16 @@ private Mono> listByResourceSi } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResource( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -209,22 +170,18 @@ private Mono> listByResourceSi * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync( - String resourceGroupName, String name, Context context) { + private Mono> + listByResourceSinglePageAsync(String resourceGroupName, String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -236,46 +193,32 @@ private Mono> listByResourceSi final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResource( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResource(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listByResourceSinglePageAsync(resourceGroupName, name), + return new PagedFlux<>(() -> listByResourceSinglePageAsync(resourceGroupName, name), nextLink -> listByResourceNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -283,26 +226,25 @@ public PagedFlux listByResourceAsync(String * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listByResourceSinglePageAsync(resourceGroupName, name, context), + private PagedFlux listByResourceAsync(String resourceGroupName, String name, + Context context) { + return new PagedFlux<>(() -> listByResourceSinglePageAsync(resourceGroupName, name, context), nextLink -> listByResourceNextSinglePageAsync(nextLink, context)); } /** * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResource(String resourceGroupName, String name) { @@ -311,7 +253,7 @@ public PagedIterable listByResource(String r /** * The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -319,41 +261,37 @@ public PagedIterable listByResource(String r * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResource( - String resourceGroupName, String name, Context context) { + public PagedIterable listByResource(String resourceGroupName, String name, + Context context) { return new PagedIterable<>(listByResourceAsync(resourceGroupName, name, context)); } /** * Gets the specified private endpoint connection associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the managed HSM Pool along with {@link - * Response} on successful completion of {@link Mono}. + * @return the specified private endpoint connection associated with the managed HSM Pool along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String name, String privateEndpointConnectionName) { + public Mono> getWithResponseAsync(String resourceGroupName, + String name, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -363,56 +301,40 @@ public Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, name, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the specified private endpoint connection associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the managed HSM Pool along with {@link - * Response} on successful completion of {@link Mono}. + * @return the specified private endpoint connection associated with the managed HSM Pool along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String name, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -422,90 +344,80 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, + privateEndpointConnectionName, this.client.getApiVersion(), accept, context); } /** * Gets the specified private endpoint connection associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the managed HSM Pool on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String name, String privateEndpointConnectionName) { + public Mono getAsync(String resourceGroupName, String name, + String privateEndpointConnectionName) { return getWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the specified private endpoint connection associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the managed HSM Pool along with {@link - * Response}. + * @return the specified private endpoint connection associated with the managed HSM Pool along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + public Response getWithResponse(String resourceGroupName, String name, + String privateEndpointConnectionName, Context context) { return getWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, context).block(); } /** * Gets the specified private endpoint connection associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the managed HSM Pool. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MhsmPrivateEndpointConnectionInner get( - String resourceGroupName, String name, String privateEndpointConnectionName) { + public MhsmPrivateEndpointConnectionInner get(String resourceGroupName, String name, + String privateEndpointConnectionName) { return getWithResponse(resourceGroupName, name, privateEndpointConnectionName, Context.NONE).getValue(); } /** * Updates the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param properties The intended state of private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -513,22 +425,15 @@ public MhsmPrivateEndpointConnectionInner get( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putWithResponseAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - MhsmPrivateEndpointConnectionInner properties) { + public Mono putWithResponseAsync(String resourceGroupName, String name, + String privateEndpointConnectionName, MhsmPrivateEndpointConnectionInner properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -538,10 +443,8 @@ public Mono putWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); @@ -551,28 +454,18 @@ public Mono putWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .put( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getApiVersion(), - properties, - accept, - context)) + context -> service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + name, privateEndpointConnectionName, this.client.getApiVersion(), properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param properties The intended state of private endpoint connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -581,23 +474,15 @@ public Mono putWithResponseAsync( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putWithResponseAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - MhsmPrivateEndpointConnectionInner properties, - Context context) { + private Mono putWithResponseAsync(String resourceGroupName, String name, + String privateEndpointConnectionName, MhsmPrivateEndpointConnectionInner properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -607,10 +492,8 @@ private Mono putWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); @@ -619,26 +502,17 @@ private Mono putWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .put( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getApiVersion(), - properties, - accept, - context); + return service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, + privateEndpointConnectionName, this.client.getApiVersion(), properties, accept, context); } /** * Updates the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param properties The intended state of private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -646,22 +520,19 @@ private Mono putWithResponseAsync( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - MhsmPrivateEndpointConnectionInner properties) { + public Mono putAsync(String resourceGroupName, String name, + String privateEndpointConnectionName, MhsmPrivateEndpointConnectionInner properties) { return putWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, properties) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Updates the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param properties The intended state of private endpoint connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -670,23 +541,19 @@ public Mono putAsync( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MhsmPrivateEndpointConnectionsPutResponse putWithResponse( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - MhsmPrivateEndpointConnectionInner properties, - Context context) { + public MhsmPrivateEndpointConnectionsPutResponse putWithResponse(String resourceGroupName, String name, + String privateEndpointConnectionName, MhsmPrivateEndpointConnectionInner properties, Context context) { return putWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, properties, context) .block(); } /** * Updates the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param properties The intended state of private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -694,42 +561,35 @@ public MhsmPrivateEndpointConnectionsPutResponse putWithResponse( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MhsmPrivateEndpointConnectionInner put( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - MhsmPrivateEndpointConnectionInner properties) { + public MhsmPrivateEndpointConnectionInner put(String resourceGroupName, String name, + String privateEndpointConnectionName, MhsmPrivateEndpointConnectionInner properties) { return putWithResponse(resourceGroupName, name, privateEndpointConnectionName, properties, Context.NONE) .getValue(); } /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String name, String privateEndpointConnectionName) { + public Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -739,56 +599,40 @@ public Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, name, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -798,32 +642,22 @@ private Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, name, + privateEndpointConnectionName, this.client.getApiVersion(), accept, context); } /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -832,25 +666,20 @@ private Mono>> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, MhsmPrivateEndpointConnectionInner> beginDeleteAsync(String resourceGroupName, String name, String privateEndpointConnectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - MhsmPrivateEndpointConnectionInner.class, - MhsmPrivateEndpointConnectionInner.class, - this.client.getContext()); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MhsmPrivateEndpointConnectionInner.class, + MhsmPrivateEndpointConnectionInner.class, this.client.getContext()); } /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @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. @@ -861,43 +690,38 @@ private Mono>> deleteWithResponseAsync( private PollerFlux, MhsmPrivateEndpointConnectionInner> beginDeleteAsync(String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - MhsmPrivateEndpointConnectionInner.class, - MhsmPrivateEndpointConnectionInner.class, - context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MhsmPrivateEndpointConnectionInner.class, + MhsmPrivateEndpointConnectionInner.class, context); } /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MhsmPrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String name, String privateEndpointConnectionName) { + public SyncPoller, MhsmPrivateEndpointConnectionInner> + beginDelete(String resourceGroupName, String name, String privateEndpointConnectionName) { return this.beginDeleteAsync(resourceGroupName, name, privateEndpointConnectionName).getSyncPoller(); } /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @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. @@ -905,38 +729,37 @@ public SyncPoller, MhsmPrivateEnd * @return the {@link SyncPoller} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MhsmPrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + public SyncPoller, MhsmPrivateEndpointConnectionInner> + beginDelete(String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { return this.beginDeleteAsync(resourceGroupName, name, privateEndpointConnectionName, context).getSyncPoller(); } /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String name, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, name, privateEndpointConnectionName) - .last() + public Mono deleteAsync(String resourceGroupName, String name, + String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, name, privateEndpointConnectionName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @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. @@ -944,38 +767,37 @@ public Mono deleteAsync( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, name, privateEndpointConnectionName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String name, + String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, name, privateEndpointConnectionName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MhsmPrivateEndpointConnectionInner delete( - String resourceGroupName, String name, String privateEndpointConnectionName) { + public MhsmPrivateEndpointConnectionInner delete(String resourceGroupName, String name, + String privateEndpointConnectionName) { return deleteAsync(resourceGroupName, name, privateEndpointConnectionName).block(); } /** * Deletes the specified private endpoint connection associated with the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the managed hsm - * pool. + * pool. * @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. @@ -983,21 +805,20 @@ public MhsmPrivateEndpointConnectionInner delete( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MhsmPrivateEndpointConnectionInner delete( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + public MhsmPrivateEndpointConnectionInner delete(String resourceGroupName, String name, + String privateEndpointConnectionName, Context context) { return deleteAsync(resourceGroupName, name, privateEndpointConnectionName, context).block(); } /** * 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 ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceNextSinglePageAsync(String nextLink) { @@ -1005,62 +826,42 @@ private Mono> listByResourceNe return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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 ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of private endpoint connections associated with a managed HSM Pools along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmPrivateLinkResourcesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmPrivateLinkResourcesClientImpl.java index 39f0b25a31d34..9ddd5e25a105c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmPrivateLinkResourcesClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmPrivateLinkResourcesClientImpl.java @@ -25,23 +25,28 @@ import com.azure.resourcemanager.keyvault.fluent.models.MhsmPrivateLinkResourceListResultInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MhsmPrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in MhsmPrivateLinkResourcesClient. + */ public final class MhsmPrivateLinkResourcesClientImpl implements MhsmPrivateLinkResourcesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final MhsmPrivateLinkResourcesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final KeyVaultManagementClientImpl client; /** * Initializes an instance of MhsmPrivateLinkResourcesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ MhsmPrivateLinkResourcesClientImpl(KeyVaultManagementClientImpl client) { - this.service = - RestProxy - .create(MhsmPrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(MhsmPrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -52,46 +57,37 @@ public final class MhsmPrivateLinkResourcesClientImpl implements MhsmPrivateLink @Host("{$host}") @ServiceInterface(name = "KeyVaultManagementCl") public interface MhsmPrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateLinkResources") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/privateLinkResources") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByMhsmResource( - @HostParam("$host") String endpoint, + Mono> listByMhsmResource(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** * Gets the private link resources supported for the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources supported for the managed hsm pool along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByMhsmResourceWithResponseAsync( - String resourceGroupName, String name) { + public Mono> + listByMhsmResourceWithResponseAsync(String resourceGroupName, String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -102,23 +98,14 @@ public Mono> listByMhsmResource } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByMhsmResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.listByMhsmResource(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, name, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the private link resources supported for the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -126,22 +113,18 @@ public Mono> listByMhsmResource * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources supported for the managed hsm pool along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByMhsmResourceWithResponseAsync( - String resourceGroupName, String name, Context context) { + private Mono> + listByMhsmResourceWithResponseAsync(String resourceGroupName, String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -152,20 +135,13 @@ private Mono> listByMhsmResourc } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByMhsmResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - this.client.getApiVersion(), - accept, - context); + return service.listByMhsmResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + name, this.client.getApiVersion(), accept, context); } /** * Gets the private link resources supported for the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -181,7 +157,7 @@ public Mono listByMhsmResourceAsync(Stri /** * Gets the private link resources supported for the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -191,14 +167,14 @@ public Mono listByMhsmResourceAsync(Stri * @return the private link resources supported for the managed hsm pool along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByMhsmResourceWithResponse( - String resourceGroupName, String name, Context context) { + public Response listByMhsmResourceWithResponse(String resourceGroupName, + String name, Context context) { return listByMhsmResourceWithResponseAsync(resourceGroupName, name, context).block(); } /** * Gets the private link resources supported for the managed hsm pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmRegionsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmRegionsClientImpl.java index d31cfad833fec..444746523b206 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmRegionsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/MhsmRegionsClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.keyvault.models.MhsmRegionsListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MhsmRegionsClient. */ +/** + * An instance of this class provides access to all the operations defined in MhsmRegionsClient. + */ public final class MhsmRegionsClientImpl implements MhsmRegionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final MhsmRegionsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final KeyVaultManagementClientImpl client; /** * Initializes an instance of MhsmRegionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ MhsmRegionsClientImpl(KeyVaultManagementClientImpl client) { - this.service = - RestProxy.create(MhsmRegionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(MhsmRegionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,56 +62,45 @@ public final class MhsmRegionsClientImpl implements MhsmRegionsClient { @Host("{$host}") @ServiceInterface(name = "KeyVaultManagementCl") public interface MhsmRegionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/regions") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/managedHSMs/{name}/regions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) - Mono> listByResource( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResource(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ErrorException.class) Mono> listByResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * The List operation gets information about the regions associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of regions associated with a managed HSM Pools along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync( - String resourceGroupName, String name) { + private Mono> listByResourceSinglePageAsync(String resourceGroupName, + String name) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -116,32 +111,16 @@ private Mono> listByResourceSinglePa } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResource( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The List operation gets information about the regions associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -149,22 +128,18 @@ private Mono> listByResourceSinglePa * @throws ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of regions associated with a managed HSM Pools along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync( - String resourceGroupName, String name, Context context) { + private Mono> listByResourceSinglePageAsync(String resourceGroupName, + String name, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -176,28 +151,15 @@ private Mono> listByResourceSinglePa final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResource( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - name, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResource(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, name, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * The List operation gets information about the regions associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -207,14 +169,13 @@ private Mono> listByResourceSinglePa */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceAsync(String resourceGroupName, String name) { - return new PagedFlux<>( - () -> listByResourceSinglePageAsync(resourceGroupName, name), + return new PagedFlux<>(() -> listByResourceSinglePageAsync(resourceGroupName, name), nextLink -> listByResourceNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the regions associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -224,16 +185,15 @@ public PagedFlux listByResourceAsync(String resour * @return list of regions associated with a managed HSM Pools as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceAsync( - String resourceGroupName, String name, Context context) { - return new PagedFlux<>( - () -> listByResourceSinglePageAsync(resourceGroupName, name, context), + private PagedFlux listByResourceAsync(String resourceGroupName, String name, + Context context) { + return new PagedFlux<>(() -> listByResourceSinglePageAsync(resourceGroupName, name, context), nextLink -> listByResourceNextSinglePageAsync(nextLink, context)); } /** * The List operation gets information about the regions associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -248,7 +208,7 @@ public PagedIterable listByResource(String resourc /** * The List operation gets information about the regions associated with the managed HSM Pool. - * + * * @param resourceGroupName Name of the resource group that contains the managed HSM pool. * @param name Name of the managed HSM Pool. * @param context The context to associate with this operation. @@ -258,21 +218,20 @@ public PagedIterable listByResource(String resourc * @return list of regions associated with a managed HSM Pools as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResource( - String resourceGroupName, String name, Context context) { + public PagedIterable listByResource(String resourceGroupName, String name, + Context context) { return new PagedIterable<>(listByResourceAsync(resourceGroupName, name, 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 ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of regions associated with a managed HSM Pools along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceNextSinglePageAsync(String nextLink) { @@ -280,62 +239,42 @@ private Mono> listByResourceNextSing return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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 ErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of regions associated with a managed HSM Pools along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/OperationsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/OperationsClientImpl.java index 30c094434c012..77f6db11fab92 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/OperationsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/OperationsClientImpl.java @@ -30,22 +30,28 @@ import com.azure.resourcemanager.keyvault.models.OperationListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final KeyVaultManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(KeyVaultManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -56,95 +62,70 @@ public final class OperationsClientImpl implements OperationsClient { @Host("{$host}") @ServiceInterface(name = "KeyVaultManagementCl") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.KeyVault/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Lists all of the available Key Vault Rest API operations. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list Storage operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all of the available Key Vault Rest API operations. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list Storage operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all of the available Key Vault Rest API operations. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list Storage operations as paginated response with {@link PagedFlux}. @@ -156,7 +137,7 @@ public PagedFlux listAsync() { /** * Lists all of the available Key Vault Rest API operations. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -165,13 +146,13 @@ public PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists all of the available Key Vault Rest API operations. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list Storage operations as paginated response with {@link PagedIterable}. @@ -183,7 +164,7 @@ public PagedIterable list() { /** * Lists all of the available Key Vault Rest API operations. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -197,14 +178,13 @@ 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. * @return result of the request to list Storage operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -212,37 +192,26 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of the request to list Storage operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -250,23 +219,13 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateEndpointConnectionsClientImpl.java index 4ceeb89917f56..ab69aff00d135 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateEndpointConnectionsClientImpl.java @@ -39,24 +39,28 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. + */ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PrivateEndpointConnectionsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final KeyVaultManagementClientImpl client; /** * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ PrivateEndpointConnectionsClientImpl(KeyVaultManagementClientImpl client) { - this.service = - RestProxy - .create( - PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -67,80 +71,59 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi @Host("{$host}") @ServiceInterface(name = "KeyVaultManagementCl") public interface PrivateEndpointConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono put( - @HostParam("$host") String endpoint, + Mono put(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PrivateEndpointConnectionInner properties, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResource( - @HostParam("$host") String endpoint, + Mono> listByResource(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Gets the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -148,22 +131,18 @@ Mono> listByResourceNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the key vault along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + public Mono> getWithResponseAsync(String resourceGroupName, + String vaultName, String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -173,31 +152,20 @@ public Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context)) + context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vaultName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -206,22 +174,18 @@ public Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the key vault along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, + String vaultName, String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -231,28 +195,18 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, vaultName, + privateEndpointConnectionName, this.client.getApiVersion(), accept, context); } /** * Gets the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -260,18 +214,18 @@ private Mono> getWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified private endpoint connection associated with the key vault on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + public Mono getAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName) { return getWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -282,14 +236,14 @@ public Mono getAsync( * @return the specified private endpoint connection associated with the key vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + public Response getWithResponse(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, Context context) { return getWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context).block(); } /** * Gets the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -299,14 +253,14 @@ public Response getWithResponse( * @return the specified private endpoint connection associated with the key vault. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + public PrivateEndpointConnectionInner get(String resourceGroupName, String vaultName, + String privateEndpointConnectionName) { return getWithResponse(resourceGroupName, vaultName, privateEndpointConnectionName, Context.NONE).getValue(); } /** * Updates the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -317,22 +271,15 @@ public PrivateEndpointConnectionInner get( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putWithResponseAsync( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { + public Mono putWithResponseAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -342,10 +289,8 @@ public Mono putWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); @@ -355,24 +300,14 @@ public Mono putWithResponseAsync( final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .put( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - properties, - accept, - context)) + context -> service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vaultName, privateEndpointConnectionName, this.client.getApiVersion(), properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -384,23 +319,15 @@ public Mono putWithResponseAsync( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putWithResponseAsync( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context) { + private Mono putWithResponseAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -410,10 +337,8 @@ private Mono putWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); @@ -422,22 +347,13 @@ private Mono putWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .put( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - properties, - accept, - context); + return service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, vaultName, + privateEndpointConnectionName, this.client.getApiVersion(), properties, accept, context); } /** * Updates the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -448,18 +364,15 @@ private Mono putWithResponseAsync( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putAsync( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { + public Mono putAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { return putWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Updates the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -471,19 +384,15 @@ public Mono putAsync( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionsPutResponse putWithResponse( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, - Context context) { + public PrivateEndpointConnectionsPutResponse putWithResponse(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { return putWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, properties, context) .block(); } /** * Updates the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -494,41 +403,34 @@ public PrivateEndpointConnectionsPutResponse putWithResponse( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner put( - String resourceGroupName, - String vaultName, - String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { + public PrivateEndpointConnectionInner put(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { return putWithResponse(resourceGroupName, vaultName, privateEndpointConnectionName, properties, Context.NONE) .getValue(); } /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + public Mono>> deleteWithResponseAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -538,31 +440,20 @@ public Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context)) + context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vaultName, privateEndpointConnectionName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -570,23 +461,19 @@ public Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection resource along with {@link Response} on successful completion of {@link - * Mono}. + * @return private endpoint connection resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -596,28 +483,18 @@ private Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - privateEndpointConnectionName, - this.client.getApiVersion(), - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, vaultName, + privateEndpointConnectionName, this.client.getApiVersion(), accept, context); } /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -627,23 +504,18 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, PrivateEndpointConnectionInner> beginDeleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - this.client.getContext()); + public PollerFlux, PrivateEndpointConnectionInner> + beginDeleteAsync(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + this.client.getContext()); } /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -657,21 +529,16 @@ public PollerFlux, PrivateEndpointCon private PollerFlux, PrivateEndpointConnectionInner> beginDeleteAsync( String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionInner.class, - PrivateEndpointConnectionInner.class, - context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, + context); } /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -681,14 +548,14 @@ private PollerFlux, PrivateEndpointCo * @return the {@link SyncPoller} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + public SyncPoller, PrivateEndpointConnectionInner> + beginDelete(String resourceGroupName, String vaultName, String privateEndpointConnectionName) { return this.beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName).getSyncPoller(); } /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -699,16 +566,15 @@ public SyncPoller, PrivateEndpointCon * @return the {@link SyncPoller} for polling of private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateEndpointConnectionInner> beginDelete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { - return this - .beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context) + public SyncPoller, PrivateEndpointConnectionInner> + beginDelete(String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + return this.beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context) .getSyncPoller(); } /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -718,16 +584,15 @@ public SyncPoller, PrivateEndpointCon * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName) - .last() + public Mono deleteAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -738,16 +603,15 @@ public Mono deleteAsync( * @return private endpoint connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -757,14 +621,14 @@ private Mono deleteAsync( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner delete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName) { + public PrivateEndpointConnectionInner delete(String resourceGroupName, String vaultName, + String privateEndpointConnectionName) { return deleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName).block(); } /** * Deletes the specified private endpoint connection associated with the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param privateEndpointConnectionName Name of the private endpoint connection associated with the key vault. @@ -775,36 +639,32 @@ public PrivateEndpointConnectionInner delete( * @return private endpoint connection resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner delete( - String resourceGroupName, String vaultName, String privateEndpointConnectionName, Context context) { + public PrivateEndpointConnectionInner delete(String resourceGroupName, String vaultName, + String privateEndpointConnectionName, Context context) { return deleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName, context).block(); } /** * The List operation gets information about the private endpoint connections associated with the vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync( - String resourceGroupName, String vaultName) { + private Mono> listByResourceSinglePageAsync(String resourceGroupName, + String vaultName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -815,55 +675,35 @@ private Mono> listByResourceSingle } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResource(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The List operation gets information about the private endpoint connections associated with the vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceSinglePageAsync( - String resourceGroupName, String vaultName, Context context) { + private Mono> listByResourceSinglePageAsync(String resourceGroupName, + String vaultName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -875,28 +715,15 @@ private Mono> listByResourceSingle final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResource(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, vaultName, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * The List operation gets information about the private endpoint connections associated with the vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -906,14 +733,13 @@ private Mono> listByResourceSingle */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceAsync(String resourceGroupName, String vaultName) { - return new PagedFlux<>( - () -> listByResourceSinglePageAsync(resourceGroupName, vaultName), + return new PagedFlux<>(() -> listByResourceSinglePageAsync(resourceGroupName, vaultName), nextLink -> listByResourceNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the private endpoint connections associated with the vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param context The context to associate with this operation. @@ -923,16 +749,15 @@ public PagedFlux listByResourceAsync(String reso * @return list of private endpoint connections as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceAsync( - String resourceGroupName, String vaultName, Context context) { - return new PagedFlux<>( - () -> listByResourceSinglePageAsync(resourceGroupName, vaultName, context), + private PagedFlux listByResourceAsync(String resourceGroupName, String vaultName, + Context context) { + return new PagedFlux<>(() -> listByResourceSinglePageAsync(resourceGroupName, vaultName, context), nextLink -> listByResourceNextSinglePageAsync(nextLink, context)); } /** * The List operation gets information about the private endpoint connections associated with the vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -947,7 +772,7 @@ public PagedIterable listByResource(String resou /** * The List operation gets information about the private endpoint connections associated with the vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param context The context to associate with this operation. @@ -957,21 +782,20 @@ public PagedIterable listByResource(String resou * @return list of private endpoint connections as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResource( - String resourceGroupName, String vaultName, Context context) { + public PagedIterable listByResource(String resourceGroupName, String vaultName, + Context context) { return new PagedIterable<>(listByResourceAsync(resourceGroupName, vaultName, 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. - * @return list of private endpoint connections along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceNextSinglePageAsync(String nextLink) { @@ -979,62 +803,42 @@ private Mono> listByResourceNextSi return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connections along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByResourceNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateLinkResourcesClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateLinkResourcesClientImpl.java index 853102a1760cb..9519b6eaa568d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/PrivateLinkResourcesClientImpl.java @@ -25,23 +25,28 @@ import com.azure.resourcemanager.keyvault.fluent.models.PrivateLinkResourceListResultInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. + */ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final PrivateLinkResourcesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final KeyVaultManagementClientImpl client; /** * Initializes an instance of PrivateLinkResourcesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ PrivateLinkResourcesClientImpl(KeyVaultManagementClientImpl client) { - this.service = - RestProxy - .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -52,46 +57,37 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource @Host("{$host}") @ServiceInterface(name = "KeyVaultManagementCl") public interface PrivateLinkResourcesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateLinkResources") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/privateLinkResources") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByVault( - @HostParam("$host") String endpoint, + Mono> listByVault(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** * Gets the private link resources supported for the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources supported for the key vault along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByVaultWithResponseAsync( - String resourceGroupName, String vaultName) { + public Mono> listByVaultWithResponseAsync(String resourceGroupName, + String vaultName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -102,23 +98,14 @@ public Mono> listByVaultWithRespons } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByVault( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.listByVault(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the private link resources supported for the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param context The context to associate with this operation. @@ -126,22 +113,18 @@ public Mono> listByVaultWithRespons * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources supported for the key vault along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByVaultWithResponseAsync( - String resourceGroupName, String vaultName, Context context) { + private Mono> listByVaultWithResponseAsync(String resourceGroupName, + String vaultName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -152,20 +135,13 @@ private Mono> listByVaultWithRespon } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByVault( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - accept, - context); + return service.listByVault(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + vaultName, this.client.getApiVersion(), accept, context); } /** * Gets the private link resources supported for the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -181,7 +157,7 @@ public Mono listByVaultAsync(String resource /** * Gets the private link resources supported for the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @param context The context to associate with this operation. @@ -191,14 +167,14 @@ public Mono listByVaultAsync(String resource * @return the private link resources supported for the key vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByVaultWithResponse( - String resourceGroupName, String vaultName, Context context) { + public Response listByVaultWithResponse(String resourceGroupName, + String vaultName, Context context) { return listByVaultWithResponseAsync(resourceGroupName, vaultName, context).block(); } /** * Gets the private link resources supported for the key vault. - * + * * @param resourceGroupName Name of the resource group that contains the key vault. * @param vaultName The name of the key vault. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/SecretsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/SecretsClientImpl.java new file mode 100644 index 0000000000000..31ba2d69c1246 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/SecretsClientImpl.java @@ -0,0 +1,782 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.keyvault.fluent.SecretsClient; +import com.azure.resourcemanager.keyvault.fluent.models.SecretInner; +import com.azure.resourcemanager.keyvault.models.SecretCreateOrUpdateParameters; +import com.azure.resourcemanager.keyvault.models.SecretListResult; +import com.azure.resourcemanager.keyvault.models.SecretPatchParameters; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SecretsClient. + */ +public final class SecretsClientImpl implements SecretsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SecretsService service; + + /** + * The service client containing this operation class. + */ + private final KeyVaultManagementClientImpl client; + + /** + * Initializes an instance of SecretsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SecretsClientImpl(KeyVaultManagementClientImpl client) { + this.service = RestProxy.create(SecretsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for KeyVaultManagementClientSecrets to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "KeyVaultManagementCl") + public interface SecretsService { + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("secretName") String secretName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecretCreateOrUpdateParameters parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("secretName") String secretName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") SecretPatchParameters parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("secretName") String secretName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal + * use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @param parameters Parameters to create or update the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String vaultName, + String secretName, SecretCreateOrUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, vaultName, + secretName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal + * use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @param parameters Parameters to create or update the secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String vaultName, + String secretName, SecretCreateOrUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, vaultName, secretName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal + * use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @param parameters Parameters to create or update the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String vaultName, String secretName, + SecretCreateOrUpdateParameters parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, secretName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal + * use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @param parameters Parameters to create or update the secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String vaultName, + String secretName, SecretCreateOrUpdateParameters parameters, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, secretName, parameters, context).block(); + } + + /** + * Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal + * use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. The value you provide may be copied globally for the purpose of running the + * service. The value provided should not include personally identifiable or sensitive information. + * @param parameters Parameters to create or update the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner createOrUpdate(String resourceGroupName, String vaultName, String secretName, + SecretCreateOrUpdateParameters parameters) { + return createOrUpdateWithResponse(resourceGroupName, vaultName, secretName, parameters, Context.NONE) + .getValue(); + } + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. + * Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. + * @param parameters Parameters to patch the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWithResponseAsync(String resourceGroupName, String vaultName, + String secretName, SecretPatchParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, vaultName, secretName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. + * Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. + * @param parameters Parameters to patch the secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, String vaultName, + String secretName, SecretPatchParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), resourceGroupName, vaultName, secretName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + } + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. + * Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. + * @param parameters Parameters to patch the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String vaultName, String secretName, + SecretPatchParameters parameters) { + return updateWithResponseAsync(resourceGroupName, vaultName, secretName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. + * Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. + * @param parameters Parameters to patch the secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String vaultName, String secretName, + SecretPatchParameters parameters, Context context) { + return updateWithResponseAsync(resourceGroupName, vaultName, secretName, parameters, context).block(); + } + + /** + * Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. + * Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName Name of the vault. + * @param secretName Name of the secret. + * @param parameters Parameters to patch the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource information with extended details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner update(String resourceGroupName, String vaultName, String secretName, + SecretPatchParameters parameters) { + return updateWithResponse(resourceGroupName, vaultName, secretName, parameters, Context.NONE).getValue(); + } + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the + * data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String vaultName, + String secretName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, vaultName, secretName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the + * data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, + String secretName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (secretName == null) { + return Mono.error(new IllegalArgumentException("Parameter secretName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), resourceGroupName, vaultName, secretName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + } + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the + * data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String vaultName, String secretName) { + return getWithResponseAsync(resourceGroupName, vaultName, secretName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the + * data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vaultName, String secretName, + Context context) { + return getWithResponseAsync(resourceGroupName, vaultName, secretName, context).block(); + } + + /** + * Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the + * data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param secretName The name of the secret. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified secret. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SecretInner get(String resourceGroupName, String vaultName, String secretName) { + return getWithResponse(resourceGroupName, vaultName, secretName, Context.NONE).getValue(); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String vaultName, + Integer top) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, vaultName, top, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String vaultName, + Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (vaultName == null) { + return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), resourceGroupName, vaultName, top, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String vaultName, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String vaultName) { + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, top), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, Integer top, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + final Integer top = null; + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, top)); + } + + /** + * The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in + * ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + * + * @param resourceGroupName The name of the Resource Group to which the vault belongs. + * @param vaultName The name of the vault. + * @param top Maximum number of results to return. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, Integer top, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, vaultName, top, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of secrets along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsClientImpl.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsClientImpl.java index 5b8ec18a92262..9576953374b92 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsClientImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/implementation/VaultsClientImpl.java @@ -52,17 +52,23 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in VaultsClient. */ +/** + * An instance of this class provides access to all the operations defined in VaultsClient. + */ public final class VaultsClientImpl implements InnerSupportsGet, InnerSupportsDelete, VaultsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final VaultsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final KeyVaultManagementClientImpl client; /** * Initializes an instance of VaultsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ VaultsClientImpl(KeyVaultManagementClientImpl client) { @@ -77,230 +83,166 @@ public final class VaultsClientImpl implements InnerSupportsGet, Inn @Host("{$host}") @ServiceInterface(name = "KeyVaultManagementCl") public interface VaultsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") VaultCreateOrUpdateParameters parameters, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VaultPatchParameters parameters, - @HeaderParam("Accept") String accept, + Mono> update(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") VaultPatchParameters parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") - @ExpectedResponses({200, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") - @ExpectedResponses({200}) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/accessPolicies/{operationKind}") - @ExpectedResponses({200, 201}) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/accessPolicies/{operationKind}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateAccessPolicy( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vaultName") String vaultName, + Mono> updateAccessPolicy(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, @PathParam("operationKind") AccessPolicyUpdateKind operationKind, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") VaultAccessPolicyParametersInner parameters, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/vaults") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( - @HostParam("$host") String endpoint, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> listBySubscription(@HostParam("$host") String endpoint, + @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeleted( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> listDeleted(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getDeleted( - @HostParam("$host") String endpoint, - @PathParam("vaultName") String vaultName, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge") - @ExpectedResponses({200, 202}) + Mono> getDeleted(@HostParam("$host") String endpoint, + @PathParam("vaultName") String vaultName, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> purgeDeleted( - @HostParam("$host") String endpoint, - @PathParam("vaultName") String vaultName, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono>> purgeDeleted(@HostParam("$host") String endpoint, + @PathParam("vaultName") String vaultName, @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resources") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> checkNameAvailability(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") VaultCheckNameAvailabilityParameters vaultName, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listDeletedNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -310,10 +252,8 @@ public Mono>> createOrUpdateWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -322,24 +262,14 @@ public Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, vaultName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -347,17 +277,15 @@ public Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -367,10 +295,8 @@ private Mono>> createOrUpdateWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -379,21 +305,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, vaultName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -403,19 +321,17 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, VaultInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vaultName, parameters); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VaultInner.class, VaultInner.class, this.client.getContext()); + public PollerFlux, VaultInner> beginCreateOrUpdateAsync(String resourceGroupName, + String vaultName, VaultCreateOrUpdateParameters parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, vaultName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), VaultInner.class, + VaultInner.class, this.client.getContext()); } /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -426,20 +342,18 @@ public PollerFlux, VaultInner> beginCreateOrUpdateAsync( * @return the {@link PollerFlux} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, VaultInner> beginCreateOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { + private PollerFlux, VaultInner> beginCreateOrUpdateAsync(String resourceGroupName, + String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, vaultName, parameters, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), VaultInner.class, VaultInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, vaultName, parameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), VaultInner.class, + VaultInner.class, context); } /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -449,14 +363,14 @@ private PollerFlux, VaultInner> beginCreateOrUpdateAsync( * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VaultInner> beginCreateOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + public SyncPoller, VaultInner> beginCreateOrUpdate(String resourceGroupName, + String vaultName, VaultCreateOrUpdateParameters parameters) { return this.beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters).getSyncPoller(); } /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -467,14 +381,14 @@ public SyncPoller, VaultInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of resource information with extended details. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, VaultInner> beginCreateOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { + public SyncPoller, VaultInner> beginCreateOrUpdate(String resourceGroupName, + String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { return this.beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters, context).getSyncPoller(); } /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -484,16 +398,15 @@ public SyncPoller, VaultInner> beginCreateOrUpdate( * @return resource information with extended details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { - return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters) - .last() + public Mono createOrUpdateAsync(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -504,16 +417,15 @@ public Mono createOrUpdateAsync( * @return resource information with extended details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, vaultName, parameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -523,14 +435,14 @@ private Mono createOrUpdateAsync( * @return resource information with extended details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VaultInner createOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) { + public VaultInner createOrUpdate(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters) { return createOrUpdateAsync(resourceGroupName, vaultName, parameters).block(); } /** * Create or update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to create or update the vault. @@ -541,31 +453,29 @@ public VaultInner createOrUpdate( * @return resource information with extended details. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VaultInner createOrUpdate( - String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters, Context context) { + public VaultInner createOrUpdate(String resourceGroupName, String vaultName, + VaultCreateOrUpdateParameters parameters, Context context) { return createOrUpdateAsync(resourceGroupName, vaultName, parameters, context).block(); } /** * Update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to patch the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync( - String resourceGroupName, String vaultName, VaultPatchParameters parameters) { + public Mono> updateWithResponseAsync(String resourceGroupName, String vaultName, + VaultPatchParameters parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -575,10 +485,8 @@ public Mono> updateWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -587,24 +495,14 @@ public Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, vaultName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to patch the vault. @@ -612,17 +510,15 @@ public Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return resource information with extended details along with {@link Response} on successful completion of {@link - * Mono}. + * @return resource information with extended details along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String vaultName, VaultPatchParameters parameters, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String vaultName, + VaultPatchParameters parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -632,10 +528,8 @@ private Mono> updateWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -644,21 +538,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.update(this.client.getEndpoint(), resourceGroupName, vaultName, this.client.getApiVersion(), + this.client.getSubscriptionId(), parameters, accept, context); } /** * Update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to patch the vault. @@ -675,7 +561,7 @@ public Mono updateAsync(String resourceGroupName, String vaultName, /** * Update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to patch the vault. @@ -686,14 +572,14 @@ public Mono updateAsync(String resourceGroupName, String vaultName, * @return resource information with extended details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String vaultName, VaultPatchParameters parameters, Context context) { + public Response updateWithResponse(String resourceGroupName, String vaultName, + VaultPatchParameters parameters, Context context) { return updateWithResponseAsync(resourceGroupName, vaultName, parameters, context).block(); } /** * Update a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the server belongs. * @param vaultName Name of the vault. * @param parameters Parameters to patch the vault. @@ -709,7 +595,7 @@ public VaultInner update(String resourceGroupName, String vaultName, VaultPatchP /** * Deletes the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -720,10 +606,8 @@ public VaultInner update(String resourceGroupName, String vaultName, VaultPatchP @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -733,30 +617,19 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, vaultName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault to delete. * @param context The context to associate with this operation. @@ -768,10 +641,8 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String vaultName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -781,27 +652,18 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.delete(this.client.getEndpoint(), resourceGroupName, vaultName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** * Deletes the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -816,7 +678,7 @@ public Mono deleteAsync(String resourceGroupName, String vaultName) { /** * Deletes the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault to delete. * @param context The context to associate with this operation. @@ -832,7 +694,7 @@ public Response deleteWithResponse(String resourceGroupName, String vaultN /** * Deletes the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -846,7 +708,7 @@ public void delete(String resourceGroupName, String vaultName) { /** * Gets the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -857,10 +719,8 @@ public void delete(String resourceGroupName, String vaultName) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String vaultName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -870,30 +730,19 @@ public Mono> getByResourceGroupWithResponseAsync(String res return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, vaultName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault. * @param context The context to associate with this operation. @@ -903,13 +752,11 @@ public Mono> getByResourceGroupWithResponseAsync(String res * @return the specified Azure key vault along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String vaultName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String vaultName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -919,27 +766,18 @@ private Mono> getByResourceGroupWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, vaultName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** * Gets the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -955,7 +793,7 @@ public Mono getByResourceGroupAsync(String resourceGroupName, String /** * Gets the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault. * @param context The context to associate with this operation. @@ -965,14 +803,14 @@ public Mono getByResourceGroupAsync(String resourceGroupName, String * @return the specified Azure key vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String vaultName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String vaultName, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName, context).block(); } /** * Gets the specified Azure key vault. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -987,7 +825,7 @@ public VaultInner getByResourceGroup(String resourceGroupName, String vaultName) /** * Update access policies in a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault. * @param operationKind Name of the operation. @@ -996,19 +834,15 @@ public VaultInner getByResourceGroup(String resourceGroupName, String vaultName) * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return parameters for updating the access policy in a vault along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateAccessPolicyWithResponseAsync( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, + String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyParametersInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1021,10 +855,8 @@ public Mono> updateAccessPolicyWithRe return Mono.error(new IllegalArgumentException("Parameter operationKind is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -1033,25 +865,15 @@ public Mono> updateAccessPolicyWithRe } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .updateAccessPolicy( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - operationKind, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context)) + .withContext(context -> service.updateAccessPolicy(this.client.getEndpoint(), resourceGroupName, vaultName, + operationKind, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update access policies in a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault. * @param operationKind Name of the operation. @@ -1061,20 +883,15 @@ public Mono> updateAccessPolicyWithRe * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return parameters for updating the access policy in a vault along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateAccessPolicyWithResponseAsync( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyParametersInner parameters, - Context context) { + String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, + VaultAccessPolicyParametersInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1087,10 +904,8 @@ private Mono> updateAccessPolicyWithR return Mono.error(new IllegalArgumentException("Parameter operationKind is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); @@ -1099,22 +914,13 @@ private Mono> updateAccessPolicyWithR } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .updateAccessPolicy( - this.client.getEndpoint(), - resourceGroupName, - vaultName, - operationKind, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - parameters, - accept, - context); + return service.updateAccessPolicy(this.client.getEndpoint(), resourceGroupName, vaultName, operationKind, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** * Update access policies in a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault. * @param operationKind Name of the operation. @@ -1125,18 +931,15 @@ private Mono> updateAccessPolicyWithR * @return parameters for updating the access policy in a vault on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAccessPolicyAsync( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyParametersInner parameters) { + public Mono updateAccessPolicyAsync(String resourceGroupName, String vaultName, + AccessPolicyUpdateKind operationKind, VaultAccessPolicyParametersInner parameters) { return updateAccessPolicyWithResponseAsync(resourceGroupName, vaultName, operationKind, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Update access policies in a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault. * @param operationKind Name of the operation. @@ -1148,11 +951,8 @@ public Mono updateAccessPolicyAsync( * @return parameters for updating the access policy in a vault along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAccessPolicyWithResponse( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyParametersInner parameters, + public Response updateAccessPolicyWithResponse(String resourceGroupName, + String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyParametersInner parameters, Context context) { return updateAccessPolicyWithResponseAsync(resourceGroupName, vaultName, operationKind, parameters, context) .block(); @@ -1160,7 +960,7 @@ public Response updateAccessPolicyWithResponse /** * Update access policies in a key vault in the specified subscription. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param vaultName Name of the vault. * @param operationKind Name of the operation. @@ -1171,11 +971,8 @@ public Response updateAccessPolicyWithResponse * @return parameters for updating the access policy in a vault. */ @ServiceMethod(returns = ReturnType.SINGLE) - public VaultAccessPolicyParametersInner updateAccessPolicy( - String resourceGroupName, - String vaultName, - AccessPolicyUpdateKind operationKind, - VaultAccessPolicyParametersInner parameters) { + public VaultAccessPolicyParametersInner updateAccessPolicy(String resourceGroupName, String vaultName, + AccessPolicyUpdateKind operationKind, VaultAccessPolicyParametersInner parameters) { return updateAccessPolicyWithResponse(resourceGroupName, vaultName, operationKind, parameters, Context.NONE) .getValue(); } @@ -1183,7 +980,7 @@ public VaultAccessPolicyParametersInner updateAccessPolicy( /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1194,50 +991,30 @@ public VaultAccessPolicyParametersInner updateAccessPolicy( @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Integer top) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, top, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param top Maximum number of results to return. * @param context The context to associate with this operation. @@ -1247,50 +1024,33 @@ private Mono> listByResourceGroupSinglePageAsync(Strin * @return list of vaults along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Integer top, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, Integer top, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - resourceGroupName, - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, top, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1300,15 +1060,14 @@ private Mono> listByResourceGroupSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1318,15 +1077,14 @@ public PagedFlux listByResourceGroupAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByResourceGroupAsync(String resourceGroupName) { final Integer top = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param top Maximum number of results to return. * @param context The context to associate with this operation. @@ -1337,15 +1095,14 @@ public PagedFlux listByResourceGroupAsync(String resourceGroupName) */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1361,7 +1118,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName) { /** * The List operation gets information about the vaults associated with the subscription and within the specified * resource group. - * + * * @param resourceGroupName The name of the Resource Group to which the vault belongs. * @param top Maximum number of results to return. * @param context The context to associate with this operation. @@ -1377,7 +1134,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName, I /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1387,44 +1144,25 @@ public PagedIterable listByResourceGroup(String resourceGroupName, I @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionSinglePageAsync(Integer top) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listBySubscription( - this.client.getEndpoint(), - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listBySubscription(this.client.getEndpoint(), top, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1435,41 +1173,25 @@ private Mono> listBySubscriptionSinglePageAsync(Intege @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionSinglePageAsync(Integer top, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listBySubscription( - this.client.getEndpoint(), - top, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listBySubscription(this.client.getEndpoint(), top, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1478,13 +1200,13 @@ private Mono> listBySubscriptionSinglePageAsync(Intege */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listBySubscriptionAsync(Integer top) { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(top), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the vaults associated with the subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of vaults as paginated response with {@link PagedFlux}. @@ -1492,13 +1214,13 @@ public PagedFlux listBySubscriptionAsync(Integer top) { @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listBySubscriptionAsync() { final Integer top = null; - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(top), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1508,14 +1230,13 @@ public PagedFlux listBySubscriptionAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listBySubscriptionAsync(Integer top, Context context) { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(top, context), + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(top, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * The List operation gets information about the vaults associated with the subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of vaults as paginated response with {@link PagedIterable}. @@ -1528,7 +1249,7 @@ public PagedIterable listBySubscription() { /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1543,109 +1264,76 @@ public PagedIterable listBySubscription(Integer top, Context context /** * Gets information about the deleted vaults in a subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the deleted vaults in a subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeletedSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listDeleted(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets information about the deleted vaults in a subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the deleted vaults in a subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeletedSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listDeleted( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listDeleted(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Gets information about the deleted vaults in a subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the deleted vaults in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDeletedAsync() { - return new PagedFlux<>( - () -> listDeletedSinglePageAsync(), nextLink -> listDeletedNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listDeletedSinglePageAsync(), + nextLink -> listDeletedNextSinglePageAsync(nextLink)); } /** * Gets information about the deleted vaults in a subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1654,13 +1342,13 @@ public PagedFlux listDeletedAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listDeletedAsync(Context context) { - return new PagedFlux<>( - () -> listDeletedSinglePageAsync(context), nextLink -> listDeletedNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listDeletedSinglePageAsync(context), + nextLink -> listDeletedNextSinglePageAsync(nextLink, context)); } /** * Gets information about the deleted vaults in a subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return information about the deleted vaults in a subscription as paginated response with {@link PagedIterable}. @@ -1672,7 +1360,7 @@ public PagedIterable listDeleted() { /** * Gets information about the deleted vaults in a subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1686,7 +1374,7 @@ public PagedIterable listDeleted(Context context) { /** * Gets the deleted Azure key vault. - * + * * @param vaultName The name of the vault. * @param location The location of the deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1697,10 +1385,8 @@ public PagedIterable listDeleted(Context context) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDeletedWithResponseAsync(String vaultName, String location) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); @@ -1709,30 +1395,19 @@ public Mono> getDeletedWithResponseAsync(String vaul return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getDeleted( - this.client.getEndpoint(), - vaultName, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.getDeleted(this.client.getEndpoint(), vaultName, location, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the deleted Azure key vault. - * + * * @param vaultName The name of the vault. * @param location The location of the deleted vault. * @param context The context to associate with this operation. @@ -1742,13 +1417,11 @@ public Mono> getDeletedWithResponseAsync(String vaul * @return the deleted Azure key vault along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDeletedWithResponseAsync( - String vaultName, String location, Context context) { + private Mono> getDeletedWithResponseAsync(String vaultName, String location, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); @@ -1757,27 +1430,18 @@ private Mono> getDeletedWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getDeleted( - this.client.getEndpoint(), - vaultName, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.getDeleted(this.client.getEndpoint(), vaultName, location, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** * Gets the deleted Azure key vault. - * + * * @param vaultName The name of the vault. * @param location The location of the deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1792,7 +1456,7 @@ public Mono getDeletedAsync(String vaultName, String location /** * Gets the deleted Azure key vault. - * + * * @param vaultName The name of the vault. * @param location The location of the deleted vault. * @param context The context to associate with this operation. @@ -1808,7 +1472,7 @@ public Response getDeletedWithResponse(String vaultName, Stri /** * Gets the deleted Azure key vault. - * + * * @param vaultName The name of the vault. * @param location The location of the deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1823,7 +1487,7 @@ public DeletedVaultInner getDeleted(String vaultName, String location) { /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1834,10 +1498,8 @@ public DeletedVaultInner getDeleted(String vaultName, String location) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> purgeDeletedWithResponseAsync(String vaultName, String location) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); @@ -1846,30 +1508,19 @@ public Mono>> purgeDeletedWithResponseAsync(String vau return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .purgeDeleted( - this.client.getEndpoint(), - vaultName, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) + .withContext(context -> service.purgeDeleted(this.client.getEndpoint(), vaultName, location, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @param context The context to associate with this operation. @@ -1879,13 +1530,11 @@ public Mono>> purgeDeletedWithResponseAsync(String vau * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> purgeDeletedWithResponseAsync( - String vaultName, String location, Context context) { + private Mono>> purgeDeletedWithResponseAsync(String vaultName, String location, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); @@ -1894,27 +1543,18 @@ private Mono>> purgeDeletedWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .purgeDeleted( - this.client.getEndpoint(), - vaultName, - location, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context); + return service.purgeDeleted(this.client.getEndpoint(), vaultName, location, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1925,15 +1565,13 @@ private Mono>> purgeDeletedWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, Void> beginPurgeDeletedAsync(String vaultName, String location) { Mono>> mono = purgeDeletedWithResponseAsync(vaultName, location); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @param context The context to associate with this operation. @@ -1943,18 +1581,17 @@ public PollerFlux, Void> beginPurgeDeletedAsync(String vaultNam * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginPurgeDeletedAsync( - String vaultName, String location, Context context) { + private PollerFlux, Void> beginPurgeDeletedAsync(String vaultName, String location, + Context context) { context = this.client.mergeContext(context); Mono>> mono = purgeDeletedWithResponseAsync(vaultName, location, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1969,7 +1606,7 @@ public SyncPoller, Void> beginPurgeDeleted(String vaultName, St /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @param context The context to associate with this operation. @@ -1985,7 +1622,7 @@ public SyncPoller, Void> beginPurgeDeleted(String vaultName, St /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2000,7 +1637,7 @@ public Mono purgeDeletedAsync(String vaultName, String location) { /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @param context The context to associate with this operation. @@ -2011,14 +1648,13 @@ public Mono purgeDeletedAsync(String vaultName, String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono purgeDeletedAsync(String vaultName, String location, Context context) { - return beginPurgeDeletedAsync(vaultName, location, context) - .last() + return beginPurgeDeletedAsync(vaultName, location, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2032,7 +1668,7 @@ public void purgeDeleted(String vaultName, String location) { /** * Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - * + * * @param vaultName The name of the soft-deleted vault. * @param location The location of the soft-deleted vault. * @param context The context to associate with this operation. @@ -2047,7 +1683,7 @@ public void purgeDeleted(String vaultName, String location, Context context) { /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2057,47 +1693,27 @@ public void purgeDeleted(String vaultName, String location, Context context) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String filter = "resourceType eq 'Microsoft.KeyVault/vaults'"; final String apiVersion = "2015-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - top, - apiVersion, - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), filter, top, apiVersion, + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2108,16 +1724,12 @@ private Mono> listSinglePageAsync(Integer top) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String filter = "resourceType eq 'Microsoft.KeyVault/vaults'"; final String apiVersion = "2015-11-01"; @@ -2125,20 +1737,13 @@ private Mono> listSinglePageAsync(Integer top, Context c context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), filter, top, apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2152,7 +1757,7 @@ public PagedFlux listAsync(Integer top) { /** * The List operation gets information about the vaults associated with the subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of vault resources as paginated response with {@link PagedFlux}. @@ -2165,7 +1770,7 @@ public PagedFlux listAsync() { /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2175,13 +1780,13 @@ public PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(top, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(top, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * The List operation gets information about the vaults associated with the subscription. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of vault resources as paginated response with {@link PagedIterable}. @@ -2194,7 +1799,7 @@ public PagedIterable list() { /** * The List operation gets information about the vaults associated with the subscription. - * + * * @param top Maximum number of results to return. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2209,28 +1814,24 @@ public PagedIterable list(Integer top, Context context) { /** * Checks that the vault name is valid and is not already in use. - * + * * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the CheckNameAvailability operation response along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkNameAvailabilityWithResponseAsync( - VaultCheckNameAvailabilityParameters vaultName) { + public Mono> + checkNameAvailabilityWithResponseAsync(VaultCheckNameAvailabilityParameters vaultName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); @@ -2239,44 +1840,32 @@ public Mono> checkNameAvailabilityWit } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - vaultName, - accept, - context)) + .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), vaultName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Checks that the vault name is valid and is not already in use. - * + * * @param vaultName The name of the vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the CheckNameAvailability operation response along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - VaultCheckNameAvailabilityParameters vaultName, Context context) { + private Mono> + checkNameAvailabilityWithResponseAsync(VaultCheckNameAvailabilityParameters vaultName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (vaultName == null) { return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null.")); @@ -2285,19 +1874,13 @@ private Mono> checkNameAvailabilityWi } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .checkNameAvailability( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - vaultName, - accept, - context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), vaultName, accept, context); } /** * Checks that the vault name is valid and is not already in use. - * + * * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2305,14 +1888,14 @@ private Mono> checkNameAvailabilityWi * @return the CheckNameAvailability operation response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkNameAvailabilityAsync( - VaultCheckNameAvailabilityParameters vaultName) { + public Mono + checkNameAvailabilityAsync(VaultCheckNameAvailabilityParameters vaultName) { return checkNameAvailabilityWithResponseAsync(vaultName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Checks that the vault name is valid and is not already in use. - * + * * @param vaultName The name of the vault. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2321,14 +1904,14 @@ public Mono checkNameAvailabilityAsync( * @return the CheckNameAvailability operation response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - VaultCheckNameAvailabilityParameters vaultName, Context context) { + public Response + checkNameAvailabilityWithResponse(VaultCheckNameAvailabilityParameters vaultName, Context context) { return checkNameAvailabilityWithResponseAsync(vaultName, context).block(); } /** * Checks that the vault name is valid and is not already in use. - * + * * @param vaultName The name of the vault. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -2342,9 +1925,8 @@ public CheckNameAvailabilityResultInner checkNameAvailability(VaultCheckNameAvai /** * 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. @@ -2356,32 +1938,22 @@ private Mono> listByResourceGroupNextSinglePageAsync(S return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -2394,31 +1966,20 @@ private Mono> listByResourceGroupNextSinglePageAsync(S return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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. @@ -2430,32 +1991,22 @@ private Mono> listBySubscriptionNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -2468,31 +2019,20 @@ private Mono> listBySubscriptionNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -2504,31 +2044,21 @@ private Mono> listDeletedNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDeletedNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -2541,31 +2071,20 @@ private Mono> listDeletedNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listDeletedNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listDeletedNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @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. @@ -2577,31 +2096,20 @@ private Mono> listNextSinglePageAsync(String nextLink) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * @param 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. @@ -2614,23 +2122,13 @@ private Mono> listNextSinglePageAsync(String nextLink, C return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyEntry.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyEntry.java index 6c8c52c25a216..609d84be33361 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyEntry.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyEntry.java @@ -6,7 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; import java.util.UUID; /** @@ -14,40 +19,38 @@ * vault's tenant ID. */ @Fluent -public final class AccessPolicyEntry { +public final class AccessPolicyEntry implements JsonSerializable { /* * The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. */ - @JsonProperty(value = "tenantId", required = true) private UUID tenantId; /* * The object ID of a user, service principal or security group in the Azure Active Directory tenant for the vault. * The object ID must be unique for the list of access policies. */ - @JsonProperty(value = "objectId", required = true) private String objectId; /* * Application ID of the client making request on behalf of a principal */ - @JsonProperty(value = "applicationId") private UUID applicationId; /* * Permissions the identity has for keys, secrets and certificates. */ - @JsonProperty(value = "permissions", required = true) private Permissions permissions; - /** Creates an instance of AccessPolicyEntry class. */ + /** + * Creates an instance of AccessPolicyEntry class. + */ public AccessPolicyEntry() { } /** * Get the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests * to the key vault. - * + * * @return the tenantId value. */ public UUID tenantId() { @@ -57,7 +60,7 @@ public UUID tenantId() { /** * Set the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests * to the key vault. - * + * * @param tenantId the tenantId value to set. * @return the AccessPolicyEntry object itself. */ @@ -69,7 +72,7 @@ public AccessPolicyEntry withTenantId(UUID tenantId) { /** * Get the objectId property: The object ID of a user, service principal or security group in the Azure Active * Directory tenant for the vault. The object ID must be unique for the list of access policies. - * + * * @return the objectId value. */ public String objectId() { @@ -79,7 +82,7 @@ public String objectId() { /** * Set the objectId property: The object ID of a user, service principal or security group in the Azure Active * Directory tenant for the vault. The object ID must be unique for the list of access policies. - * + * * @param objectId the objectId value to set. * @return the AccessPolicyEntry object itself. */ @@ -90,7 +93,7 @@ public AccessPolicyEntry withObjectId(String objectId) { /** * Get the applicationId property: Application ID of the client making request on behalf of a principal. - * + * * @return the applicationId value. */ public UUID applicationId() { @@ -99,7 +102,7 @@ public UUID applicationId() { /** * Set the applicationId property: Application ID of the client making request on behalf of a principal. - * + * * @param applicationId the applicationId value to set. * @return the AccessPolicyEntry object itself. */ @@ -110,7 +113,7 @@ public AccessPolicyEntry withApplicationId(UUID applicationId) { /** * Get the permissions property: Permissions the identity has for keys, secrets and certificates. - * + * * @return the permissions value. */ public Permissions permissions() { @@ -119,7 +122,7 @@ public Permissions permissions() { /** * Set the permissions property: Permissions the identity has for keys, secrets and certificates. - * + * * @param permissions the permissions value to set. * @return the AccessPolicyEntry object itself. */ @@ -130,28 +133,73 @@ public AccessPolicyEntry withPermissions(Permissions permissions) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (tenantId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property tenantId in model AccessPolicyEntry")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property tenantId in model AccessPolicyEntry")); } if (objectId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property objectId in model AccessPolicyEntry")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property objectId in model AccessPolicyEntry")); } if (permissions() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property permissions in model AccessPolicyEntry")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property permissions in model AccessPolicyEntry")); } else { permissions().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(AccessPolicyEntry.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", Objects.toString(this.tenantId, null)); + jsonWriter.writeStringField("objectId", this.objectId); + jsonWriter.writeJsonField("permissions", this.permissions); + jsonWriter.writeStringField("applicationId", Objects.toString(this.applicationId, null)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessPolicyEntry from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessPolicyEntry 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 AccessPolicyEntry. + */ + public static AccessPolicyEntry fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessPolicyEntry deserializedAccessPolicyEntry = new AccessPolicyEntry(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedAccessPolicyEntry.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("objectId".equals(fieldName)) { + deserializedAccessPolicyEntry.objectId = reader.getString(); + } else if ("permissions".equals(fieldName)) { + deserializedAccessPolicyEntry.permissions = Permissions.fromJson(reader); + } else if ("applicationId".equals(fieldName)) { + deserializedAccessPolicyEntry.applicationId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessPolicyEntry; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyUpdateKind.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyUpdateKind.java index 1871544be18ee..d1563022f4ece 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyUpdateKind.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/AccessPolicyUpdateKind.java @@ -4,21 +4,28 @@ package com.azure.resourcemanager.keyvault.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Defines values for AccessPolicyUpdateKind. */ +/** + * Defines values for AccessPolicyUpdateKind. + */ public enum AccessPolicyUpdateKind { - /** Enum value add. */ + /** + * Enum value add. + */ ADD("add"), - /** Enum value replace. */ + /** + * Enum value replace. + */ REPLACE("replace"), - /** Enum value remove. */ + /** + * Enum value remove. + */ REMOVE("remove"); - /** The actual serialized value for a AccessPolicyUpdateKind instance. */ + /** + * The actual serialized value for a AccessPolicyUpdateKind instance. + */ private final String value; AccessPolicyUpdateKind(String value) { @@ -27,11 +34,10 @@ public enum AccessPolicyUpdateKind { /** * Parses a serialized value to a AccessPolicyUpdateKind instance. - * + * * @param value the serialized value to parse. * @return the parsed AccessPolicyUpdateKind object, or null if unable to parse. */ - @JsonCreator public static AccessPolicyUpdateKind fromString(String value) { if (value == null) { return null; @@ -45,8 +51,9 @@ public static AccessPolicyUpdateKind fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Action.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Action.java new file mode 100644 index 0000000000000..db044d69fa32e --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Action.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Action model. + */ +@Fluent +public final class Action implements JsonSerializable { + /* + * The type of action. + */ + private KeyRotationPolicyActionType type; + + /** + * Creates an instance of Action class. + */ + public Action() { + } + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public KeyRotationPolicyActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the Action object itself. + */ + public Action withType(KeyRotationPolicyActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Action from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Action 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 Action. + */ + public static Action fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Action deserializedAction = new Action(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedAction.type = KeyRotationPolicyActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAction; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ActionsRequired.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ActionsRequired.java index 2ad18fadc4d7b..92c18a3e93c09 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ActionsRequired.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ActionsRequired.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** A message indicating if changes on the service provider require any updates on the consumer. */ +/** + * A message indicating if changes on the service provider require any updates on the consumer. + */ public final class ActionsRequired extends ExpandableStringEnum { - /** Static value None for ActionsRequired. */ + /** + * Static value None for ActionsRequired. + */ public static final ActionsRequired NONE = fromString("None"); /** * Creates a new instance of ActionsRequired value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public ActionsRequired() { /** * Creates or finds a ActionsRequired from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionsRequired. */ - @JsonCreator public static ActionsRequired fromString(String name) { return fromString(name, ActionsRequired.class); } /** * Gets known ActionsRequired values. - * + * * @return known ActionsRequired values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ActivationStatus.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ActivationStatus.java index 41635c3d71c4d..342f80d5b86b0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ActivationStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ActivationStatus.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Activation Status. */ +/** + * Activation Status. + */ public final class ActivationStatus extends ExpandableStringEnum { - /** Static value Active for ActivationStatus. */ + /** + * Static value Active for ActivationStatus. + */ public static final ActivationStatus ACTIVE = fromString("Active"); - /** Static value NotActivated for ActivationStatus. */ + /** + * Static value NotActivated for ActivationStatus. + */ public static final ActivationStatus NOT_ACTIVATED = fromString("NotActivated"); - /** Static value Unknown for ActivationStatus. */ + /** + * Static value Unknown for ActivationStatus. + */ public static final ActivationStatus UNKNOWN = fromString("Unknown"); - /** Static value Failed for ActivationStatus. */ + /** + * Static value Failed for ActivationStatus. + */ public static final ActivationStatus FAILED = fromString("Failed"); /** * Creates a new instance of ActivationStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public ActivationStatus() { /** * Creates or finds a ActivationStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActivationStatus. */ - @JsonCreator public static ActivationStatus fromString(String name) { return fromString(name, ActivationStatus.class); } /** * Gets known ActivationStatus values. - * + * * @return known ActivationStatus values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Attributes.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Attributes.java new file mode 100644 index 0000000000000..21a60dda6d80e --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Attributes.java @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * The object attributes managed by the KeyVault service. + */ +@Fluent +public class Attributes implements JsonSerializable { + /* + * Determines whether the object is enabled. + */ + private Boolean enabled; + + /* + * Not before date in seconds since 1970-01-01T00:00:00Z. + */ + private Long notBefore; + + /* + * Expiry date in seconds since 1970-01-01T00:00:00Z. + */ + private Long expires; + + /* + * Creation time in seconds since 1970-01-01T00:00:00Z. + */ + private Long created; + + /* + * Last updated time in seconds since 1970-01-01T00:00:00Z. + */ + private Long updated; + + /** + * Creates an instance of Attributes class. + */ + public Attributes() { + } + + /** + * Get the enabled property: Determines whether the object is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether the object is enabled. + * + * @param enabled the enabled value to set. + * @return the Attributes object itself. + */ + public Attributes withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the notBefore property: Not before date in seconds since 1970-01-01T00:00:00Z. + * + * @return the notBefore value. + */ + public OffsetDateTime notBefore() { + if (this.notBefore == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.notBefore), ZoneOffset.UTC); + } + + /** + * Set the notBefore property: Not before date in seconds since 1970-01-01T00:00:00Z. + * + * @param notBefore the notBefore value to set. + * @return the Attributes object itself. + */ + public Attributes withNotBefore(OffsetDateTime notBefore) { + if (notBefore == null) { + this.notBefore = null; + } else { + this.notBefore = notBefore.toEpochSecond(); + } + return this; + } + + /** + * Get the expires property: Expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @return the expires value. + */ + public OffsetDateTime expires() { + if (this.expires == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.expires), ZoneOffset.UTC); + } + + /** + * Set the expires property: Expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @param expires the expires value to set. + * @return the Attributes object itself. + */ + public Attributes withExpires(OffsetDateTime expires) { + if (expires == null) { + this.expires = null; + } else { + this.expires = expires.toEpochSecond(); + } + return this; + } + + /** + * Get the created property: Creation time in seconds since 1970-01-01T00:00:00Z. + * + * @return the created value. + */ + public OffsetDateTime created() { + if (this.created == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.created), ZoneOffset.UTC); + } + + /** + * Set the created property: Creation time in seconds since 1970-01-01T00:00:00Z. + * + * @param created the created value to set. + * @return the Attributes object itself. + */ + Attributes withCreated(OffsetDateTime created) { + if (created == null) { + this.created = null; + } else { + this.created = created.toEpochSecond(); + } + return this; + } + + /** + * Get the updated property: Last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @return the updated value. + */ + public OffsetDateTime updated() { + if (this.updated == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.updated), ZoneOffset.UTC); + } + + /** + * Set the updated property: Last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @param updated the updated value to set. + * @return the Attributes object itself. + */ + Attributes withUpdated(OffsetDateTime updated) { + if (updated == null) { + this.updated = null; + } else { + this.updated = updated.toEpochSecond(); + } + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("nbf", this.notBefore); + jsonWriter.writeNumberField("exp", this.expires); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Attributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Attributes 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 Attributes. + */ + public static Attributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Attributes deserializedAttributes = new Attributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedAttributes.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("nbf".equals(fieldName)) { + deserializedAttributes.notBefore = reader.getNullable(JsonReader::getLong); + } else if ("exp".equals(fieldName)) { + deserializedAttributes.expires = reader.getNullable(JsonReader::getLong); + } else if ("created".equals(fieldName)) { + deserializedAttributes.created = reader.getNullable(JsonReader::getLong); + } else if ("updated".equals(fieldName)) { + deserializedAttributes.updated = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedAttributes; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CertificatePermissions.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CertificatePermissions.java index 2e66bd3c943ad..9973e3f84d737 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CertificatePermissions.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CertificatePermissions.java @@ -5,65 +5,100 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CertificatePermissions. */ +/** + * Defines values for CertificatePermissions. + */ public final class CertificatePermissions extends ExpandableStringEnum { - /** Static value all for CertificatePermissions. */ + /** + * Static value all for CertificatePermissions. + */ public static final CertificatePermissions ALL = fromString("all"); - /** Static value get for CertificatePermissions. */ + /** + * Static value get for CertificatePermissions. + */ public static final CertificatePermissions GET = fromString("get"); - /** Static value list for CertificatePermissions. */ + /** + * Static value list for CertificatePermissions. + */ public static final CertificatePermissions LIST = fromString("list"); - /** Static value delete for CertificatePermissions. */ + /** + * Static value delete for CertificatePermissions. + */ public static final CertificatePermissions DELETE = fromString("delete"); - /** Static value create for CertificatePermissions. */ + /** + * Static value create for CertificatePermissions. + */ public static final CertificatePermissions CREATE = fromString("create"); - /** Static value import for CertificatePermissions. */ + /** + * Static value import for CertificatePermissions. + */ public static final CertificatePermissions IMPORT = fromString("import"); - /** Static value update for CertificatePermissions. */ + /** + * Static value update for CertificatePermissions. + */ public static final CertificatePermissions UPDATE = fromString("update"); - /** Static value managecontacts for CertificatePermissions. */ + /** + * Static value managecontacts for CertificatePermissions. + */ public static final CertificatePermissions MANAGECONTACTS = fromString("managecontacts"); - /** Static value getissuers for CertificatePermissions. */ + /** + * Static value getissuers for CertificatePermissions. + */ public static final CertificatePermissions GETISSUERS = fromString("getissuers"); - /** Static value listissuers for CertificatePermissions. */ + /** + * Static value listissuers for CertificatePermissions. + */ public static final CertificatePermissions LISTISSUERS = fromString("listissuers"); - /** Static value setissuers for CertificatePermissions. */ + /** + * Static value setissuers for CertificatePermissions. + */ public static final CertificatePermissions SETISSUERS = fromString("setissuers"); - /** Static value deleteissuers for CertificatePermissions. */ + /** + * Static value deleteissuers for CertificatePermissions. + */ public static final CertificatePermissions DELETEISSUERS = fromString("deleteissuers"); - /** Static value manageissuers for CertificatePermissions. */ + /** + * Static value manageissuers for CertificatePermissions. + */ public static final CertificatePermissions MANAGEISSUERS = fromString("manageissuers"); - /** Static value recover for CertificatePermissions. */ + /** + * Static value recover for CertificatePermissions. + */ public static final CertificatePermissions RECOVER = fromString("recover"); - /** Static value purge for CertificatePermissions. */ + /** + * Static value purge for CertificatePermissions. + */ public static final CertificatePermissions PURGE = fromString("purge"); - /** Static value backup for CertificatePermissions. */ + /** + * Static value backup for CertificatePermissions. + */ public static final CertificatePermissions BACKUP = fromString("backup"); - /** Static value restore for CertificatePermissions. */ + /** + * Static value restore for CertificatePermissions. + */ public static final CertificatePermissions RESTORE = fromString("restore"); /** * Creates a new instance of CertificatePermissions value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -72,18 +107,17 @@ public CertificatePermissions() { /** * Creates or finds a CertificatePermissions from its string representation. - * + * * @param name a name to look for. * @return the corresponding CertificatePermissions. */ - @JsonCreator public static CertificatePermissions fromString(String name) { return fromString(name, CertificatePermissions.class); } /** * Gets known CertificatePermissions values. - * + * * @return known CertificatePermissions values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CheckMhsmNameAvailabilityParameters.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CheckMhsmNameAvailabilityParameters.java index a16a43b4117c5..727da424a1640 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CheckMhsmNameAvailabilityParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CheckMhsmNameAvailabilityParameters.java @@ -6,24 +6,32 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The parameters used to check the availability of the managed hsm name. */ +/** + * The parameters used to check the availability of the managed hsm name. + */ @Fluent -public final class CheckMhsmNameAvailabilityParameters { +public final class CheckMhsmNameAvailabilityParameters + implements JsonSerializable { /* * The managed hsm name. */ - @JsonProperty(value = "name", required = true) private String name; - /** Creates an instance of CheckMhsmNameAvailabilityParameters class. */ + /** + * Creates an instance of CheckMhsmNameAvailabilityParameters class. + */ public CheckMhsmNameAvailabilityParameters() { } /** * Get the name property: The managed hsm name. - * + * * @return the name value. */ public String name() { @@ -32,7 +40,7 @@ public String name() { /** * Set the name property: The managed hsm name. - * + * * @param name the name value to set. * @return the CheckMhsmNameAvailabilityParameters object itself. */ @@ -43,17 +51,54 @@ public CheckMhsmNameAvailabilityParameters withName(String name) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model CheckMhsmNameAvailabilityParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model CheckMhsmNameAvailabilityParameters")); } } private static final ClientLogger LOGGER = new ClientLogger(CheckMhsmNameAvailabilityParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckMhsmNameAvailabilityParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckMhsmNameAvailabilityParameters 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 CheckMhsmNameAvailabilityParameters. + */ + public static CheckMhsmNameAvailabilityParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckMhsmNameAvailabilityParameters deserializedCheckMhsmNameAvailabilityParameters + = new CheckMhsmNameAvailabilityParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCheckMhsmNameAvailabilityParameters.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckMhsmNameAvailabilityParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CreateMode.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CreateMode.java index f6956696199a8..10dcfc7d16c4d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CreateMode.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/CreateMode.java @@ -4,18 +4,23 @@ package com.azure.resourcemanager.keyvault.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** The vault's create mode to indicate whether the vault need to be recovered or not. */ +/** + * The vault's create mode to indicate whether the vault need to be recovered or not. + */ public enum CreateMode { - /** Enum value recover. */ + /** + * Enum value recover. + */ RECOVER("recover"), - /** Enum value default. */ + /** + * Enum value default. + */ DEFAULT("default"); - /** The actual serialized value for a CreateMode instance. */ + /** + * The actual serialized value for a CreateMode instance. + */ private final String value; CreateMode(String value) { @@ -24,11 +29,10 @@ public enum CreateMode { /** * Parses a serialized value to a CreateMode instance. - * + * * @param value the serialized value to parse. * @return the parsed CreateMode object, or null if unable to parse. */ - @JsonCreator public static CreateMode fromString(String value) { if (value == null) { return null; @@ -42,8 +46,9 @@ public static CreateMode fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedManagedHsmListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedManagedHsmListResult.java index 22a020859c3b7..0d9e3a8e5bc4d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedManagedHsmListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedManagedHsmListResult.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.DeletedManagedHsmInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of deleted managed HSM Pools. */ +/** + * List of deleted managed HSM Pools. + */ @Fluent -public final class DeletedManagedHsmListResult { +public final class DeletedManagedHsmListResult implements JsonSerializable { /* * The list of deleted managed HSM Pools. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of deleted managed HSM Pools. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of DeletedManagedHsmListResult class. */ + /** + * Creates an instance of DeletedManagedHsmListResult class. + */ public DeletedManagedHsmListResult() { } /** * Get the value property: The list of deleted managed HSM Pools. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The list of deleted managed HSM Pools. - * + * * @param value the value value to set. * @return the DeletedManagedHsmListResult object itself. */ @@ -50,7 +56,7 @@ public DeletedManagedHsmListResult withValue(List value) /** * Get the nextLink property: The URL to get the next set of deleted managed HSM Pools. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URL to get the next set of deleted managed HSM Pools. - * + * * @param nextLink the nextLink value to set. * @return the DeletedManagedHsmListResult object itself. */ @@ -70,7 +76,7 @@ public DeletedManagedHsmListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedManagedHsmListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedManagedHsmListResult 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 DeletedManagedHsmListResult. + */ + public static DeletedManagedHsmListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedManagedHsmListResult deserializedDeletedManagedHsmListResult = new DeletedManagedHsmListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DeletedManagedHsmInner.fromJson(reader1)); + deserializedDeletedManagedHsmListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDeletedManagedHsmListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedManagedHsmListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedManagedHsmProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedManagedHsmProperties.java index 35f49f36a94c9..4238aa8cffa6f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedManagedHsmProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedManagedHsmProperties.java @@ -5,58 +5,59 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; -/** Properties of the deleted managed HSM. */ +/** + * Properties of the deleted managed HSM. + */ @Immutable -public final class DeletedManagedHsmProperties { +public final class DeletedManagedHsmProperties implements JsonSerializable { /* * The resource id of the original managed HSM. */ - @JsonProperty(value = "mhsmId", access = JsonProperty.Access.WRITE_ONLY) private String mhsmId; /* * The location of the original managed HSM. */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; /* * The deleted date. */ - @JsonProperty(value = "deletionDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime deletionDate; /* * The scheduled purged date. */ - @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime scheduledPurgeDate; /* * Purge protection status of the original managed HSM. */ - @JsonProperty(value = "purgeProtectionEnabled", access = JsonProperty.Access.WRITE_ONLY) private Boolean purgeProtectionEnabled; /* * Tags of the original managed HSM. */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of DeletedManagedHsmProperties class. */ + /** + * Creates an instance of DeletedManagedHsmProperties class. + */ public DeletedManagedHsmProperties() { } /** * Get the mhsmId property: The resource id of the original managed HSM. - * + * * @return the mhsmId value. */ public String mhsmId() { @@ -65,7 +66,7 @@ public String mhsmId() { /** * Get the location property: The location of the original managed HSM. - * + * * @return the location value. */ public String location() { @@ -74,7 +75,7 @@ public String location() { /** * Get the deletionDate property: The deleted date. - * + * * @return the deletionDate value. */ public OffsetDateTime deletionDate() { @@ -83,7 +84,7 @@ public OffsetDateTime deletionDate() { /** * Get the scheduledPurgeDate property: The scheduled purged date. - * + * * @return the scheduledPurgeDate value. */ public OffsetDateTime scheduledPurgeDate() { @@ -92,7 +93,7 @@ public OffsetDateTime scheduledPurgeDate() { /** * Get the purgeProtectionEnabled property: Purge protection status of the original managed HSM. - * + * * @return the purgeProtectionEnabled value. */ public Boolean purgeProtectionEnabled() { @@ -101,7 +102,7 @@ public Boolean purgeProtectionEnabled() { /** * Get the tags property: Tags of the original managed HSM. - * + * * @return the tags value. */ public Map tags() { @@ -110,9 +111,58 @@ public Map tags() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedManagedHsmProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedManagedHsmProperties 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 DeletedManagedHsmProperties. + */ + public static DeletedManagedHsmProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedManagedHsmProperties deserializedDeletedManagedHsmProperties = new DeletedManagedHsmProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mhsmId".equals(fieldName)) { + deserializedDeletedManagedHsmProperties.mhsmId = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDeletedManagedHsmProperties.location = reader.getString(); + } else if ("deletionDate".equals(fieldName)) { + deserializedDeletedManagedHsmProperties.deletionDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("scheduledPurgeDate".equals(fieldName)) { + deserializedDeletedManagedHsmProperties.scheduledPurgeDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("purgeProtectionEnabled".equals(fieldName)) { + deserializedDeletedManagedHsmProperties.purgeProtectionEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDeletedManagedHsmProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedManagedHsmProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultListResult.java index d7cd20c45e270..dd79fe3ec2143 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultListResult.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.DeletedVaultInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of vaults. */ +/** + * List of vaults. + */ @Fluent -public final class DeletedVaultListResult { +public final class DeletedVaultListResult implements JsonSerializable { /* * The list of deleted vaults. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of deleted vaults. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of DeletedVaultListResult class. */ + /** + * Creates an instance of DeletedVaultListResult class. + */ public DeletedVaultListResult() { } /** * Get the value property: The list of deleted vaults. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The list of deleted vaults. - * + * * @param value the value value to set. * @return the DeletedVaultListResult object itself. */ @@ -50,7 +56,7 @@ public DeletedVaultListResult withValue(List value) { /** * Get the nextLink property: The URL to get the next set of deleted vaults. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URL to get the next set of deleted vaults. - * + * * @param nextLink the nextLink value to set. * @return the DeletedVaultListResult object itself. */ @@ -70,7 +76,7 @@ public DeletedVaultListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,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)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedVaultListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedVaultListResult 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 DeletedVaultListResult. + */ + public static DeletedVaultListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedVaultListResult deserializedDeletedVaultListResult = new DeletedVaultListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> DeletedVaultInner.fromJson(reader1)); + deserializedDeletedVaultListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDeletedVaultListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedVaultListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultProperties.java index 80e0fe9360579..a1ac29b1c7f56 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletedVaultProperties.java @@ -5,58 +5,59 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; -/** Properties of the deleted vault. */ +/** + * Properties of the deleted vault. + */ @Immutable -public final class DeletedVaultProperties { +public final class DeletedVaultProperties implements JsonSerializable { /* * The resource id of the original vault. */ - @JsonProperty(value = "vaultId", access = JsonProperty.Access.WRITE_ONLY) private String vaultId; /* * The location of the original vault. */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) private String location; /* * The deleted date. */ - @JsonProperty(value = "deletionDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime deletionDate; /* * The scheduled purged date. */ - @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime scheduledPurgeDate; /* * Tags of the original vault. */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * Purge protection status of the original vault. */ - @JsonProperty(value = "purgeProtectionEnabled", access = JsonProperty.Access.WRITE_ONLY) private Boolean purgeProtectionEnabled; - /** Creates an instance of DeletedVaultProperties class. */ + /** + * Creates an instance of DeletedVaultProperties class. + */ public DeletedVaultProperties() { } /** * Get the vaultId property: The resource id of the original vault. - * + * * @return the vaultId value. */ public String vaultId() { @@ -65,7 +66,7 @@ public String vaultId() { /** * Get the location property: The location of the original vault. - * + * * @return the location value. */ public String location() { @@ -74,7 +75,7 @@ public String location() { /** * Get the deletionDate property: The deleted date. - * + * * @return the deletionDate value. */ public OffsetDateTime deletionDate() { @@ -83,7 +84,7 @@ public OffsetDateTime deletionDate() { /** * Get the scheduledPurgeDate property: The scheduled purged date. - * + * * @return the scheduledPurgeDate value. */ public OffsetDateTime scheduledPurgeDate() { @@ -92,7 +93,7 @@ public OffsetDateTime scheduledPurgeDate() { /** * Get the tags property: Tags of the original vault. - * + * * @return the tags value. */ public Map tags() { @@ -101,7 +102,7 @@ public Map tags() { /** * Get the purgeProtectionEnabled property: Purge protection status of the original vault. - * + * * @return the purgeProtectionEnabled value. */ public Boolean purgeProtectionEnabled() { @@ -110,9 +111,58 @@ public Boolean purgeProtectionEnabled() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeletedVaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeletedVaultProperties 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 DeletedVaultProperties. + */ + public static DeletedVaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeletedVaultProperties deserializedDeletedVaultProperties = new DeletedVaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("vaultId".equals(fieldName)) { + deserializedDeletedVaultProperties.vaultId = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedDeletedVaultProperties.location = reader.getString(); + } else if ("deletionDate".equals(fieldName)) { + deserializedDeletedVaultProperties.deletionDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("scheduledPurgeDate".equals(fieldName)) { + deserializedDeletedVaultProperties.scheduledPurgeDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDeletedVaultProperties.tags = tags; + } else if ("purgeProtectionEnabled".equals(fieldName)) { + deserializedDeletedVaultProperties.purgeProtectionEnabled + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDeletedVaultProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletionRecoveryLevel.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletionRecoveryLevel.java new file mode 100644 index 0000000000000..a2728132f220d --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DeletionRecoveryLevel.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be + * permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention + * interval. + */ +public final class DeletionRecoveryLevel extends ExpandableStringEnum { + /** + * Static value Purgeable for DeletionRecoveryLevel. + */ + public static final DeletionRecoveryLevel PURGEABLE = fromString("Purgeable"); + + /** + * Static value Recoverable+Purgeable for DeletionRecoveryLevel. + */ + public static final DeletionRecoveryLevel RECOVERABLE_PURGEABLE = fromString("Recoverable+Purgeable"); + + /** + * Static value Recoverable for DeletionRecoveryLevel. + */ + public static final DeletionRecoveryLevel RECOVERABLE = fromString("Recoverable"); + + /** + * Static value Recoverable+ProtectedSubscription for DeletionRecoveryLevel. + */ + public static final DeletionRecoveryLevel RECOVERABLE_PROTECTED_SUBSCRIPTION + = fromString("Recoverable+ProtectedSubscription"); + + /** + * Creates a new instance of DeletionRecoveryLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeletionRecoveryLevel() { + } + + /** + * Creates or finds a DeletionRecoveryLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeletionRecoveryLevel. + */ + public static DeletionRecoveryLevel fromString(String name) { + return fromString(name, DeletionRecoveryLevel.class); + } + + /** + * Gets known DeletionRecoveryLevel values. + * + * @return known DeletionRecoveryLevel values. + */ + public static Collection values() { + return values(DeletionRecoveryLevel.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DimensionProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DimensionProperties.java index 3d66f1c158999..8b5ebc275ab57 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DimensionProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/DimensionProperties.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.keyvault.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; -/** Type of operation: get, read, delete, etc. */ +/** + * Type of operation: get, read, delete, etc. + */ @Fluent -public final class DimensionProperties { +public final class DimensionProperties implements JsonSerializable { /* * Name of dimension. */ - @JsonProperty(value = "name") private String name; /* * Display name of dimension. */ - @JsonProperty(value = "displayName") private String displayName; /* * Property to specify whether the dimension should be exported for Shoebox. */ - @JsonProperty(value = "toBeExportedForShoebox") private Boolean toBeExportedForShoebox; - /** Creates an instance of DimensionProperties class. */ + /** + * Creates an instance of DimensionProperties class. + */ public DimensionProperties() { } /** * Get the name property: Name of dimension. - * + * * @return the name value. */ public String name() { @@ -43,7 +48,7 @@ public String name() { /** * Set the name property: Name of dimension. - * + * * @param name the name value to set. * @return the DimensionProperties object itself. */ @@ -54,7 +59,7 @@ public DimensionProperties withName(String name) { /** * Get the displayName property: Display name of dimension. - * + * * @return the displayName value. */ public String displayName() { @@ -63,7 +68,7 @@ public String displayName() { /** * Set the displayName property: Display name of dimension. - * + * * @param displayName the displayName value to set. * @return the DimensionProperties object itself. */ @@ -75,7 +80,7 @@ public DimensionProperties withDisplayName(String displayName) { /** * Get the toBeExportedForShoebox property: Property to specify whether the dimension should be exported for * Shoebox. - * + * * @return the toBeExportedForShoebox value. */ public Boolean toBeExportedForShoebox() { @@ -85,7 +90,7 @@ public Boolean toBeExportedForShoebox() { /** * Set the toBeExportedForShoebox property: Property to specify whether the dimension should be exported for * Shoebox. - * + * * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. * @return the DimensionProperties object itself. */ @@ -96,9 +101,51 @@ public DimensionProperties withToBeExportedForShoebox(Boolean toBeExportedForSho /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeBooleanField("toBeExportedForShoebox", this.toBeExportedForShoebox); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DimensionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DimensionProperties 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 DimensionProperties. + */ + public static DimensionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DimensionProperties deserializedDimensionProperties = new DimensionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedDimensionProperties.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedDimensionProperties.displayName = reader.getString(); + } else if ("toBeExportedForShoebox".equals(fieldName)) { + deserializedDimensionProperties.toBeExportedForShoebox = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDimensionProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Error.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Error.java index 1a8351198e544..d364b0613f76a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Error.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Error.java @@ -5,34 +5,117 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.AdditionalInfo; import com.azure.core.management.exception.ManagementError; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; -/** The error exception. */ +/** + * The error exception. + */ @Immutable public final class Error extends ManagementError { /* * The inner error, contains a more specific error code. */ - @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) private Error innerError; - /** Creates an instance of Error class. */ + /* + * The error code parsed from the body of the http error response. + */ + private String code; + + /* + * The error message parsed from the body of the http error response. + */ + private String message; + + /* + * The target of the error. + */ + private String target; + + /* + * Details for the error. + */ + private List details; + + /* + * Additional info for the error. + */ + private List additionalInfo; + + /** + * Creates an instance of Error class. + */ public Error() { } /** * Get the innerError property: The inner error, contains a more specific error code. - * + * * @return the innerError value. */ public Error getInnerError() { return this.innerError; } + /** + * Get the code property: The error code parsed from the body of the http error response. + * + * @return the code value. + */ + @Override + public String getCode() { + return this.code; + } + + /** + * Get the message property: The error message parsed from the body of the http error response. + * + * @return the message value. + */ + @Override + public String getMessage() { + return this.message; + } + + /** + * Get the target property: The target of the error. + * + * @return the target value. + */ + @Override + public String getTarget() { + return this.target; + } + + /** + * Get the details property: Details for the error. + * + * @return the details value. + */ + @Override + public List getDetails() { + return this.details; + } + + /** + * Get the additionalInfo property: Additional info for the error. + * + * @return the additionalInfo value. + */ + @Override + public List getAdditionalInfo() { + return this.additionalInfo; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -40,4 +123,69 @@ public void validate() { getInnerError().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Error from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Error 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 Error. + */ + public static Error fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + JsonReader bufferedReader = reader.bufferObject(); + bufferedReader.nextToken(); + while (bufferedReader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = bufferedReader.getFieldName(); + bufferedReader.nextToken(); + + if ("error".equals(fieldName)) { + return readManagementError(bufferedReader); + } else { + bufferedReader.skipChildren(); + } + } + return readManagementError(bufferedReader.reset()); + }); + } + + private static Error readManagementError(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Error deserializedError = new Error(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedError.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedError.message = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedError.target = reader.getString(); + } else if ("details".equals(fieldName)) { + List details = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); + deserializedError.details = details; + } else if ("additionalInfo".equals(fieldName)) { + List additionalInfo = reader.readArray(reader1 -> AdditionalInfo.fromJson(reader1)); + deserializedError.additionalInfo = additionalInfo; + } else if ("innererror".equals(fieldName)) { + deserializedError.innerError = Error.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedError; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ErrorException.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ErrorException.java index 4759df7ae65b9..18a486ab07268 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ErrorException.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ErrorException.java @@ -7,11 +7,13 @@ import com.azure.core.http.HttpResponse; import com.azure.core.management.exception.ManagementException; -/** Exception thrown for an invalid response with Error information. */ +/** + * Exception thrown for an invalid response with Error information. + */ public final class ErrorException extends ManagementException { /** * Initializes a new instance of the ErrorException class. - * + * * @param message the exception message or the response content if a message is not available. * @param response the HTTP response. */ @@ -21,7 +23,7 @@ public ErrorException(String message, HttpResponse response) { /** * Initializes a new instance of the ErrorException class. - * + * * @param message the exception message or the response content if a message is not available. * @param response the HTTP response. * @param value the deserialized response value. @@ -30,7 +32,9 @@ public ErrorException(String message, HttpResponse response, Error value) { super(message, response, value); } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public Error getValue() { return (Error) super.getValue(); diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/GeoReplicationRegionProvisioningState.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/GeoReplicationRegionProvisioningState.java index c70e2ec4e0847..e4f4308ef5ecf 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/GeoReplicationRegionProvisioningState.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/GeoReplicationRegionProvisioningState.java @@ -5,33 +5,46 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current provisioning state. */ +/** + * The current provisioning state. + */ public final class GeoReplicationRegionProvisioningState extends ExpandableStringEnum { - /** Static value Preprovisioning for GeoReplicationRegionProvisioningState. */ + /** + * Static value Preprovisioning for GeoReplicationRegionProvisioningState. + */ public static final GeoReplicationRegionProvisioningState PREPROVISIONING = fromString("Preprovisioning"); - /** Static value Provisioning for GeoReplicationRegionProvisioningState. */ + /** + * Static value Provisioning for GeoReplicationRegionProvisioningState. + */ public static final GeoReplicationRegionProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Succeeded for GeoReplicationRegionProvisioningState. */ + /** + * Static value Succeeded for GeoReplicationRegionProvisioningState. + */ public static final GeoReplicationRegionProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for GeoReplicationRegionProvisioningState. */ + /** + * Static value Failed for GeoReplicationRegionProvisioningState. + */ public static final GeoReplicationRegionProvisioningState FAILED = fromString("Failed"); - /** Static value Deleting for GeoReplicationRegionProvisioningState. */ + /** + * Static value Deleting for GeoReplicationRegionProvisioningState. + */ public static final GeoReplicationRegionProvisioningState DELETING = fromString("Deleting"); - /** Static value Cleanup for GeoReplicationRegionProvisioningState. */ + /** + * Static value Cleanup for GeoReplicationRegionProvisioningState. + */ public static final GeoReplicationRegionProvisioningState CLEANUP = fromString("Cleanup"); /** * Creates a new instance of GeoReplicationRegionProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -40,18 +53,17 @@ public GeoReplicationRegionProvisioningState() { /** * Creates or finds a GeoReplicationRegionProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding GeoReplicationRegionProvisioningState. */ - @JsonCreator public static GeoReplicationRegionProvisioningState fromString(String name) { return fromString(name, GeoReplicationRegionProvisioningState.class); } /** * Gets known GeoReplicationRegionProvisioningState values. - * + * * @return known GeoReplicationRegionProvisioningState values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/IpRule.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/IpRule.java index 4c5f055fa807f..4085bfa49a68a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/IpRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/IpRule.java @@ -6,26 +6,33 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** A rule governing the accessibility of a vault from a specific ip address or ip range. */ +/** + * A rule governing the accessibility of a vault from a specific ip address or ip range. + */ @Fluent -public final class IpRule { +public final class IpRule implements JsonSerializable { /* * An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all * addresses that start with 124.56.78). */ - @JsonProperty(value = "value", required = true) private String value; - /** Creates an instance of IpRule class. */ + /** + * Creates an instance of IpRule class. + */ public IpRule() { } /** * Get the value property: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or * '124.56.78.0/24' (all addresses that start with 124.56.78). - * + * * @return the value value. */ public String value() { @@ -35,7 +42,7 @@ public String value() { /** * Set the value property: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or * '124.56.78.0/24' (all addresses that start with 124.56.78). - * + * * @param value the value value to set. * @return the IpRule object itself. */ @@ -46,15 +53,51 @@ public IpRule withValue(String value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property value in model IpRule")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property value in model IpRule")); } } private static final ClientLogger LOGGER = new ClientLogger(IpRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpRule 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 IpRule. + */ + public static IpRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpRule deserializedIpRule = new IpRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedIpRule.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyCurveName.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyCurveName.java new file mode 100644 index 0000000000000..1f005bcdf3d68 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyCurveName.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The elliptic curve name. For valid values, see JsonWebKeyCurveName. + */ +public final class JsonWebKeyCurveName extends ExpandableStringEnum { + /** + * Static value P-256 for JsonWebKeyCurveName. + */ + public static final JsonWebKeyCurveName P_256 = fromString("P-256"); + + /** + * Static value P-384 for JsonWebKeyCurveName. + */ + public static final JsonWebKeyCurveName P_384 = fromString("P-384"); + + /** + * Static value P-521 for JsonWebKeyCurveName. + */ + public static final JsonWebKeyCurveName P_521 = fromString("P-521"); + + /** + * Static value P-256K for JsonWebKeyCurveName. + */ + public static final JsonWebKeyCurveName P_256K = fromString("P-256K"); + + /** + * Creates a new instance of JsonWebKeyCurveName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JsonWebKeyCurveName() { + } + + /** + * Creates or finds a JsonWebKeyCurveName from its string representation. + * + * @param name a name to look for. + * @return the corresponding JsonWebKeyCurveName. + */ + public static JsonWebKeyCurveName fromString(String name) { + return fromString(name, JsonWebKeyCurveName.class); + } + + /** + * Gets known JsonWebKeyCurveName values. + * + * @return known JsonWebKeyCurveName values. + */ + public static Collection values() { + return values(JsonWebKeyCurveName.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyOperation.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyOperation.java new file mode 100644 index 0000000000000..83a89131d0f15 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyOperation.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The permitted JSON web key operations of the key. For more information, see JsonWebKeyOperation. + */ +public final class JsonWebKeyOperation extends ExpandableStringEnum { + /** + * Static value encrypt for JsonWebKeyOperation. + */ + public static final JsonWebKeyOperation ENCRYPT = fromString("encrypt"); + + /** + * Static value decrypt for JsonWebKeyOperation. + */ + public static final JsonWebKeyOperation DECRYPT = fromString("decrypt"); + + /** + * Static value sign for JsonWebKeyOperation. + */ + public static final JsonWebKeyOperation SIGN = fromString("sign"); + + /** + * Static value verify for JsonWebKeyOperation. + */ + public static final JsonWebKeyOperation VERIFY = fromString("verify"); + + /** + * Static value wrapKey for JsonWebKeyOperation. + */ + public static final JsonWebKeyOperation WRAP_KEY = fromString("wrapKey"); + + /** + * Static value unwrapKey for JsonWebKeyOperation. + */ + public static final JsonWebKeyOperation UNWRAP_KEY = fromString("unwrapKey"); + + /** + * Static value import for JsonWebKeyOperation. + */ + public static final JsonWebKeyOperation IMPORT = fromString("import"); + + /** + * Static value release for JsonWebKeyOperation. + */ + public static final JsonWebKeyOperation RELEASE = fromString("release"); + + /** + * Creates a new instance of JsonWebKeyOperation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JsonWebKeyOperation() { + } + + /** + * Creates or finds a JsonWebKeyOperation from its string representation. + * + * @param name a name to look for. + * @return the corresponding JsonWebKeyOperation. + */ + public static JsonWebKeyOperation fromString(String name) { + return fromString(name, JsonWebKeyOperation.class); + } + + /** + * Gets known JsonWebKeyOperation values. + * + * @return known JsonWebKeyOperation values. + */ + public static Collection values() { + return values(JsonWebKeyOperation.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyType.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyType.java new file mode 100644 index 0000000000000..aec33e91c6956 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/JsonWebKeyType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the key. For valid values, see JsonWebKeyType. + */ +public final class JsonWebKeyType extends ExpandableStringEnum { + /** + * Static value EC for JsonWebKeyType. + */ + public static final JsonWebKeyType EC = fromString("EC"); + + /** + * Static value EC-HSM for JsonWebKeyType. + */ + public static final JsonWebKeyType EC_HSM = fromString("EC-HSM"); + + /** + * Static value RSA for JsonWebKeyType. + */ + public static final JsonWebKeyType RSA = fromString("RSA"); + + /** + * Static value RSA-HSM for JsonWebKeyType. + */ + public static final JsonWebKeyType RSA_HSM = fromString("RSA-HSM"); + + /** + * Creates a new instance of JsonWebKeyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JsonWebKeyType() { + } + + /** + * Creates or finds a JsonWebKeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding JsonWebKeyType. + */ + public static JsonWebKeyType fromString(String name) { + return fromString(name, JsonWebKeyType.class); + } + + /** + * Gets known JsonWebKeyType values. + * + * @return known JsonWebKeyType values. + */ + public static Collection values() { + return values(JsonWebKeyType.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyAttributes.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyAttributes.java new file mode 100644 index 0000000000000..6bb9e02873a86 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyAttributes.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The object attributes managed by the Azure Key Vault service. + */ +@Fluent +public final class KeyAttributes implements JsonSerializable { + /* + * Determines whether or not the object is enabled. + */ + private Boolean enabled; + + /* + * Not before date in seconds since 1970-01-01T00:00:00Z. + */ + private Long notBefore; + + /* + * Expiry date in seconds since 1970-01-01T00:00:00Z. + */ + private Long expires; + + /* + * Creation time in seconds since 1970-01-01T00:00:00Z. + */ + private Long created; + + /* + * Last updated time in seconds since 1970-01-01T00:00:00Z. + */ + private Long updated; + + /* + * The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can + * be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the + * retention interval. + */ + private DeletionRecoveryLevel recoveryLevel; + + /* + * Indicates if the private key can be exported. + */ + private Boolean exportable; + + /** + * Creates an instance of KeyAttributes class. + */ + public KeyAttributes() { + } + + /** + * Get the enabled property: Determines whether or not the object is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether or not the object is enabled. + * + * @param enabled the enabled value to set. + * @return the KeyAttributes object itself. + */ + public KeyAttributes withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the notBefore property: Not before date in seconds since 1970-01-01T00:00:00Z. + * + * @return the notBefore value. + */ + public Long notBefore() { + return this.notBefore; + } + + /** + * Set the notBefore property: Not before date in seconds since 1970-01-01T00:00:00Z. + * + * @param notBefore the notBefore value to set. + * @return the KeyAttributes object itself. + */ + public KeyAttributes withNotBefore(Long notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * Get the expires property: Expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @return the expires value. + */ + public Long expires() { + return this.expires; + } + + /** + * Set the expires property: Expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @param expires the expires value to set. + * @return the KeyAttributes object itself. + */ + public KeyAttributes withExpires(Long expires) { + this.expires = expires; + return this; + } + + /** + * Get the created property: Creation time in seconds since 1970-01-01T00:00:00Z. + * + * @return the created value. + */ + public Long created() { + return this.created; + } + + /** + * Get the updated property: Last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @return the updated value. + */ + public Long updated() { + return this.updated; + } + + /** + * Get the recoveryLevel property: The deletion recovery level currently in effect for the object. If it contains + * 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can + * purge the object at the end of the retention interval. + * + * @return the recoveryLevel value. + */ + public DeletionRecoveryLevel recoveryLevel() { + return this.recoveryLevel; + } + + /** + * Get the exportable property: Indicates if the private key can be exported. + * + * @return the exportable value. + */ + public Boolean exportable() { + return this.exportable; + } + + /** + * Set the exportable property: Indicates if the private key can be exported. + * + * @param exportable the exportable value to set. + * @return the KeyAttributes object itself. + */ + public KeyAttributes withExportable(Boolean exportable) { + this.exportable = exportable; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("nbf", this.notBefore); + jsonWriter.writeNumberField("exp", this.expires); + jsonWriter.writeBooleanField("exportable", this.exportable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyAttributes 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 KeyAttributes. + */ + public static KeyAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyAttributes deserializedKeyAttributes = new KeyAttributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedKeyAttributes.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("nbf".equals(fieldName)) { + deserializedKeyAttributes.notBefore = reader.getNullable(JsonReader::getLong); + } else if ("exp".equals(fieldName)) { + deserializedKeyAttributes.expires = reader.getNullable(JsonReader::getLong); + } else if ("created".equals(fieldName)) { + deserializedKeyAttributes.created = reader.getNullable(JsonReader::getLong); + } else if ("updated".equals(fieldName)) { + deserializedKeyAttributes.updated = reader.getNullable(JsonReader::getLong); + } else if ("recoveryLevel".equals(fieldName)) { + deserializedKeyAttributes.recoveryLevel = DeletionRecoveryLevel.fromString(reader.getString()); + } else if ("exportable".equals(fieldName)) { + deserializedKeyAttributes.exportable = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyAttributes; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyCreateParameters.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyCreateParameters.java new file mode 100644 index 0000000000000..281985243de46 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyCreateParameters.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.keyvault.fluent.models.KeyProperties; +import java.io.IOException; +import java.util.Map; + +/** + * The parameters used to create a key. + */ +@Fluent +public final class KeyCreateParameters implements JsonSerializable { + /* + * The tags that will be assigned to the key. + */ + private Map tags; + + /* + * The properties of the key to be created. + */ + private KeyProperties properties; + + /** + * Creates an instance of KeyCreateParameters class. + */ + public KeyCreateParameters() { + } + + /** + * Get the tags property: The tags that will be assigned to the key. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags that will be assigned to the key. + * + * @param tags the tags value to set. + * @return the KeyCreateParameters object itself. + */ + public KeyCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The properties of the key to be created. + * + * @return the properties value. + */ + public KeyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the key to be created. + * + * @param properties the properties value to set. + * @return the KeyCreateParameters object itself. + */ + public KeyCreateParameters withProperties(KeyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model KeyCreateParameters")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyCreateParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyCreateParameters 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 KeyCreateParameters. + */ + public static KeyCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyCreateParameters deserializedKeyCreateParameters = new KeyCreateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedKeyCreateParameters.properties = KeyProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedKeyCreateParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedKeyCreateParameters; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyListResult.java new file mode 100644 index 0000000000000..0d7dd751dc159 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyListResult.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.KeyInner; +import java.io.IOException; +import java.util.List; + +/** + * The page of keys. + */ +@Fluent +public final class KeyListResult implements JsonSerializable { + /* + * The key resources. + */ + private List value; + + /* + * The URL to get the next page of keys. + */ + private String nextLink; + + /** + * Creates an instance of KeyListResult class. + */ + public KeyListResult() { + } + + /** + * Get the value property: The key resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The key resources. + * + * @param value the value value to set. + * @return the KeyListResult object itself. + */ + public KeyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next page of keys. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next page of keys. + * + * @param nextLink the nextLink value to set. + * @return the KeyListResult object itself. + */ + public KeyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyListResult 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 KeyListResult. + */ + public static KeyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyListResult deserializedKeyListResult = new KeyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> KeyInner.fromJson(reader1)); + deserializedKeyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedKeyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyListResult; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyPermissions.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyPermissions.java index 749945f56cacf..8a89019217652 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyPermissions.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyPermissions.java @@ -5,77 +5,120 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for KeyPermissions. */ +/** + * Defines values for KeyPermissions. + */ public final class KeyPermissions extends ExpandableStringEnum { - /** Static value all for KeyPermissions. */ + /** + * Static value all for KeyPermissions. + */ public static final KeyPermissions ALL = fromString("all"); - /** Static value encrypt for KeyPermissions. */ + /** + * Static value encrypt for KeyPermissions. + */ public static final KeyPermissions ENCRYPT = fromString("encrypt"); - /** Static value decrypt for KeyPermissions. */ + /** + * Static value decrypt for KeyPermissions. + */ public static final KeyPermissions DECRYPT = fromString("decrypt"); - /** Static value wrapKey for KeyPermissions. */ + /** + * Static value wrapKey for KeyPermissions. + */ public static final KeyPermissions WRAP_KEY = fromString("wrapKey"); - /** Static value unwrapKey for KeyPermissions. */ + /** + * Static value unwrapKey for KeyPermissions. + */ public static final KeyPermissions UNWRAP_KEY = fromString("unwrapKey"); - /** Static value sign for KeyPermissions. */ + /** + * Static value sign for KeyPermissions. + */ public static final KeyPermissions SIGN = fromString("sign"); - /** Static value verify for KeyPermissions. */ + /** + * Static value verify for KeyPermissions. + */ public static final KeyPermissions VERIFY = fromString("verify"); - /** Static value get for KeyPermissions. */ + /** + * Static value get for KeyPermissions. + */ public static final KeyPermissions GET = fromString("get"); - /** Static value list for KeyPermissions. */ + /** + * Static value list for KeyPermissions. + */ public static final KeyPermissions LIST = fromString("list"); - /** Static value create for KeyPermissions. */ + /** + * Static value create for KeyPermissions. + */ public static final KeyPermissions CREATE = fromString("create"); - /** Static value update for KeyPermissions. */ + /** + * Static value update for KeyPermissions. + */ public static final KeyPermissions UPDATE = fromString("update"); - /** Static value import for KeyPermissions. */ + /** + * Static value import for KeyPermissions. + */ public static final KeyPermissions IMPORT = fromString("import"); - /** Static value delete for KeyPermissions. */ + /** + * Static value delete for KeyPermissions. + */ public static final KeyPermissions DELETE = fromString("delete"); - /** Static value backup for KeyPermissions. */ + /** + * Static value backup for KeyPermissions. + */ public static final KeyPermissions BACKUP = fromString("backup"); - /** Static value restore for KeyPermissions. */ + /** + * Static value restore for KeyPermissions. + */ public static final KeyPermissions RESTORE = fromString("restore"); - /** Static value recover for KeyPermissions. */ + /** + * Static value recover for KeyPermissions. + */ public static final KeyPermissions RECOVER = fromString("recover"); - /** Static value purge for KeyPermissions. */ + /** + * Static value purge for KeyPermissions. + */ public static final KeyPermissions PURGE = fromString("purge"); - /** Static value release for KeyPermissions. */ + /** + * Static value release for KeyPermissions. + */ public static final KeyPermissions RELEASE = fromString("release"); - /** Static value rotate for KeyPermissions. */ + /** + * Static value rotate for KeyPermissions. + */ public static final KeyPermissions ROTATE = fromString("rotate"); - /** Static value getrotationpolicy for KeyPermissions. */ + /** + * Static value getrotationpolicy for KeyPermissions. + */ public static final KeyPermissions GETROTATIONPOLICY = fromString("getrotationpolicy"); - /** Static value setrotationpolicy for KeyPermissions. */ + /** + * Static value setrotationpolicy for KeyPermissions. + */ public static final KeyPermissions SETROTATIONPOLICY = fromString("setrotationpolicy"); /** * Creates a new instance of KeyPermissions value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -84,18 +127,17 @@ public KeyPermissions() { /** * Creates or finds a KeyPermissions from its string representation. - * + * * @param name a name to look for. * @return the corresponding KeyPermissions. */ - @JsonCreator public static KeyPermissions fromString(String name) { return fromString(name, KeyPermissions.class); } /** * Gets known KeyPermissions values. - * + * * @return known KeyPermissions values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyReleasePolicy.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyReleasePolicy.java new file mode 100644 index 0000000000000..00f48d1fd6932 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyReleasePolicy.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.Base64Url; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; + +/** + * The KeyReleasePolicy model. + */ +@Fluent +public final class KeyReleasePolicy implements JsonSerializable { + private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; + + /* + * Content type and version of key release policy + */ + private String contentType; + + /* + * Blob encoding the policy rules under which the key can be released. + */ + private Base64Url data; + + /** + * Creates an instance of KeyReleasePolicy class. + */ + public KeyReleasePolicy() { + } + + /** + * Get the contentType property: Content type and version of key release policy. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: Content type and version of key release policy. + * + * @param contentType the contentType value to set. + * @return the KeyReleasePolicy object itself. + */ + public KeyReleasePolicy withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the data property: Blob encoding the policy rules under which the key can be released. + * + * @return the data value. + */ + public byte[] data() { + if (this.data == null) { + return EMPTY_BYTE_ARRAY; + } + return this.data.decodedBytes(); + } + + /** + * Set the data property: Blob encoding the policy rules under which the key can be released. + * + * @param data the data value to set. + * @return the KeyReleasePolicy object itself. + */ + public KeyReleasePolicy withData(byte[] data) { + if (data == null) { + this.data = null; + } else { + this.data = Base64Url.encode(CoreUtils.clone(data)); + } + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentType", this.contentType); + jsonWriter.writeStringField("data", Objects.toString(this.data, null)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyReleasePolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyReleasePolicy 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 KeyReleasePolicy. + */ + public static KeyReleasePolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyReleasePolicy deserializedKeyReleasePolicy = new KeyReleasePolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentType".equals(fieldName)) { + deserializedKeyReleasePolicy.contentType = reader.getString(); + } else if ("data".equals(fieldName)) { + deserializedKeyReleasePolicy.data + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyReleasePolicy; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyRotationPolicyActionType.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyRotationPolicyActionType.java new file mode 100644 index 0000000000000..52a470075a12f --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyRotationPolicyActionType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +/** + * The type of action. + */ +public enum KeyRotationPolicyActionType { + /** + * Enum value rotate. + */ + ROTATE("rotate"), + + /** + * Enum value notify. + */ + NOTIFY("notify"); + + /** + * The actual serialized value for a KeyRotationPolicyActionType instance. + */ + private final String value; + + KeyRotationPolicyActionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a KeyRotationPolicyActionType instance. + * + * @param value the serialized value to parse. + * @return the parsed KeyRotationPolicyActionType object, or null if unable to parse. + */ + public static KeyRotationPolicyActionType fromString(String value) { + if (value == null) { + return null; + } + KeyRotationPolicyActionType[] items = KeyRotationPolicyActionType.values(); + for (KeyRotationPolicyActionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyRotationPolicyAttributes.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyRotationPolicyAttributes.java new file mode 100644 index 0000000000000..25f417c47f218 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/KeyRotationPolicyAttributes.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The KeyRotationPolicyAttributes model. + */ +@Fluent +public final class KeyRotationPolicyAttributes implements JsonSerializable { + /* + * Creation time in seconds since 1970-01-01T00:00:00Z. + */ + private Long created; + + /* + * Last updated time in seconds since 1970-01-01T00:00:00Z. + */ + private Long updated; + + /* + * The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'. + */ + private String expiryTime; + + /** + * Creates an instance of KeyRotationPolicyAttributes class. + */ + public KeyRotationPolicyAttributes() { + } + + /** + * Get the created property: Creation time in seconds since 1970-01-01T00:00:00Z. + * + * @return the created value. + */ + public Long created() { + return this.created; + } + + /** + * Get the updated property: Last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @return the updated value. + */ + public Long updated() { + return this.updated; + } + + /** + * Get the expiryTime property: The expiration time for the new key version. It should be in ISO8601 format. Eg: + * 'P90D', 'P1Y'. + * + * @return the expiryTime value. + */ + public String expiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: The expiration time for the new key version. It should be in ISO8601 format. Eg: + * 'P90D', 'P1Y'. + * + * @param expiryTime the expiryTime value to set. + * @return the KeyRotationPolicyAttributes object itself. + */ + public KeyRotationPolicyAttributes withExpiryTime(String expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expiryTime", this.expiryTime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyRotationPolicyAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyRotationPolicyAttributes 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 KeyRotationPolicyAttributes. + */ + public static KeyRotationPolicyAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + KeyRotationPolicyAttributes deserializedKeyRotationPolicyAttributes = new KeyRotationPolicyAttributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("created".equals(fieldName)) { + deserializedKeyRotationPolicyAttributes.created = reader.getNullable(JsonReader::getLong); + } else if ("updated".equals(fieldName)) { + deserializedKeyRotationPolicyAttributes.updated = reader.getNullable(JsonReader::getLong); + } else if ("expiryTime".equals(fieldName)) { + deserializedKeyRotationPolicyAttributes.expiryTime = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedKeyRotationPolicyAttributes; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LifetimeAction.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LifetimeAction.java new file mode 100644 index 0000000000000..e526f12e81f6d --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LifetimeAction.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The LifetimeAction model. + */ +@Fluent +public final class LifetimeAction implements JsonSerializable { + /* + * The trigger of key rotation policy lifetimeAction. + */ + private Trigger trigger; + + /* + * The action of key rotation policy lifetimeAction. + */ + private Action action; + + /** + * Creates an instance of LifetimeAction class. + */ + public LifetimeAction() { + } + + /** + * Get the trigger property: The trigger of key rotation policy lifetimeAction. + * + * @return the trigger value. + */ + public Trigger trigger() { + return this.trigger; + } + + /** + * Set the trigger property: The trigger of key rotation policy lifetimeAction. + * + * @param trigger the trigger value to set. + * @return the LifetimeAction object itself. + */ + public LifetimeAction withTrigger(Trigger trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the action property: The action of key rotation policy lifetimeAction. + * + * @return the action value. + */ + public Action action() { + return this.action; + } + + /** + * Set the action property: The action of key rotation policy lifetimeAction. + * + * @param action the action value to set. + * @return the LifetimeAction object itself. + */ + public LifetimeAction withAction(Action action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (trigger() != null) { + trigger().validate(); + } + if (action() != null) { + action().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trigger", this.trigger); + jsonWriter.writeJsonField("action", this.action); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LifetimeAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LifetimeAction 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 LifetimeAction. + */ + public static LifetimeAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LifetimeAction deserializedLifetimeAction = new LifetimeAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trigger".equals(fieldName)) { + deserializedLifetimeAction.trigger = Trigger.fromJson(reader); + } else if ("action".equals(fieldName)) { + deserializedLifetimeAction.action = Action.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedLifetimeAction; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LogSpecification.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LogSpecification.java index 2e4b563c062c9..15afcae4ef329 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LogSpecification.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/LogSpecification.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.keyvault.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; -/** Log specification of operation. */ +/** + * Log specification of operation. + */ @Fluent -public final class LogSpecification { +public final class LogSpecification implements JsonSerializable { /* * Name of log specification. */ - @JsonProperty(value = "name") private String name; /* * Display name of log specification. */ - @JsonProperty(value = "displayName") private String displayName; /* * Blob duration of specification. */ - @JsonProperty(value = "blobDuration") private String blobDuration; - /** Creates an instance of LogSpecification class. */ + /** + * Creates an instance of LogSpecification class. + */ public LogSpecification() { } /** * Get the name property: Name of log specification. - * + * * @return the name value. */ public String name() { @@ -43,7 +48,7 @@ public String name() { /** * Set the name property: Name of log specification. - * + * * @param name the name value to set. * @return the LogSpecification object itself. */ @@ -54,7 +59,7 @@ public LogSpecification withName(String name) { /** * Get the displayName property: Display name of log specification. - * + * * @return the displayName value. */ public String displayName() { @@ -63,7 +68,7 @@ public String displayName() { /** * Set the displayName property: Display name of log specification. - * + * * @param displayName the displayName value to set. * @return the LogSpecification object itself. */ @@ -74,7 +79,7 @@ public LogSpecification withDisplayName(String displayName) { /** * Get the blobDuration property: Blob duration of specification. - * + * * @return the blobDuration value. */ public String blobDuration() { @@ -83,7 +88,7 @@ public String blobDuration() { /** * Set the blobDuration property: Blob duration of specification. - * + * * @param blobDuration the blobDuration value to set. * @return the LogSpecification object itself. */ @@ -94,9 +99,51 @@ public LogSpecification withBlobDuration(String blobDuration) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("blobDuration", this.blobDuration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogSpecification 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 LogSpecification. + */ + public static LogSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogSpecification deserializedLogSpecification = new LogSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLogSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedLogSpecification.displayName = reader.getString(); + } else if ("blobDuration".equals(fieldName)) { + deserializedLogSpecification.blobDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogSpecification; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmAction.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmAction.java new file mode 100644 index 0000000000000..560e8054b1139 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmAction.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ManagedHsmAction model. + */ +@Fluent +public final class ManagedHsmAction implements JsonSerializable { + /* + * The type of action. + */ + private KeyRotationPolicyActionType type; + + /** + * Creates an instance of ManagedHsmAction class. + */ + public ManagedHsmAction() { + } + + /** + * Get the type property: The type of action. + * + * @return the type value. + */ + public KeyRotationPolicyActionType type() { + return this.type; + } + + /** + * Set the type property: The type of action. + * + * @param type the type value to set. + * @return the ManagedHsmAction object itself. + */ + public ManagedHsmAction withType(KeyRotationPolicyActionType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmAction 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 ManagedHsmAction. + */ + public static ManagedHsmAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmAction deserializedManagedHsmAction = new ManagedHsmAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedHsmAction.type = KeyRotationPolicyActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmAction; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyAttributes.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyAttributes.java new file mode 100644 index 0000000000000..43972d9c43e6a --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyAttributes.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The object attributes managed by the Azure Key Vault service. + */ +@Fluent +public final class ManagedHsmKeyAttributes implements JsonSerializable { + /* + * Determines whether or not the object is enabled. + */ + private Boolean enabled; + + /* + * Not before date in seconds since 1970-01-01T00:00:00Z. + */ + private Long notBefore; + + /* + * Expiry date in seconds since 1970-01-01T00:00:00Z. + */ + private Long expires; + + /* + * Creation time in seconds since 1970-01-01T00:00:00Z. + */ + private Long created; + + /* + * Last updated time in seconds since 1970-01-01T00:00:00Z. + */ + private Long updated; + + /* + * The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can + * be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the + * retention interval. + */ + private DeletionRecoveryLevel recoveryLevel; + + /* + * Indicates if the private key can be exported. + */ + private Boolean exportable; + + /** + * Creates an instance of ManagedHsmKeyAttributes class. + */ + public ManagedHsmKeyAttributes() { + } + + /** + * Get the enabled property: Determines whether or not the object is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Determines whether or not the object is enabled. + * + * @param enabled the enabled value to set. + * @return the ManagedHsmKeyAttributes object itself. + */ + public ManagedHsmKeyAttributes withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the notBefore property: Not before date in seconds since 1970-01-01T00:00:00Z. + * + * @return the notBefore value. + */ + public Long notBefore() { + return this.notBefore; + } + + /** + * Set the notBefore property: Not before date in seconds since 1970-01-01T00:00:00Z. + * + * @param notBefore the notBefore value to set. + * @return the ManagedHsmKeyAttributes object itself. + */ + public ManagedHsmKeyAttributes withNotBefore(Long notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * Get the expires property: Expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @return the expires value. + */ + public Long expires() { + return this.expires; + } + + /** + * Set the expires property: Expiry date in seconds since 1970-01-01T00:00:00Z. + * + * @param expires the expires value to set. + * @return the ManagedHsmKeyAttributes object itself. + */ + public ManagedHsmKeyAttributes withExpires(Long expires) { + this.expires = expires; + return this; + } + + /** + * Get the created property: Creation time in seconds since 1970-01-01T00:00:00Z. + * + * @return the created value. + */ + public Long created() { + return this.created; + } + + /** + * Get the updated property: Last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @return the updated value. + */ + public Long updated() { + return this.updated; + } + + /** + * Get the recoveryLevel property: The deletion recovery level currently in effect for the object. If it contains + * 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can + * purge the object at the end of the retention interval. + * + * @return the recoveryLevel value. + */ + public DeletionRecoveryLevel recoveryLevel() { + return this.recoveryLevel; + } + + /** + * Get the exportable property: Indicates if the private key can be exported. + * + * @return the exportable value. + */ + public Boolean exportable() { + return this.exportable; + } + + /** + * Set the exportable property: Indicates if the private key can be exported. + * + * @param exportable the exportable value to set. + * @return the ManagedHsmKeyAttributes object itself. + */ + public ManagedHsmKeyAttributes withExportable(Boolean exportable) { + this.exportable = exportable; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeNumberField("nbf", this.notBefore); + jsonWriter.writeNumberField("exp", this.expires); + jsonWriter.writeBooleanField("exportable", this.exportable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmKeyAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmKeyAttributes 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 ManagedHsmKeyAttributes. + */ + public static ManagedHsmKeyAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmKeyAttributes deserializedManagedHsmKeyAttributes = new ManagedHsmKeyAttributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedManagedHsmKeyAttributes.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("nbf".equals(fieldName)) { + deserializedManagedHsmKeyAttributes.notBefore = reader.getNullable(JsonReader::getLong); + } else if ("exp".equals(fieldName)) { + deserializedManagedHsmKeyAttributes.expires = reader.getNullable(JsonReader::getLong); + } else if ("created".equals(fieldName)) { + deserializedManagedHsmKeyAttributes.created = reader.getNullable(JsonReader::getLong); + } else if ("updated".equals(fieldName)) { + deserializedManagedHsmKeyAttributes.updated = reader.getNullable(JsonReader::getLong); + } else if ("recoveryLevel".equals(fieldName)) { + deserializedManagedHsmKeyAttributes.recoveryLevel + = DeletionRecoveryLevel.fromString(reader.getString()); + } else if ("exportable".equals(fieldName)) { + deserializedManagedHsmKeyAttributes.exportable = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmKeyAttributes; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyCreateParameters.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyCreateParameters.java new file mode 100644 index 0000000000000..787c88355cd92 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyCreateParameters.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.keyvault.fluent.models.ManagedHsmKeyProperties; +import java.io.IOException; +import java.util.Map; + +/** + * The parameters used to create a key. + */ +@Fluent +public final class ManagedHsmKeyCreateParameters implements JsonSerializable { + /* + * The tags that will be assigned to the key. + */ + private Map tags; + + /* + * The properties of the key to be created. + */ + private ManagedHsmKeyProperties properties; + + /** + * Creates an instance of ManagedHsmKeyCreateParameters class. + */ + public ManagedHsmKeyCreateParameters() { + } + + /** + * Get the tags property: The tags that will be assigned to the key. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags that will be assigned to the key. + * + * @param tags the tags value to set. + * @return the ManagedHsmKeyCreateParameters object itself. + */ + public ManagedHsmKeyCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The properties of the key to be created. + * + * @return the properties value. + */ + public ManagedHsmKeyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the key to be created. + * + * @param properties the properties value to set. + * @return the ManagedHsmKeyCreateParameters object itself. + */ + public ManagedHsmKeyCreateParameters withProperties(ManagedHsmKeyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model ManagedHsmKeyCreateParameters")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedHsmKeyCreateParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmKeyCreateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmKeyCreateParameters 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 ManagedHsmKeyCreateParameters. + */ + public static ManagedHsmKeyCreateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmKeyCreateParameters deserializedManagedHsmKeyCreateParameters + = new ManagedHsmKeyCreateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedManagedHsmKeyCreateParameters.properties = ManagedHsmKeyProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedHsmKeyCreateParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmKeyCreateParameters; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyListResult.java new file mode 100644 index 0000000000000..f9ef911718813 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyListResult.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.ManagedHsmKeyInner; +import java.io.IOException; +import java.util.List; + +/** + * The page of keys. + */ +@Fluent +public final class ManagedHsmKeyListResult implements JsonSerializable { + /* + * The key resources. + */ + private List value; + + /* + * The URL to get the next page of keys. + */ + private String nextLink; + + /** + * Creates an instance of ManagedHsmKeyListResult class. + */ + public ManagedHsmKeyListResult() { + } + + /** + * Get the value property: The key resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The key resources. + * + * @param value the value value to set. + * @return the ManagedHsmKeyListResult object itself. + */ + public ManagedHsmKeyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next page of keys. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next page of keys. + * + * @param nextLink the nextLink value to set. + * @return the ManagedHsmKeyListResult object itself. + */ + public ManagedHsmKeyListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmKeyListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmKeyListResult 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 ManagedHsmKeyListResult. + */ + public static ManagedHsmKeyListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmKeyListResult deserializedManagedHsmKeyListResult = new ManagedHsmKeyListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ManagedHsmKeyInner.fromJson(reader1)); + deserializedManagedHsmKeyListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedManagedHsmKeyListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmKeyListResult; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyReleasePolicy.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyReleasePolicy.java new file mode 100644 index 0000000000000..d8d3f3619aa1a --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyReleasePolicy.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.Base64Url; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Objects; + +/** + * The ManagedHsmKeyReleasePolicy model. + */ +@Fluent +public final class ManagedHsmKeyReleasePolicy implements JsonSerializable { + private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; + + /* + * Content type and version of key release policy + */ + private String contentType; + + /* + * Blob encoding the policy rules under which the key can be released. + */ + private Base64Url data; + + /** + * Creates an instance of ManagedHsmKeyReleasePolicy class. + */ + public ManagedHsmKeyReleasePolicy() { + } + + /** + * Get the contentType property: Content type and version of key release policy. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: Content type and version of key release policy. + * + * @param contentType the contentType value to set. + * @return the ManagedHsmKeyReleasePolicy object itself. + */ + public ManagedHsmKeyReleasePolicy withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the data property: Blob encoding the policy rules under which the key can be released. + * + * @return the data value. + */ + public byte[] data() { + if (this.data == null) { + return EMPTY_BYTE_ARRAY; + } + return this.data.decodedBytes(); + } + + /** + * Set the data property: Blob encoding the policy rules under which the key can be released. + * + * @param data the data value to set. + * @return the ManagedHsmKeyReleasePolicy object itself. + */ + public ManagedHsmKeyReleasePolicy withData(byte[] data) { + if (data == null) { + this.data = null; + } else { + this.data = Base64Url.encode(CoreUtils.clone(data)); + } + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contentType", this.contentType); + jsonWriter.writeStringField("data", Objects.toString(this.data, null)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmKeyReleasePolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmKeyReleasePolicy 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 ManagedHsmKeyReleasePolicy. + */ + public static ManagedHsmKeyReleasePolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmKeyReleasePolicy deserializedManagedHsmKeyReleasePolicy = new ManagedHsmKeyReleasePolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentType".equals(fieldName)) { + deserializedManagedHsmKeyReleasePolicy.contentType = reader.getString(); + } else if ("data".equals(fieldName)) { + deserializedManagedHsmKeyReleasePolicy.data + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmKeyReleasePolicy; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyRotationPolicyAttributes.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyRotationPolicyAttributes.java new file mode 100644 index 0000000000000..67258cb826981 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmKeyRotationPolicyAttributes.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ManagedHsmKeyRotationPolicyAttributes model. + */ +@Fluent +public final class ManagedHsmKeyRotationPolicyAttributes + implements JsonSerializable { + /* + * Creation time in seconds since 1970-01-01T00:00:00Z. + */ + private Long created; + + /* + * Last updated time in seconds since 1970-01-01T00:00:00Z. + */ + private Long updated; + + /* + * The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'. + */ + private String expiryTime; + + /** + * Creates an instance of ManagedHsmKeyRotationPolicyAttributes class. + */ + public ManagedHsmKeyRotationPolicyAttributes() { + } + + /** + * Get the created property: Creation time in seconds since 1970-01-01T00:00:00Z. + * + * @return the created value. + */ + public Long created() { + return this.created; + } + + /** + * Get the updated property: Last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @return the updated value. + */ + public Long updated() { + return this.updated; + } + + /** + * Get the expiryTime property: The expiration time for the new key version. It should be in ISO8601 format. Eg: + * 'P90D', 'P1Y'. + * + * @return the expiryTime value. + */ + public String expiryTime() { + return this.expiryTime; + } + + /** + * Set the expiryTime property: The expiration time for the new key version. It should be in ISO8601 format. Eg: + * 'P90D', 'P1Y'. + * + * @param expiryTime the expiryTime value to set. + * @return the ManagedHsmKeyRotationPolicyAttributes object itself. + */ + public ManagedHsmKeyRotationPolicyAttributes withExpiryTime(String expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("expiryTime", this.expiryTime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmKeyRotationPolicyAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmKeyRotationPolicyAttributes 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 ManagedHsmKeyRotationPolicyAttributes. + */ + public static ManagedHsmKeyRotationPolicyAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmKeyRotationPolicyAttributes deserializedManagedHsmKeyRotationPolicyAttributes + = new ManagedHsmKeyRotationPolicyAttributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("created".equals(fieldName)) { + deserializedManagedHsmKeyRotationPolicyAttributes.created = reader.getNullable(JsonReader::getLong); + } else if ("updated".equals(fieldName)) { + deserializedManagedHsmKeyRotationPolicyAttributes.updated = reader.getNullable(JsonReader::getLong); + } else if ("expiryTime".equals(fieldName)) { + deserializedManagedHsmKeyRotationPolicyAttributes.expiryTime = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmKeyRotationPolicyAttributes; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmLifetimeAction.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmLifetimeAction.java new file mode 100644 index 0000000000000..e9446b75a1d9b --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmLifetimeAction.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ManagedHsmLifetimeAction model. + */ +@Fluent +public final class ManagedHsmLifetimeAction implements JsonSerializable { + /* + * The trigger of key rotation policy lifetimeAction. + */ + private ManagedHsmTrigger trigger; + + /* + * The action of key rotation policy lifetimeAction. + */ + private ManagedHsmAction action; + + /** + * Creates an instance of ManagedHsmLifetimeAction class. + */ + public ManagedHsmLifetimeAction() { + } + + /** + * Get the trigger property: The trigger of key rotation policy lifetimeAction. + * + * @return the trigger value. + */ + public ManagedHsmTrigger trigger() { + return this.trigger; + } + + /** + * Set the trigger property: The trigger of key rotation policy lifetimeAction. + * + * @param trigger the trigger value to set. + * @return the ManagedHsmLifetimeAction object itself. + */ + public ManagedHsmLifetimeAction withTrigger(ManagedHsmTrigger trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the action property: The action of key rotation policy lifetimeAction. + * + * @return the action value. + */ + public ManagedHsmAction action() { + return this.action; + } + + /** + * Set the action property: The action of key rotation policy lifetimeAction. + * + * @param action the action value to set. + * @return the ManagedHsmLifetimeAction object itself. + */ + public ManagedHsmLifetimeAction withAction(ManagedHsmAction action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (trigger() != null) { + trigger().validate(); + } + if (action() != null) { + action().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("trigger", this.trigger); + jsonWriter.writeJsonField("action", this.action); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmLifetimeAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmLifetimeAction 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 ManagedHsmLifetimeAction. + */ + public static ManagedHsmLifetimeAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmLifetimeAction deserializedManagedHsmLifetimeAction = new ManagedHsmLifetimeAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("trigger".equals(fieldName)) { + deserializedManagedHsmLifetimeAction.trigger = ManagedHsmTrigger.fromJson(reader); + } else if ("action".equals(fieldName)) { + deserializedManagedHsmLifetimeAction.action = ManagedHsmAction.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmLifetimeAction; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmListResult.java index c4949075c8574..f6f0aeb29d56e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmListResult.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.ManagedHsmInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of managed HSM Pools. */ +/** + * List of managed HSM Pools. + */ @Fluent -public final class ManagedHsmListResult { +public final class ManagedHsmListResult implements JsonSerializable { /* * The list of managed HSM Pools. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of managed HSM Pools. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of ManagedHsmListResult class. */ + /** + * Creates an instance of ManagedHsmListResult class. + */ public ManagedHsmListResult() { } /** * Get the value property: The list of managed HSM Pools. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The list of managed HSM Pools. - * + * * @param value the value value to set. * @return the ManagedHsmListResult object itself. */ @@ -50,7 +56,7 @@ public ManagedHsmListResult withValue(List value) { /** * Get the nextLink property: The URL to get the next set of managed HSM Pools. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URL to get the next set of managed HSM Pools. - * + * * @param nextLink the nextLink value to set. * @return the ManagedHsmListResult object itself. */ @@ -70,7 +76,7 @@ public ManagedHsmListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,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)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmListResult 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 ManagedHsmListResult. + */ + public static ManagedHsmListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmListResult deserializedManagedHsmListResult = new ManagedHsmListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> ManagedHsmInner.fromJson(reader1)); + deserializedManagedHsmListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedManagedHsmListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmProperties.java index 5da18bbf008df..caa3c20e5f65e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmProperties.java @@ -5,45 +5,48 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.keyvault.fluent.models.MhsmGeoReplicatedRegionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; +import java.util.Objects; import java.util.UUID; -/** Properties of the managed HSM Pool. */ +/** + * Properties of the managed HSM Pool. + */ @Fluent -public final class ManagedHsmProperties { +public final class ManagedHsmProperties implements JsonSerializable { /* * The Azure Active Directory tenant ID that should be used for authenticating requests to the managed HSM pool. */ - @JsonProperty(value = "tenantId") private UUID tenantId; /* * Array of initial administrators object ids for this managed hsm pool. */ - @JsonProperty(value = "initialAdminObjectIds") private List initialAdminObjectIds; /* * The URI of the managed hsm pool for performing operations on keys. */ - @JsonProperty(value = "hsmUri", access = JsonProperty.Access.WRITE_ONLY) private String hsmUri; /* * Property to specify whether the 'soft delete' functionality is enabled for this managed HSM pool. Soft delete is * enabled by default for all managed HSMs and is immutable. */ - @JsonProperty(value = "enableSoftDelete") private Boolean enableSoftDelete; /* * Soft deleted data retention days. When you delete an HSM or a key, it will remain recoverable for the configured * retention period or for a default period of 90 days. It accepts values between 7 and 90. */ - @JsonProperty(value = "softDeleteRetentionInDays") private Integer softDeleteRetentionInDays; /* @@ -51,71 +54,63 @@ public final class ManagedHsmProperties { * to true activates protection against purge for this managed HSM pool and its content - only the Managed HSM * service may initiate a hard, irrecoverable deletion. Enabling this functionality is irreversible. */ - @JsonProperty(value = "enablePurgeProtection") private Boolean enablePurgeProtection; /* * The create mode to indicate whether the resource is being created or is being recovered from a deleted resource. */ - @JsonProperty(value = "createMode") private CreateMode createMode; /* * Resource Status Message. */ - @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY) private String statusMessage; /* * Provisioning state. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * Rules governing the accessibility of the key vault from specific network locations. */ - @JsonProperty(value = "networkAcls") private MhsmNetworkRuleSet networkAcls; /* * List of all regions associated with the managed hsm pool. */ - @JsonProperty(value = "regions") private List regions; /* * List of private endpoint connections associated with the managed hsm pool. */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; /* * Control permission to the managed HSM from public networks. */ - @JsonProperty(value = "publicNetworkAccess") private PublicNetworkAccess publicNetworkAccess; /* * The scheduled purge date in UTC. */ - @JsonProperty(value = "scheduledPurgeDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime scheduledPurgeDate; /* * Managed HSM security domain properties. */ - @JsonProperty(value = "securityDomainProperties", access = JsonProperty.Access.WRITE_ONLY) private ManagedHsmSecurityDomainProperties securityDomainProperties; - /** Creates an instance of ManagedHsmProperties class. */ + /** + * Creates an instance of ManagedHsmProperties class. + */ public ManagedHsmProperties() { } /** * Get the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests * to the managed HSM pool. - * + * * @return the tenantId value. */ public UUID tenantId() { @@ -125,7 +120,7 @@ public UUID tenantId() { /** * Set the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests * to the managed HSM pool. - * + * * @param tenantId the tenantId value to set. * @return the ManagedHsmProperties object itself. */ @@ -136,7 +131,7 @@ public ManagedHsmProperties withTenantId(UUID tenantId) { /** * Get the initialAdminObjectIds property: Array of initial administrators object ids for this managed hsm pool. - * + * * @return the initialAdminObjectIds value. */ public List initialAdminObjectIds() { @@ -145,7 +140,7 @@ public List initialAdminObjectIds() { /** * Set the initialAdminObjectIds property: Array of initial administrators object ids for this managed hsm pool. - * + * * @param initialAdminObjectIds the initialAdminObjectIds value to set. * @return the ManagedHsmProperties object itself. */ @@ -156,7 +151,7 @@ public ManagedHsmProperties withInitialAdminObjectIds(List initialAdminO /** * Get the hsmUri property: The URI of the managed hsm pool for performing operations on keys. - * + * * @return the hsmUri value. */ public String hsmUri() { @@ -166,7 +161,7 @@ public String hsmUri() { /** * Get the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for * this managed HSM pool. Soft delete is enabled by default for all managed HSMs and is immutable. - * + * * @return the enableSoftDelete value. */ public Boolean enableSoftDelete() { @@ -176,7 +171,7 @@ public Boolean enableSoftDelete() { /** * Set the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for * this managed HSM pool. Soft delete is enabled by default for all managed HSMs and is immutable. - * + * * @param enableSoftDelete the enableSoftDelete value to set. * @return the ManagedHsmProperties object itself. */ @@ -189,7 +184,7 @@ public ManagedHsmProperties withEnableSoftDelete(Boolean enableSoftDelete) { * Get the softDeleteRetentionInDays property: Soft deleted data retention days. When you delete an HSM or a key, it * will remain recoverable for the configured retention period or for a default period of 90 days. It accepts values * between 7 and 90. - * + * * @return the softDeleteRetentionInDays value. */ public Integer softDeleteRetentionInDays() { @@ -200,7 +195,7 @@ public Integer softDeleteRetentionInDays() { * Set the softDeleteRetentionInDays property: Soft deleted data retention days. When you delete an HSM or a key, it * will remain recoverable for the configured retention period or for a default period of 90 days. It accepts values * between 7 and 90. - * + * * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. * @return the ManagedHsmProperties object itself. */ @@ -214,7 +209,7 @@ public ManagedHsmProperties withSoftDeleteRetentionInDays(Integer softDeleteRete * managed HSM pool. Setting this property to true activates protection against purge for this managed HSM pool and * its content - only the Managed HSM service may initiate a hard, irrecoverable deletion. Enabling this * functionality is irreversible. - * + * * @return the enablePurgeProtection value. */ public Boolean enablePurgeProtection() { @@ -226,7 +221,7 @@ public Boolean enablePurgeProtection() { * managed HSM pool. Setting this property to true activates protection against purge for this managed HSM pool and * its content - only the Managed HSM service may initiate a hard, irrecoverable deletion. Enabling this * functionality is irreversible. - * + * * @param enablePurgeProtection the enablePurgeProtection value to set. * @return the ManagedHsmProperties object itself. */ @@ -238,7 +233,7 @@ public ManagedHsmProperties withEnablePurgeProtection(Boolean enablePurgeProtect /** * Get the createMode property: The create mode to indicate whether the resource is being created or is being * recovered from a deleted resource. - * + * * @return the createMode value. */ public CreateMode createMode() { @@ -248,7 +243,7 @@ public CreateMode createMode() { /** * Set the createMode property: The create mode to indicate whether the resource is being created or is being * recovered from a deleted resource. - * + * * @param createMode the createMode value to set. * @return the ManagedHsmProperties object itself. */ @@ -259,7 +254,7 @@ public ManagedHsmProperties withCreateMode(CreateMode createMode) { /** * Get the statusMessage property: Resource Status Message. - * + * * @return the statusMessage value. */ public String statusMessage() { @@ -268,7 +263,7 @@ public String statusMessage() { /** * Get the provisioningState property: Provisioning state. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -277,7 +272,7 @@ public ProvisioningState provisioningState() { /** * Get the networkAcls property: Rules governing the accessibility of the key vault from specific network locations. - * + * * @return the networkAcls value. */ public MhsmNetworkRuleSet networkAcls() { @@ -286,7 +281,7 @@ public MhsmNetworkRuleSet networkAcls() { /** * Set the networkAcls property: Rules governing the accessibility of the key vault from specific network locations. - * + * * @param networkAcls the networkAcls value to set. * @return the ManagedHsmProperties object itself. */ @@ -297,7 +292,7 @@ public ManagedHsmProperties withNetworkAcls(MhsmNetworkRuleSet networkAcls) { /** * Get the regions property: List of all regions associated with the managed hsm pool. - * + * * @return the regions value. */ public List regions() { @@ -306,7 +301,7 @@ public List regions() { /** * Set the regions property: List of all regions associated with the managed hsm pool. - * + * * @param regions the regions value to set. * @return the ManagedHsmProperties object itself. */ @@ -318,7 +313,7 @@ public ManagedHsmProperties withRegions(List regio /** * Get the privateEndpointConnections property: List of private endpoint connections associated with the managed hsm * pool. - * + * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { @@ -327,7 +322,7 @@ public List privateEndpointConnections() { /** * Get the publicNetworkAccess property: Control permission to the managed HSM from public networks. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -336,7 +331,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Control permission to the managed HSM from public networks. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the ManagedHsmProperties object itself. */ @@ -347,7 +342,7 @@ public ManagedHsmProperties withPublicNetworkAccess(PublicNetworkAccess publicNe /** * Get the scheduledPurgeDate property: The scheduled purge date in UTC. - * + * * @return the scheduledPurgeDate value. */ public OffsetDateTime scheduledPurgeDate() { @@ -356,7 +351,7 @@ public OffsetDateTime scheduledPurgeDate() { /** * Get the securityDomainProperties property: Managed HSM security domain properties. - * + * * @return the securityDomainProperties value. */ public ManagedHsmSecurityDomainProperties securityDomainProperties() { @@ -365,7 +360,7 @@ public ManagedHsmSecurityDomainProperties securityDomainProperties() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -382,4 +377,88 @@ public void validate() { securityDomainProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", Objects.toString(this.tenantId, null)); + jsonWriter.writeArrayField("initialAdminObjectIds", this.initialAdminObjectIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enableSoftDelete", this.enableSoftDelete); + jsonWriter.writeNumberField("softDeleteRetentionInDays", this.softDeleteRetentionInDays); + jsonWriter.writeBooleanField("enablePurgeProtection", this.enablePurgeProtection); + jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeJsonField("networkAcls", this.networkAcls); + jsonWriter.writeArrayField("regions", this.regions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmProperties 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 ManagedHsmProperties. + */ + public static ManagedHsmProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmProperties deserializedManagedHsmProperties = new ManagedHsmProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedManagedHsmProperties.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("initialAdminObjectIds".equals(fieldName)) { + List initialAdminObjectIds = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedHsmProperties.initialAdminObjectIds = initialAdminObjectIds; + } else if ("hsmUri".equals(fieldName)) { + deserializedManagedHsmProperties.hsmUri = reader.getString(); + } else if ("enableSoftDelete".equals(fieldName)) { + deserializedManagedHsmProperties.enableSoftDelete = reader.getNullable(JsonReader::getBoolean); + } else if ("softDeleteRetentionInDays".equals(fieldName)) { + deserializedManagedHsmProperties.softDeleteRetentionInDays = reader.getNullable(JsonReader::getInt); + } else if ("enablePurgeProtection".equals(fieldName)) { + deserializedManagedHsmProperties.enablePurgeProtection = reader.getNullable(JsonReader::getBoolean); + } else if ("createMode".equals(fieldName)) { + deserializedManagedHsmProperties.createMode = CreateMode.fromString(reader.getString()); + } else if ("statusMessage".equals(fieldName)) { + deserializedManagedHsmProperties.statusMessage = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedManagedHsmProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("networkAcls".equals(fieldName)) { + deserializedManagedHsmProperties.networkAcls = MhsmNetworkRuleSet.fromJson(reader); + } else if ("regions".equals(fieldName)) { + List regions + = reader.readArray(reader1 -> MhsmGeoReplicatedRegionInner.fromJson(reader1)); + deserializedManagedHsmProperties.regions = regions; + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> MhsmPrivateEndpointConnectionItem.fromJson(reader1)); + deserializedManagedHsmProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedManagedHsmProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); + } else if ("scheduledPurgeDate".equals(fieldName)) { + deserializedManagedHsmProperties.scheduledPurgeDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("securityDomainProperties".equals(fieldName)) { + deserializedManagedHsmProperties.securityDomainProperties + = ManagedHsmSecurityDomainProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmResource.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmResource.java index c68a5673337f6..cb67db2db8217 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmResource.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmResource.java @@ -7,37 +7,56 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Managed HSM resource. */ +/** + * Managed HSM resource. + */ @Fluent public class ManagedHsmResource extends Resource { /* * SKU details */ - @JsonProperty(value = "sku") private ManagedHsmSku sku; /* * Metadata pertaining to creation and last modification of the key vault resource. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; /* * Managed service identity (system assigned and/or user assigned identities) */ - @JsonProperty(value = "identity") private ManagedServiceIdentity identity; - /** Creates an instance of ManagedHsmResource class. */ + /* + * 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 ManagedHsmResource class. + */ public ManagedHsmResource() { } /** * Get the sku property: SKU details. - * + * * @return the sku value. */ public ManagedHsmSku sku() { @@ -46,7 +65,7 @@ public ManagedHsmSku sku() { /** * Set the sku property: SKU details. - * + * * @param sku the sku value to set. * @return the ManagedHsmResource object itself. */ @@ -57,16 +76,27 @@ public ManagedHsmResource withSku(ManagedHsmSku sku) { /** * Get the systemData property: Metadata pertaining to creation and last modification of the key vault resource. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } + /** + * Set the systemData property: Metadata pertaining to creation and last modification of the key vault resource. + * + * @param systemData the systemData value to set. + * @return the ManagedHsmResource object itself. + */ + ManagedHsmResource withSystemData(SystemData systemData) { + this.systemData = systemData; + return this; + } + /** * Get the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -75,7 +105,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: Managed service identity (system assigned and/or user assigned identities). - * + * * @param identity the identity value to set. * @return the ManagedHsmResource object itself. */ @@ -84,14 +114,48 @@ public ManagedHsmResource withIdentity(ManagedServiceIdentity identity) { return this; } - /** {@inheritDoc} */ + /** + * 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} + */ @Override public ManagedHsmResource withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ManagedHsmResource withTags(Map tags) { super.withTags(tags); @@ -100,7 +164,7 @@ public ManagedHsmResource withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -111,4 +175,59 @@ public void validate() { identity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmResource 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 ManagedHsmResource. + */ + public static ManagedHsmResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmResource deserializedManagedHsmResource = new ManagedHsmResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedHsmResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedHsmResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedHsmResource.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedManagedHsmResource.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedHsmResource.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedManagedHsmResource.sku = ManagedHsmSku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedManagedHsmResource.systemData = SystemData.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedManagedHsmResource.identity = ManagedServiceIdentity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmResource; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmRotationPolicy.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmRotationPolicy.java new file mode 100644 index 0000000000000..8b8f804b80053 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmRotationPolicy.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The ManagedHsmRotationPolicy model. + */ +@Fluent +public final class ManagedHsmRotationPolicy implements JsonSerializable { + /* + * The attributes of key rotation policy. + */ + private ManagedHsmKeyRotationPolicyAttributes attributes; + + /* + * The lifetimeActions for key rotation action. + */ + private List lifetimeActions; + + /** + * Creates an instance of ManagedHsmRotationPolicy class. + */ + public ManagedHsmRotationPolicy() { + } + + /** + * Get the attributes property: The attributes of key rotation policy. + * + * @return the attributes value. + */ + public ManagedHsmKeyRotationPolicyAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: The attributes of key rotation policy. + * + * @param attributes the attributes value to set. + * @return the ManagedHsmRotationPolicy object itself. + */ + public ManagedHsmRotationPolicy withAttributes(ManagedHsmKeyRotationPolicyAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the lifetimeActions property: The lifetimeActions for key rotation action. + * + * @return the lifetimeActions value. + */ + public List lifetimeActions() { + return this.lifetimeActions; + } + + /** + * Set the lifetimeActions property: The lifetimeActions for key rotation action. + * + * @param lifetimeActions the lifetimeActions value to set. + * @return the ManagedHsmRotationPolicy object itself. + */ + public ManagedHsmRotationPolicy withLifetimeActions(List lifetimeActions) { + this.lifetimeActions = lifetimeActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributes() != null) { + attributes().validate(); + } + if (lifetimeActions() != null) { + lifetimeActions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("attributes", this.attributes); + jsonWriter.writeArrayField("lifetimeActions", this.lifetimeActions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmRotationPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmRotationPolicy 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 ManagedHsmRotationPolicy. + */ + public static ManagedHsmRotationPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmRotationPolicy deserializedManagedHsmRotationPolicy = new ManagedHsmRotationPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributes".equals(fieldName)) { + deserializedManagedHsmRotationPolicy.attributes + = ManagedHsmKeyRotationPolicyAttributes.fromJson(reader); + } else if ("lifetimeActions".equals(fieldName)) { + List lifetimeActions + = reader.readArray(reader1 -> ManagedHsmLifetimeAction.fromJson(reader1)); + deserializedManagedHsmRotationPolicy.lifetimeActions = lifetimeActions; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmRotationPolicy; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSecurityDomainProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSecurityDomainProperties.java index 115782e703602..5c7d46cf1f82b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSecurityDomainProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSecurityDomainProperties.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The security domain properties of the managed hsm. */ +/** + * The security domain properties of the managed hsm. + */ @Immutable -public final class ManagedHsmSecurityDomainProperties { +public final class ManagedHsmSecurityDomainProperties implements JsonSerializable { /* * Activation Status */ - @JsonProperty(value = "activationStatus", access = JsonProperty.Access.WRITE_ONLY) private ActivationStatus activationStatus; /* * Activation Status Message. */ - @JsonProperty(value = "activationStatusMessage", access = JsonProperty.Access.WRITE_ONLY) private String activationStatusMessage; - /** Creates an instance of ManagedHsmSecurityDomainProperties class. */ + /** + * Creates an instance of ManagedHsmSecurityDomainProperties class. + */ public ManagedHsmSecurityDomainProperties() { } /** * Get the activationStatus property: Activation Status. - * + * * @return the activationStatus value. */ public ActivationStatus activationStatus() { @@ -37,7 +43,7 @@ public ActivationStatus activationStatus() { /** * Get the activationStatusMessage property: Activation Status Message. - * + * * @return the activationStatusMessage value. */ public String activationStatusMessage() { @@ -46,9 +52,48 @@ public String activationStatusMessage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmSecurityDomainProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmSecurityDomainProperties 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 ManagedHsmSecurityDomainProperties. + */ + public static ManagedHsmSecurityDomainProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmSecurityDomainProperties deserializedManagedHsmSecurityDomainProperties + = new ManagedHsmSecurityDomainProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activationStatus".equals(fieldName)) { + deserializedManagedHsmSecurityDomainProperties.activationStatus + = ActivationStatus.fromString(reader.getString()); + } else if ("activationStatusMessage".equals(fieldName)) { + deserializedManagedHsmSecurityDomainProperties.activationStatusMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmSecurityDomainProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSku.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSku.java index 68ed1e159c4bb..05293c9df18a0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSku.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSku.java @@ -6,30 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** SKU details. */ +/** + * SKU details. + */ @Fluent -public final class ManagedHsmSku { +public final class ManagedHsmSku implements JsonSerializable { /* * SKU Family of the managed HSM Pool */ - @JsonProperty(value = "family", required = true) private ManagedHsmSkuFamily family = ManagedHsmSkuFamily.B; /* * SKU of the managed HSM Pool */ - @JsonProperty(value = "name", required = true) private ManagedHsmSkuName name; - /** Creates an instance of ManagedHsmSku class. */ + /** + * Creates an instance of ManagedHsmSku class. + */ public ManagedHsmSku() { } /** * Get the family property: SKU Family of the managed HSM Pool. - * + * * @return the family value. */ public ManagedHsmSkuFamily family() { @@ -38,7 +44,7 @@ public ManagedHsmSkuFamily family() { /** * Set the family property: SKU Family of the managed HSM Pool. - * + * * @param family the family value to set. * @return the ManagedHsmSku object itself. */ @@ -49,7 +55,7 @@ public ManagedHsmSku withFamily(ManagedHsmSkuFamily family) { /** * Get the name property: SKU of the managed HSM Pool. - * + * * @return the name value. */ public ManagedHsmSkuName name() { @@ -58,7 +64,7 @@ public ManagedHsmSkuName name() { /** * Set the name property: SKU of the managed HSM Pool. - * + * * @param name the name value to set. * @return the ManagedHsmSku object itself. */ @@ -69,21 +75,59 @@ public ManagedHsmSku withName(ManagedHsmSkuName name) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (family() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property family in model ManagedHsmSku")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property family in model ManagedHsmSku")); } if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property name in model ManagedHsmSku")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model ManagedHsmSku")); } } private static final ClientLogger LOGGER = new ClientLogger(ManagedHsmSku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("family", this.family == null ? null : this.family.toString()); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmSku 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 ManagedHsmSku. + */ + public static ManagedHsmSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmSku deserializedManagedHsmSku = new ManagedHsmSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("family".equals(fieldName)) { + deserializedManagedHsmSku.family = ManagedHsmSkuFamily.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedManagedHsmSku.name = ManagedHsmSkuName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmSku; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSkuFamily.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSkuFamily.java index f918f0e5af205..6fe1d7cdf9e85 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSkuFamily.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSkuFamily.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** SKU Family of the managed HSM Pool. */ +/** + * SKU Family of the managed HSM Pool. + */ public final class ManagedHsmSkuFamily extends ExpandableStringEnum { - /** Static value B for ManagedHsmSkuFamily. */ + /** + * Static value B for ManagedHsmSkuFamily. + */ public static final ManagedHsmSkuFamily B = fromString("B"); /** * Creates a new instance of ManagedHsmSkuFamily value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public ManagedHsmSkuFamily() { /** * Creates or finds a ManagedHsmSkuFamily from its string representation. - * + * * @param name a name to look for. * @return the corresponding ManagedHsmSkuFamily. */ - @JsonCreator public static ManagedHsmSkuFamily fromString(String name) { return fromString(name, ManagedHsmSkuFamily.class); } /** * Gets known ManagedHsmSkuFamily values. - * + * * @return known ManagedHsmSkuFamily values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSkuName.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSkuName.java index 3bd4808fc99b1..9768b46486445 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSkuName.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmSkuName.java @@ -4,21 +4,28 @@ package com.azure.resourcemanager.keyvault.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** SKU of the managed HSM Pool. */ +/** + * SKU of the managed HSM Pool. + */ public enum ManagedHsmSkuName { - /** Enum value Standard_B1. */ + /** + * Enum value Standard_B1. + */ STANDARD_B1("Standard_B1"), - /** Enum value Custom_B32. */ + /** + * Enum value Custom_B32. + */ CUSTOM_B32("Custom_B32"), - /** Enum value Custom_B6. */ + /** + * Enum value Custom_B6. + */ CUSTOM_B6("Custom_B6"); - /** The actual serialized value for a ManagedHsmSkuName instance. */ + /** + * The actual serialized value for a ManagedHsmSkuName instance. + */ private final String value; ManagedHsmSkuName(String value) { @@ -27,11 +34,10 @@ public enum ManagedHsmSkuName { /** * Parses a serialized value to a ManagedHsmSkuName instance. - * + * * @param value the serialized value to parse. * @return the parsed ManagedHsmSkuName object, or null if unable to parse. */ - @JsonCreator public static ManagedHsmSkuName fromString(String value) { if (value == null) { return null; @@ -45,8 +51,9 @@ public static ManagedHsmSkuName fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmTrigger.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmTrigger.java new file mode 100644 index 0000000000000..6b33052af5a8b --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedHsmTrigger.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ManagedHsmTrigger model. + */ +@Fluent +public final class ManagedHsmTrigger implements JsonSerializable { + /* + * The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 + * duration format. Eg: 'P90D', 'P1Y'. + */ + private String timeAfterCreate; + + /* + * The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', + * 'P1Y'. + */ + private String timeBeforeExpiry; + + /** + * Creates an instance of ManagedHsmTrigger class. + */ + public ManagedHsmTrigger() { + } + + /** + * Get the timeAfterCreate property: The time duration after key creation to rotate the key. It only applies to + * rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @return the timeAfterCreate value. + */ + public String timeAfterCreate() { + return this.timeAfterCreate; + } + + /** + * Set the timeAfterCreate property: The time duration after key creation to rotate the key. It only applies to + * rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @param timeAfterCreate the timeAfterCreate value to set. + * @return the ManagedHsmTrigger object itself. + */ + public ManagedHsmTrigger withTimeAfterCreate(String timeAfterCreate) { + this.timeAfterCreate = timeAfterCreate; + return this; + } + + /** + * Get the timeBeforeExpiry property: The time duration before key expiring to rotate or notify. It will be in ISO + * 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @return the timeBeforeExpiry value. + */ + public String timeBeforeExpiry() { + return this.timeBeforeExpiry; + } + + /** + * Set the timeBeforeExpiry property: The time duration before key expiring to rotate or notify. It will be in ISO + * 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @param timeBeforeExpiry the timeBeforeExpiry value to set. + * @return the ManagedHsmTrigger object itself. + */ + public ManagedHsmTrigger withTimeBeforeExpiry(String timeBeforeExpiry) { + this.timeBeforeExpiry = timeBeforeExpiry; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeAfterCreate", this.timeAfterCreate); + jsonWriter.writeStringField("timeBeforeExpiry", this.timeBeforeExpiry); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedHsmTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedHsmTrigger 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 ManagedHsmTrigger. + */ + public static ManagedHsmTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedHsmTrigger deserializedManagedHsmTrigger = new ManagedHsmTrigger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeAfterCreate".equals(fieldName)) { + deserializedManagedHsmTrigger.timeAfterCreate = reader.getString(); + } else if ("timeBeforeExpiry".equals(fieldName)) { + deserializedManagedHsmTrigger.timeBeforeExpiry = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedHsmTrigger; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedServiceIdentity.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedServiceIdentity.java index 34fbd79d41d8e..1053c278977c1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedServiceIdentity.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedServiceIdentity.java @@ -6,52 +6,54 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; import java.util.UUID; -/** Managed service identity (system assigned and/or user assigned identities). */ +/** + * Managed service identity (system assigned and/or user assigned identities). + */ @Fluent -public final class ManagedServiceIdentity { +public final class ManagedServiceIdentity implements JsonSerializable { /* * The service principal ID of the system assigned identity. This property will only be provided for a system * assigned identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private UUID principalId; /* * The tenant ID of the system assigned identity. This property will only be provided for a system assigned * identity. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private UUID tenantId; /* * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ - @JsonProperty(value = "type", required = true) private ManagedServiceIdentityType type; /* - * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * The dictionary values can be empty objects ({}) in requests. + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will + * be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ + * userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; - /** Creates an instance of ManagedServiceIdentity class. */ + /** + * Creates an instance of ManagedServiceIdentity class. + */ public ManagedServiceIdentity() { } /** * Get the principalId property: The service principal ID of the system assigned identity. This property will only * be provided for a system assigned identity. - * + * * @return the principalId value. */ public UUID principalId() { @@ -61,7 +63,7 @@ public UUID principalId() { /** * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for * a system assigned identity. - * + * * @return the tenantId value. */ public UUID tenantId() { @@ -71,7 +73,7 @@ public UUID tenantId() { /** * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are * allowed). - * + * * @return the type value. */ public ManagedServiceIdentityType type() { @@ -81,7 +83,7 @@ public ManagedServiceIdentityType type() { /** * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are * allowed). - * + * * @param type the type value to set. * @return the ManagedServiceIdentity object itself. */ @@ -95,7 +97,7 @@ public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { * userAssignedIdentities dictionary keys will be ARM resource ids in the form: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. * The dictionary values can be empty objects ({}) in requests. - * + * * @return the userAssignedIdentities value. */ public Map userAssignedIdentities() { @@ -107,7 +109,7 @@ public Map userAssignedIdentities() { * userAssignedIdentities dictionary keys will be ARM resource ids in the form: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. * The dictionary values can be empty objects ({}) in requests. - * + * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the ManagedServiceIdentity object itself. */ @@ -118,26 +120,71 @@ public ManagedServiceIdentity withUserAssignedIdentities(Map { - if (e != null) { - e.validate(); - } - }); + userAssignedIdentities().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } } private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedServiceIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedServiceIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. + */ + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedServiceIdentity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedServiceIdentityType.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedServiceIdentityType.java index 996e32468aedd..7ee7483ba60bb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedServiceIdentityType.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ManagedServiceIdentityType.java @@ -5,27 +5,36 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ public final class ManagedServiceIdentityType extends ExpandableStringEnum { - /** Static value None for ManagedServiceIdentityType. */ + /** + * Static value None for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType NONE = fromString("None"); - /** Static value SystemAssigned for ManagedServiceIdentityType. */ + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - /** Static value UserAssigned for ManagedServiceIdentityType. */ + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); - /** Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. */ - public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = - fromString("SystemAssigned,UserAssigned"); + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); /** * Creates a new instance of ManagedServiceIdentityType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +43,17 @@ public ManagedServiceIdentityType() { /** * Creates or finds a ManagedServiceIdentityType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ManagedServiceIdentityType. */ - @JsonCreator public static ManagedServiceIdentityType fromString(String name) { return fromString(name, ManagedServiceIdentityType.class); } /** * Gets known ManagedServiceIdentityType values. - * + * * @return known ManagedServiceIdentityType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MetricSpecification.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MetricSpecification.java index c5e209479c718..8a0d689202b00 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MetricSpecification.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MetricSpecification.java @@ -5,85 +5,82 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Metric specification of operation. */ +/** + * Metric specification of operation. + */ @Fluent -public final class MetricSpecification { +public final class MetricSpecification implements JsonSerializable { /* * Name of metric specification. */ - @JsonProperty(value = "name") private String name; /* * Display name of metric specification. */ - @JsonProperty(value = "displayName") private String displayName; /* * Display description of metric specification. */ - @JsonProperty(value = "displayDescription") private String displayDescription; /* * The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. */ - @JsonProperty(value = "unit") private String unit; /* * The metric aggregation type. Possible values include: 'Average', 'Count', 'Total'. */ - @JsonProperty(value = "aggregationType") private String aggregationType; /* * The supported aggregation types for the metrics. */ - @JsonProperty(value = "supportedAggregationTypes") private List supportedAggregationTypes; /* * The supported time grain types for the metrics. */ - @JsonProperty(value = "supportedTimeGrainTypes") private List supportedTimeGrainTypes; /* * The metric lock aggregation type. */ - @JsonProperty(value = "lockAggregationType") private String lockAggregationType; /* * The dimensions of metric */ - @JsonProperty(value = "dimensions") private List dimensions; /* * Property to specify whether to fill gap with zero. */ - @JsonProperty(value = "fillGapWithZero") private Boolean fillGapWithZero; /* * The internal metric name. */ - @JsonProperty(value = "internalMetricName") private String internalMetricName; - /** Creates an instance of MetricSpecification class. */ + /** + * Creates an instance of MetricSpecification class. + */ public MetricSpecification() { } /** * Get the name property: Name of metric specification. - * + * * @return the name value. */ public String name() { @@ -92,7 +89,7 @@ public String name() { /** * Set the name property: Name of metric specification. - * + * * @param name the name value to set. * @return the MetricSpecification object itself. */ @@ -103,7 +100,7 @@ public MetricSpecification withName(String name) { /** * Get the displayName property: Display name of metric specification. - * + * * @return the displayName value. */ public String displayName() { @@ -112,7 +109,7 @@ public String displayName() { /** * Set the displayName property: Display name of metric specification. - * + * * @param displayName the displayName value to set. * @return the MetricSpecification object itself. */ @@ -123,7 +120,7 @@ public MetricSpecification withDisplayName(String displayName) { /** * Get the displayDescription property: Display description of metric specification. - * + * * @return the displayDescription value. */ public String displayDescription() { @@ -132,7 +129,7 @@ public String displayDescription() { /** * Set the displayDescription property: Display description of metric specification. - * + * * @param displayDescription the displayDescription value to set. * @return the MetricSpecification object itself. */ @@ -143,7 +140,7 @@ public MetricSpecification withDisplayDescription(String displayDescription) { /** * Get the unit property: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. - * + * * @return the unit value. */ public String unit() { @@ -152,7 +149,7 @@ public String unit() { /** * Set the unit property: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'. - * + * * @param unit the unit value to set. * @return the MetricSpecification object itself. */ @@ -164,7 +161,7 @@ public MetricSpecification withUnit(String unit) { /** * Get the aggregationType property: The metric aggregation type. Possible values include: 'Average', 'Count', * 'Total'. - * + * * @return the aggregationType value. */ public String aggregationType() { @@ -174,7 +171,7 @@ public String aggregationType() { /** * Set the aggregationType property: The metric aggregation type. Possible values include: 'Average', 'Count', * 'Total'. - * + * * @param aggregationType the aggregationType value to set. * @return the MetricSpecification object itself. */ @@ -185,7 +182,7 @@ public MetricSpecification withAggregationType(String aggregationType) { /** * Get the supportedAggregationTypes property: The supported aggregation types for the metrics. - * + * * @return the supportedAggregationTypes value. */ public List supportedAggregationTypes() { @@ -194,7 +191,7 @@ public List supportedAggregationTypes() { /** * Set the supportedAggregationTypes property: The supported aggregation types for the metrics. - * + * * @param supportedAggregationTypes the supportedAggregationTypes value to set. * @return the MetricSpecification object itself. */ @@ -205,7 +202,7 @@ public MetricSpecification withSupportedAggregationTypes(List supportedA /** * Get the supportedTimeGrainTypes property: The supported time grain types for the metrics. - * + * * @return the supportedTimeGrainTypes value. */ public List supportedTimeGrainTypes() { @@ -214,7 +211,7 @@ public List supportedTimeGrainTypes() { /** * Set the supportedTimeGrainTypes property: The supported time grain types for the metrics. - * + * * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. * @return the MetricSpecification object itself. */ @@ -225,7 +222,7 @@ public MetricSpecification withSupportedTimeGrainTypes(List supportedTim /** * Get the lockAggregationType property: The metric lock aggregation type. - * + * * @return the lockAggregationType value. */ public String lockAggregationType() { @@ -234,7 +231,7 @@ public String lockAggregationType() { /** * Set the lockAggregationType property: The metric lock aggregation type. - * + * * @param lockAggregationType the lockAggregationType value to set. * @return the MetricSpecification object itself. */ @@ -245,7 +242,7 @@ public MetricSpecification withLockAggregationType(String lockAggregationType) { /** * Get the dimensions property: The dimensions of metric. - * + * * @return the dimensions value. */ public List dimensions() { @@ -254,7 +251,7 @@ public List dimensions() { /** * Set the dimensions property: The dimensions of metric. - * + * * @param dimensions the dimensions value to set. * @return the MetricSpecification object itself. */ @@ -265,7 +262,7 @@ public MetricSpecification withDimensions(List dimensions) /** * Get the fillGapWithZero property: Property to specify whether to fill gap with zero. - * + * * @return the fillGapWithZero value. */ public Boolean fillGapWithZero() { @@ -274,7 +271,7 @@ public Boolean fillGapWithZero() { /** * Set the fillGapWithZero property: Property to specify whether to fill gap with zero. - * + * * @param fillGapWithZero the fillGapWithZero value to set. * @return the MetricSpecification object itself. */ @@ -285,7 +282,7 @@ public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { /** * Get the internalMetricName property: The internal metric name. - * + * * @return the internalMetricName value. */ public String internalMetricName() { @@ -294,7 +291,7 @@ public String internalMetricName() { /** * Set the internalMetricName property: The internal metric name. - * + * * @param internalMetricName the internalMetricName value to set. * @return the MetricSpecification object itself. */ @@ -305,7 +302,7 @@ public MetricSpecification withInternalMetricName(String internalMetricName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -313,4 +310,76 @@ public void validate() { dimensions().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("displayDescription", this.displayDescription); + jsonWriter.writeStringField("unit", this.unit); + jsonWriter.writeStringField("aggregationType", this.aggregationType); + jsonWriter.writeArrayField("supportedAggregationTypes", this.supportedAggregationTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("supportedTimeGrainTypes", this.supportedTimeGrainTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("lockAggregationType", this.lockAggregationType); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("fillGapWithZero", this.fillGapWithZero); + jsonWriter.writeStringField("internalMetricName", this.internalMetricName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricSpecification 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 MetricSpecification. + */ + public static MetricSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricSpecification deserializedMetricSpecification = new MetricSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetricSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMetricSpecification.displayName = reader.getString(); + } else if ("displayDescription".equals(fieldName)) { + deserializedMetricSpecification.displayDescription = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedMetricSpecification.unit = reader.getString(); + } else if ("aggregationType".equals(fieldName)) { + deserializedMetricSpecification.aggregationType = reader.getString(); + } else if ("supportedAggregationTypes".equals(fieldName)) { + List supportedAggregationTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedMetricSpecification.supportedAggregationTypes = supportedAggregationTypes; + } else if ("supportedTimeGrainTypes".equals(fieldName)) { + List supportedTimeGrainTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedMetricSpecification.supportedTimeGrainTypes = supportedTimeGrainTypes; + } else if ("lockAggregationType".equals(fieldName)) { + deserializedMetricSpecification.lockAggregationType = reader.getString(); + } else if ("dimensions".equals(fieldName)) { + List dimensions + = reader.readArray(reader1 -> DimensionProperties.fromJson(reader1)); + deserializedMetricSpecification.dimensions = dimensions; + } else if ("fillGapWithZero".equals(fieldName)) { + deserializedMetricSpecification.fillGapWithZero = reader.getNullable(JsonReader::getBoolean); + } else if ("internalMetricName".equals(fieldName)) { + deserializedMetricSpecification.internalMetricName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricSpecification; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmNetworkRuleSet.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmNetworkRuleSet.java index 301f3589c9b7f..fa7c99300dd6b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmNetworkRuleSet.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmNetworkRuleSet.java @@ -5,46 +5,50 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** A set of rules governing the network accessibility of a managed hsm pool. */ +/** + * A set of rules governing the network accessibility of a managed hsm pool. + */ @Fluent -public final class MhsmNetworkRuleSet { +public final class MhsmNetworkRuleSet implements JsonSerializable { /* - * Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the - * default is 'AzureServices'. + * Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default + * is 'AzureServices'. */ - @JsonProperty(value = "bypass") private NetworkRuleBypassOptions bypass; /* * The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the * bypass property has been evaluated. */ - @JsonProperty(value = "defaultAction") private NetworkRuleAction defaultAction; /* * The list of IP address rules. */ - @JsonProperty(value = "ipRules") private List ipRules; /* * The list of virtual network rules. */ - @JsonProperty(value = "virtualNetworkRules") private List virtualNetworkRules; - /** Creates an instance of MhsmNetworkRuleSet class. */ + /** + * Creates an instance of MhsmNetworkRuleSet class. + */ public MhsmNetworkRuleSet() { } /** * Get the bypass property: Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If * not specified the default is 'AzureServices'. - * + * * @return the bypass value. */ public NetworkRuleBypassOptions bypass() { @@ -54,7 +58,7 @@ public NetworkRuleBypassOptions bypass() { /** * Set the bypass property: Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If * not specified the default is 'AzureServices'. - * + * * @param bypass the bypass value to set. * @return the MhsmNetworkRuleSet object itself. */ @@ -66,7 +70,7 @@ public MhsmNetworkRuleSet withBypass(NetworkRuleBypassOptions bypass) { /** * Get the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. * This is only used after the bypass property has been evaluated. - * + * * @return the defaultAction value. */ public NetworkRuleAction defaultAction() { @@ -76,7 +80,7 @@ public NetworkRuleAction defaultAction() { /** * Set the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. * This is only used after the bypass property has been evaluated. - * + * * @param defaultAction the defaultAction value to set. * @return the MhsmNetworkRuleSet object itself. */ @@ -87,7 +91,7 @@ public MhsmNetworkRuleSet withDefaultAction(NetworkRuleAction defaultAction) { /** * Get the ipRules property: The list of IP address rules. - * + * * @return the ipRules value. */ public List ipRules() { @@ -96,7 +100,7 @@ public List ipRules() { /** * Set the ipRules property: The list of IP address rules. - * + * * @param ipRules the ipRules value to set. * @return the MhsmNetworkRuleSet object itself. */ @@ -107,7 +111,7 @@ public MhsmNetworkRuleSet withIpRules(List ipRules) { /** * Get the virtualNetworkRules property: The list of virtual network rules. - * + * * @return the virtualNetworkRules value. */ public List virtualNetworkRules() { @@ -116,7 +120,7 @@ public List virtualNetworkRules() { /** * Set the virtualNetworkRules property: The list of virtual network rules. - * + * * @param virtualNetworkRules the virtualNetworkRules value to set. * @return the MhsmNetworkRuleSet object itself. */ @@ -127,7 +131,7 @@ public MhsmNetworkRuleSet withVirtualNetworkRules(List v /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -138,4 +142,53 @@ public void validate() { virtualNetworkRules().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bypass", this.bypass == null ? null : this.bypass.toString()); + jsonWriter.writeStringField("defaultAction", this.defaultAction == null ? null : this.defaultAction.toString()); + jsonWriter.writeArrayField("ipRules", this.ipRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("virtualNetworkRules", this.virtualNetworkRules, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmNetworkRuleSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmNetworkRuleSet 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 MhsmNetworkRuleSet. + */ + public static MhsmNetworkRuleSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmNetworkRuleSet deserializedMhsmNetworkRuleSet = new MhsmNetworkRuleSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bypass".equals(fieldName)) { + deserializedMhsmNetworkRuleSet.bypass = NetworkRuleBypassOptions.fromString(reader.getString()); + } else if ("defaultAction".equals(fieldName)) { + deserializedMhsmNetworkRuleSet.defaultAction = NetworkRuleAction.fromString(reader.getString()); + } else if ("ipRules".equals(fieldName)) { + List ipRules = reader.readArray(reader1 -> MhsmipRule.fromJson(reader1)); + deserializedMhsmNetworkRuleSet.ipRules = ipRules; + } else if ("virtualNetworkRules".equals(fieldName)) { + List virtualNetworkRules + = reader.readArray(reader1 -> MhsmVirtualNetworkRule.fromJson(reader1)); + deserializedMhsmNetworkRuleSet.virtualNetworkRules = virtualNetworkRules; + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmNetworkRuleSet; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpoint.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpoint.java index a95fb24427cb0..a3c810c100eca 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpoint.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpoint.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Private endpoint object properties. */ +/** + * Private endpoint object properties. + */ @Immutable -public final class MhsmPrivateEndpoint { +public final class MhsmPrivateEndpoint implements JsonSerializable { /* * Full identifier of the private endpoint resource. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; - /** Creates an instance of MhsmPrivateEndpoint class. */ + /** + * Creates an instance of MhsmPrivateEndpoint class. + */ public MhsmPrivateEndpoint() { } /** * Get the id property: Full identifier of the private endpoint resource. - * + * * @return the id value. */ public String id() { @@ -31,9 +38,44 @@ public String id() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmPrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmPrivateEndpoint 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 MhsmPrivateEndpoint. + */ + public static MhsmPrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmPrivateEndpoint deserializedMhsmPrivateEndpoint = new MhsmPrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMhsmPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmPrivateEndpoint; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionItem.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionItem.java index d6ad7945712df..796a18f65abfb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionItem.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.MhsmPrivateEndpointConnectionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Private endpoint connection item. */ +/** + * Private endpoint connection item. + */ @Fluent -public final class MhsmPrivateEndpointConnectionItem { +public final class MhsmPrivateEndpointConnectionItem implements JsonSerializable { /* * Id of private endpoint connection. */ - @JsonProperty(value = "id") private String id; /* * Modified whenever there is a change in the state of private endpoint connection. */ - @JsonProperty(value = "etag") private String etag; /* * Private endpoint connection properties. */ - @JsonProperty(value = "properties") private MhsmPrivateEndpointConnectionProperties innerProperties; - /** Creates an instance of MhsmPrivateEndpointConnectionItem class. */ + /** + * Creates an instance of MhsmPrivateEndpointConnectionItem class. + */ public MhsmPrivateEndpointConnectionItem() { } /** * Get the id property: Id of private endpoint connection. - * + * * @return the id value. */ public String id() { @@ -44,7 +49,7 @@ public String id() { /** * Set the id property: Id of private endpoint connection. - * + * * @param id the id value to set. * @return the MhsmPrivateEndpointConnectionItem object itself. */ @@ -55,7 +60,7 @@ public MhsmPrivateEndpointConnectionItem withId(String id) { /** * Get the etag property: Modified whenever there is a change in the state of private endpoint connection. - * + * * @return the etag value. */ public String etag() { @@ -64,7 +69,7 @@ public String etag() { /** * Set the etag property: Modified whenever there is a change in the state of private endpoint connection. - * + * * @param etag the etag value to set. * @return the MhsmPrivateEndpointConnectionItem object itself. */ @@ -75,7 +80,7 @@ public MhsmPrivateEndpointConnectionItem withEtag(String etag) { /** * Get the innerProperties property: Private endpoint connection properties. - * + * * @return the innerProperties value. */ private MhsmPrivateEndpointConnectionProperties innerProperties() { @@ -84,7 +89,7 @@ private MhsmPrivateEndpointConnectionProperties innerProperties() { /** * Get the privateEndpoint property: Properties of the private endpoint object. - * + * * @return the privateEndpoint value. */ public MhsmPrivateEndpoint privateEndpoint() { @@ -93,7 +98,7 @@ public MhsmPrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: Properties of the private endpoint object. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the MhsmPrivateEndpointConnectionItem object itself. */ @@ -107,7 +112,7 @@ public MhsmPrivateEndpointConnectionItem withPrivateEndpoint(MhsmPrivateEndpoint /** * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @return the privateLinkServiceConnectionState value. */ public MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -116,12 +121,12 @@ public MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState() /** * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the MhsmPrivateEndpointConnectionItem object itself. */ - public MhsmPrivateEndpointConnectionItem withPrivateLinkServiceConnectionState( - MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public MhsmPrivateEndpointConnectionItem + withPrivateLinkServiceConnectionState(MhsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { if (this.innerProperties() == null) { this.innerProperties = new MhsmPrivateEndpointConnectionProperties(); } @@ -131,7 +136,7 @@ public MhsmPrivateEndpointConnectionItem withPrivateLinkServiceConnectionState( /** * Get the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -140,12 +145,12 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Set the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @param provisioningState the provisioningState value to set. * @return the MhsmPrivateEndpointConnectionItem object itself. */ - public MhsmPrivateEndpointConnectionItem withProvisioningState( - PrivateEndpointConnectionProvisioningState provisioningState) { + public MhsmPrivateEndpointConnectionItem + withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { if (this.innerProperties() == null) { this.innerProperties = new MhsmPrivateEndpointConnectionProperties(); } @@ -155,7 +160,7 @@ public MhsmPrivateEndpointConnectionItem withProvisioningState( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -163,4 +168,48 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("etag", this.etag); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmPrivateEndpointConnectionItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmPrivateEndpointConnectionItem 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 MhsmPrivateEndpointConnectionItem. + */ + public static MhsmPrivateEndpointConnectionItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmPrivateEndpointConnectionItem deserializedMhsmPrivateEndpointConnectionItem + = new MhsmPrivateEndpointConnectionItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionItem.id = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionItem.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionItem.innerProperties + = MhsmPrivateEndpointConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmPrivateEndpointConnectionItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsListResult.java index 86b18d855f209..03a3d440dc652 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsListResult.java @@ -5,32 +5,39 @@ package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.MhsmPrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of private endpoint connections associated with a managed HSM Pools. */ +/** + * List of private endpoint connections associated with a managed HSM Pools. + */ @Fluent -public final class MhsmPrivateEndpointConnectionsListResult { +public final class MhsmPrivateEndpointConnectionsListResult + implements JsonSerializable { /* * The private endpoint connection associated with a managed HSM Pools. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of managed HSM Pools. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of MhsmPrivateEndpointConnectionsListResult class. */ + /** + * Creates an instance of MhsmPrivateEndpointConnectionsListResult class. + */ public MhsmPrivateEndpointConnectionsListResult() { } /** * Get the value property: The private endpoint connection associated with a managed HSM Pools. - * + * * @return the value value. */ public List value() { @@ -39,7 +46,7 @@ public List value() { /** * Set the value property: The private endpoint connection associated with a managed HSM Pools. - * + * * @param value the value value to set. * @return the MhsmPrivateEndpointConnectionsListResult object itself. */ @@ -50,7 +57,7 @@ public MhsmPrivateEndpointConnectionsListResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmPrivateEndpointConnectionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmPrivateEndpointConnectionsListResult 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 MhsmPrivateEndpointConnectionsListResult. + */ + public static MhsmPrivateEndpointConnectionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmPrivateEndpointConnectionsListResult deserializedMhsmPrivateEndpointConnectionsListResult + = new MhsmPrivateEndpointConnectionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MhsmPrivateEndpointConnectionInner.fromJson(reader1)); + deserializedMhsmPrivateEndpointConnectionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMhsmPrivateEndpointConnectionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmPrivateEndpointConnectionsListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsPutHeaders.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsPutHeaders.java index 186bc3e00a911..4ddaa6a275479 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsPutHeaders.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsPutHeaders.java @@ -7,21 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; -/** The MhsmPrivateEndpointConnectionsPutHeaders model. */ +/** + * The MhsmPrivateEndpointConnectionsPutHeaders model. + */ @Fluent public final class MhsmPrivateEndpointConnectionsPutHeaders { /* * The Retry-After property. */ - @JsonProperty(value = "Retry-After") private Integer retryAfter; /* * The Azure-AsyncOperation property. */ - @JsonProperty(value = "Azure-AsyncOperation") private String azureAsyncOperation; private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation"); @@ -29,7 +28,7 @@ public final class MhsmPrivateEndpointConnectionsPutHeaders { // HttpHeaders containing the raw property values. /** * Creates an instance of MhsmPrivateEndpointConnectionsPutHeaders class. - * + * * @param rawHeaders The raw HttpHeaders that will be used to create the property values. */ public MhsmPrivateEndpointConnectionsPutHeaders(HttpHeaders rawHeaders) { @@ -42,7 +41,7 @@ public MhsmPrivateEndpointConnectionsPutHeaders(HttpHeaders rawHeaders) { /** * Get the retryAfter property: The Retry-After property. - * + * * @return the retryAfter value. */ public Integer retryAfter() { @@ -51,7 +50,7 @@ public Integer retryAfter() { /** * Set the retryAfter property: The Retry-After property. - * + * * @param retryAfter the retryAfter value to set. * @return the MhsmPrivateEndpointConnectionsPutHeaders object itself. */ @@ -62,7 +61,7 @@ public MhsmPrivateEndpointConnectionsPutHeaders withRetryAfter(Integer retryAfte /** * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * + * * @return the azureAsyncOperation value. */ public String azureAsyncOperation() { @@ -71,7 +70,7 @@ public String azureAsyncOperation() { /** * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * + * * @param azureAsyncOperation the azureAsyncOperation value to set. * @return the MhsmPrivateEndpointConnectionsPutHeaders object itself. */ @@ -82,7 +81,7 @@ public MhsmPrivateEndpointConnectionsPutHeaders withAzureAsyncOperation(String a /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsPutResponse.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsPutResponse.java index b27cf91359a7c..e0dc953be38bd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsPutResponse.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateEndpointConnectionsPutResponse.java @@ -9,30 +9,28 @@ import com.azure.core.http.rest.ResponseBase; import com.azure.resourcemanager.keyvault.fluent.models.MhsmPrivateEndpointConnectionInner; -/** Contains all response data for the put operation. */ +/** + * Contains all response data for the put operation. + */ public final class MhsmPrivateEndpointConnectionsPutResponse extends ResponseBase { /** * Creates an instance of MhsmPrivateEndpointConnectionsPutResponse. - * + * * @param request the request which resulted in this MhsmPrivateEndpointConnectionsPutResponse. * @param statusCode the status code of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param value the deserialized value of the HTTP response. * @param headers the deserialized headers of the HTTP response. */ - public MhsmPrivateEndpointConnectionsPutResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - MhsmPrivateEndpointConnectionInner value, - MhsmPrivateEndpointConnectionsPutHeaders headers) { + public MhsmPrivateEndpointConnectionsPutResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + MhsmPrivateEndpointConnectionInner value, MhsmPrivateEndpointConnectionsPutHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } /** * Gets the deserialized response body. - * + * * @return the deserialized response body. */ @Override diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateLinkResource.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateLinkResource.java index 18a4c86f46584..7655fd200bd25 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateLinkResource.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateLinkResource.java @@ -5,55 +5,130 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.keyvault.fluent.models.MhsmPrivateLinkResourceProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** A private link resource. */ +/** + * A private link resource. + */ @Fluent public final class MhsmPrivateLinkResource extends ManagedHsmResource { /* * Resource properties. */ - @JsonProperty(value = "properties") private MhsmPrivateLinkResourceProperties innerProperties; - /** Creates an instance of MhsmPrivateLinkResource class. */ + /* + * 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; + + /* + * Metadata pertaining to creation and last modification of the key vault resource. + */ + private SystemData systemData; + + /** + * Creates an instance of MhsmPrivateLinkResource class. + */ public MhsmPrivateLinkResource() { } /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private MhsmPrivateLinkResourceProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * 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: Metadata pertaining to creation and last modification of the key vault resource. + * + * @return the systemData value. + */ + @Override + public SystemData systemData() { + return this.systemData; + } + + /** + * {@inheritDoc} + */ @Override public MhsmPrivateLinkResource withSku(ManagedHsmSku sku) { super.withSku(sku); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MhsmPrivateLinkResource withIdentity(ManagedServiceIdentity identity) { super.withIdentity(identity); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MhsmPrivateLinkResource withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MhsmPrivateLinkResource withTags(Map tags) { super.withTags(tags); @@ -62,7 +137,7 @@ public MhsmPrivateLinkResource withTags(Map tags) { /** * Get the groupId property: Group identifier of private link resource. - * + * * @return the groupId value. */ public String groupId() { @@ -71,7 +146,7 @@ public String groupId() { /** * Get the requiredMembers property: Required member names of private link resource. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -80,7 +155,7 @@ public List requiredMembers() { /** * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. - * + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -89,7 +164,7 @@ public List requiredZoneNames() { /** * Set the requiredZoneNames property: Required DNS zone names of the the private link resource. - * + * * @param requiredZoneNames the requiredZoneNames value to set. * @return the MhsmPrivateLinkResource object itself. */ @@ -103,7 +178,7 @@ public MhsmPrivateLinkResource withRequiredZoneNames(List requiredZoneNa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -113,4 +188,63 @@ public void validate() { innerProperties().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("sku", sku()); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmPrivateLinkResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmPrivateLinkResource 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 MhsmPrivateLinkResource. + */ + public static MhsmPrivateLinkResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmPrivateLinkResource deserializedMhsmPrivateLinkResource = new MhsmPrivateLinkResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMhsmPrivateLinkResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMhsmPrivateLinkResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMhsmPrivateLinkResource.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedMhsmPrivateLinkResource.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMhsmPrivateLinkResource.withTags(tags); + } else if ("sku".equals(fieldName)) { + deserializedMhsmPrivateLinkResource.withSku(ManagedHsmSku.fromJson(reader)); + } else if ("systemData".equals(fieldName)) { + deserializedMhsmPrivateLinkResource.systemData = SystemData.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedMhsmPrivateLinkResource.withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedMhsmPrivateLinkResource.innerProperties + = MhsmPrivateLinkResourceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmPrivateLinkResource; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateLinkServiceConnectionState.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateLinkServiceConnectionState.java index 26c7c834e91e0..822683d7cc4f9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateLinkServiceConnectionState.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmPrivateLinkServiceConnectionState.java @@ -5,37 +5,43 @@ package com.azure.resourcemanager.keyvault.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; -/** An object that represents the approval state of the private link connection. */ +/** + * An object that represents the approval state of the private link connection. + */ @Fluent -public final class MhsmPrivateLinkServiceConnectionState { +public final class MhsmPrivateLinkServiceConnectionState + implements JsonSerializable { /* * Indicates whether the connection has been approved, rejected or removed by the key vault owner. */ - @JsonProperty(value = "status") private PrivateEndpointServiceConnectionStatus status; /* * The reason for approval or rejection. */ - @JsonProperty(value = "description") private String description; /* * A message indicating if changes on the service provider require any updates on the consumer. */ - @JsonProperty(value = "actionsRequired") private ActionsRequired actionsRequired; - /** Creates an instance of MhsmPrivateLinkServiceConnectionState class. */ + /** + * Creates an instance of MhsmPrivateLinkServiceConnectionState class. + */ public MhsmPrivateLinkServiceConnectionState() { } /** * Get the status property: Indicates whether the connection has been approved, rejected or removed by the key vault * owner. - * + * * @return the status value. */ public PrivateEndpointServiceConnectionStatus status() { @@ -45,7 +51,7 @@ public PrivateEndpointServiceConnectionStatus status() { /** * Set the status property: Indicates whether the connection has been approved, rejected or removed by the key vault * owner. - * + * * @param status the status value to set. * @return the MhsmPrivateLinkServiceConnectionState object itself. */ @@ -56,7 +62,7 @@ public MhsmPrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceCo /** * Get the description property: The reason for approval or rejection. - * + * * @return the description value. */ public String description() { @@ -65,7 +71,7 @@ public String description() { /** * Set the description property: The reason for approval or rejection. - * + * * @param description the description value to set. * @return the MhsmPrivateLinkServiceConnectionState object itself. */ @@ -77,7 +83,7 @@ public MhsmPrivateLinkServiceConnectionState withDescription(String description) /** * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on * the consumer. - * + * * @return the actionsRequired value. */ public ActionsRequired actionsRequired() { @@ -87,7 +93,7 @@ public ActionsRequired actionsRequired() { /** * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on * the consumer. - * + * * @param actionsRequired the actionsRequired value to set. * @return the MhsmPrivateLinkServiceConnectionState object itself. */ @@ -98,9 +104,55 @@ public MhsmPrivateLinkServiceConnectionState withActionsRequired(ActionsRequired /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", + this.actionsRequired == null ? null : this.actionsRequired.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmPrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmPrivateLinkServiceConnectionState 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 MhsmPrivateLinkServiceConnectionState. + */ + public static MhsmPrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmPrivateLinkServiceConnectionState deserializedMhsmPrivateLinkServiceConnectionState + = new MhsmPrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedMhsmPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedMhsmPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedMhsmPrivateLinkServiceConnectionState.actionsRequired + = ActionsRequired.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmPrivateLinkServiceConnectionState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmRegionsListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmRegionsListResult.java index 291cbe7801eef..d0711c3f2f50f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmRegionsListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmRegionsListResult.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.MhsmGeoReplicatedRegionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of regions associated with a managed HSM Pools. */ +/** + * List of regions associated with a managed HSM Pools. + */ @Fluent -public final class MhsmRegionsListResult { +public final class MhsmRegionsListResult implements JsonSerializable { /* * The region associated with a managed HSM Pools. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of managed HSM Pools. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of MhsmRegionsListResult class. */ + /** + * Creates an instance of MhsmRegionsListResult class. + */ public MhsmRegionsListResult() { } /** * Get the value property: The region associated with a managed HSM Pools. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The region associated with a managed HSM Pools. - * + * * @param value the value value to set. * @return the MhsmRegionsListResult object itself. */ @@ -50,7 +56,7 @@ public MhsmRegionsListResult withValue(List value) /** * Get the nextLink property: The URL to get the next set of managed HSM Pools. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URL to get the next set of managed HSM Pools. - * + * * @param nextLink the nextLink value to set. * @return the MhsmRegionsListResult object itself. */ @@ -70,7 +76,7 @@ public MhsmRegionsListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmRegionsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmRegionsListResult 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 MhsmRegionsListResult. + */ + public static MhsmRegionsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmRegionsListResult deserializedMhsmRegionsListResult = new MhsmRegionsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MhsmGeoReplicatedRegionInner.fromJson(reader1)); + deserializedMhsmRegionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMhsmRegionsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmRegionsListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmVirtualNetworkRule.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmVirtualNetworkRule.java index 9d9de4ce5584d..63b5c29d1df45 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmVirtualNetworkRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmVirtualNetworkRule.java @@ -6,26 +6,33 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** A rule governing the accessibility of a managed hsm pool from a specific virtual network. */ +/** + * A rule governing the accessibility of a managed hsm pool from a specific virtual network. + */ @Fluent -public final class MhsmVirtualNetworkRule { +public final class MhsmVirtualNetworkRule implements JsonSerializable { /* * Full resource id of a vnet subnet, such as * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. */ - @JsonProperty(value = "id", required = true) private String id; - /** Creates an instance of MhsmVirtualNetworkRule class. */ + /** + * Creates an instance of MhsmVirtualNetworkRule class. + */ public MhsmVirtualNetworkRule() { } /** * Get the id property: Full resource id of a vnet subnet, such as * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - * + * * @return the id value. */ public String id() { @@ -35,7 +42,7 @@ public String id() { /** * Set the id property: Full resource id of a vnet subnet, such as * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - * + * * @param id the id value to set. * @return the MhsmVirtualNetworkRule object itself. */ @@ -46,16 +53,52 @@ public MhsmVirtualNetworkRule withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (id() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model MhsmVirtualNetworkRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model MhsmVirtualNetworkRule")); } } private static final ClientLogger LOGGER = new ClientLogger(MhsmVirtualNetworkRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmVirtualNetworkRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmVirtualNetworkRule 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 MhsmVirtualNetworkRule. + */ + public static MhsmVirtualNetworkRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmVirtualNetworkRule deserializedMhsmVirtualNetworkRule = new MhsmVirtualNetworkRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMhsmVirtualNetworkRule.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmVirtualNetworkRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmipRule.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmipRule.java index 37ee4a48a227a..001343ba2bd1f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmipRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/MhsmipRule.java @@ -6,26 +6,33 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** A rule governing the accessibility of a managed HSM pool from a specific IP address or IP range. */ +/** + * A rule governing the accessibility of a managed HSM pool from a specific IP address or IP range. + */ @Fluent -public final class MhsmipRule { +public final class MhsmipRule implements JsonSerializable { /* * An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all * addresses that start with 124.56.78). */ - @JsonProperty(value = "value", required = true) private String value; - /** Creates an instance of MhsmipRule class. */ + /** + * Creates an instance of MhsmipRule class. + */ public MhsmipRule() { } /** * Get the value property: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or * '124.56.78.0/24' (all addresses that start with 124.56.78). - * + * * @return the value value. */ public String value() { @@ -35,7 +42,7 @@ public String value() { /** * Set the value property: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or * '124.56.78.0/24' (all addresses that start with 124.56.78). - * + * * @param value the value value to set. * @return the MhsmipRule object itself. */ @@ -46,16 +53,52 @@ public MhsmipRule withValue(String value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model MhsmipRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model MhsmipRule")); } } private static final ClientLogger LOGGER = new ClientLogger(MhsmipRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MhsmipRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MhsmipRule 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 MhsmipRule. + */ + public static MhsmipRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MhsmipRule deserializedMhsmipRule = new MhsmipRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedMhsmipRule.value = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMhsmipRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleAction.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleAction.java index 838717592d77f..0c267b68b66c1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleAction.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleAction.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,15 +12,19 @@ * property has been evaluated. */ public final class NetworkRuleAction extends ExpandableStringEnum { - /** Static value Allow for NetworkRuleAction. */ + /** + * Static value Allow for NetworkRuleAction. + */ public static final NetworkRuleAction ALLOW = fromString("Allow"); - /** Static value Deny for NetworkRuleAction. */ + /** + * Static value Deny for NetworkRuleAction. + */ public static final NetworkRuleAction DENY = fromString("Deny"); /** * Creates a new instance of NetworkRuleAction value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +33,17 @@ public NetworkRuleAction() { /** * Creates or finds a NetworkRuleAction from its string representation. - * + * * @param name a name to look for. * @return the corresponding NetworkRuleAction. */ - @JsonCreator public static NetworkRuleAction fromString(String name) { return fromString(name, NetworkRuleAction.class); } /** * Gets known NetworkRuleAction values. - * + * * @return known NetworkRuleAction values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleBypassOptions.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleBypassOptions.java index 501f9947c03b6..150ce88d57b10 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleBypassOptions.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleBypassOptions.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -13,15 +12,19 @@ * 'AzureServices'. */ public final class NetworkRuleBypassOptions extends ExpandableStringEnum { - /** Static value AzureServices for NetworkRuleBypassOptions. */ + /** + * Static value AzureServices for NetworkRuleBypassOptions. + */ public static final NetworkRuleBypassOptions AZURE_SERVICES = fromString("AzureServices"); - /** Static value None for NetworkRuleBypassOptions. */ + /** + * Static value None for NetworkRuleBypassOptions. + */ public static final NetworkRuleBypassOptions NONE = fromString("None"); /** * Creates a new instance of NetworkRuleBypassOptions value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +33,17 @@ public NetworkRuleBypassOptions() { /** * Creates or finds a NetworkRuleBypassOptions from its string representation. - * + * * @param name a name to look for. * @return the corresponding NetworkRuleBypassOptions. */ - @JsonCreator public static NetworkRuleBypassOptions fromString(String name) { return fromString(name, NetworkRuleBypassOptions.class); } /** * Gets known NetworkRuleBypassOptions values. - * + * * @return known NetworkRuleBypassOptions values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleSet.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleSet.java index 278aa63bd50be..0a4239e7b37ae 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleSet.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/NetworkRuleSet.java @@ -5,46 +5,50 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** A set of rules governing the network accessibility of a vault. */ +/** + * A set of rules governing the network accessibility of a vault. + */ @Fluent -public final class NetworkRuleSet { +public final class NetworkRuleSet implements JsonSerializable { /* - * Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the - * default is 'AzureServices'. + * Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If not specified the default + * is 'AzureServices'. */ - @JsonProperty(value = "bypass") private NetworkRuleBypassOptions bypass; /* * The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the * bypass property has been evaluated. */ - @JsonProperty(value = "defaultAction") private NetworkRuleAction defaultAction; /* * The list of IP address rules. */ - @JsonProperty(value = "ipRules") private List ipRules; /* * The list of virtual network rules. */ - @JsonProperty(value = "virtualNetworkRules") private List virtualNetworkRules; - /** Creates an instance of NetworkRuleSet class. */ + /** + * Creates an instance of NetworkRuleSet class. + */ public NetworkRuleSet() { } /** * Get the bypass property: Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If * not specified the default is 'AzureServices'. - * + * * @return the bypass value. */ public NetworkRuleBypassOptions bypass() { @@ -54,7 +58,7 @@ public NetworkRuleBypassOptions bypass() { /** * Set the bypass property: Tells what traffic can bypass network rules. This can be 'AzureServices' or 'None'. If * not specified the default is 'AzureServices'. - * + * * @param bypass the bypass value to set. * @return the NetworkRuleSet object itself. */ @@ -66,7 +70,7 @@ public NetworkRuleSet withBypass(NetworkRuleBypassOptions bypass) { /** * Get the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. * This is only used after the bypass property has been evaluated. - * + * * @return the defaultAction value. */ public NetworkRuleAction defaultAction() { @@ -76,7 +80,7 @@ public NetworkRuleAction defaultAction() { /** * Set the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. * This is only used after the bypass property has been evaluated. - * + * * @param defaultAction the defaultAction value to set. * @return the NetworkRuleSet object itself. */ @@ -87,7 +91,7 @@ public NetworkRuleSet withDefaultAction(NetworkRuleAction defaultAction) { /** * Get the ipRules property: The list of IP address rules. - * + * * @return the ipRules value. */ public List ipRules() { @@ -96,7 +100,7 @@ public List ipRules() { /** * Set the ipRules property: The list of IP address rules. - * + * * @param ipRules the ipRules value to set. * @return the NetworkRuleSet object itself. */ @@ -107,7 +111,7 @@ public NetworkRuleSet withIpRules(List ipRules) { /** * Get the virtualNetworkRules property: The list of virtual network rules. - * + * * @return the virtualNetworkRules value. */ public List virtualNetworkRules() { @@ -116,7 +120,7 @@ public List virtualNetworkRules() { /** * Set the virtualNetworkRules property: The list of virtual network rules. - * + * * @param virtualNetworkRules the virtualNetworkRules value to set. * @return the NetworkRuleSet object itself. */ @@ -127,7 +131,7 @@ public NetworkRuleSet withVirtualNetworkRules(List virtualNe /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -138,4 +142,53 @@ public void validate() { virtualNetworkRules().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("bypass", this.bypass == null ? null : this.bypass.toString()); + jsonWriter.writeStringField("defaultAction", this.defaultAction == null ? null : this.defaultAction.toString()); + jsonWriter.writeArrayField("ipRules", this.ipRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("virtualNetworkRules", this.virtualNetworkRules, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkRuleSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkRuleSet 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 NetworkRuleSet. + */ + public static NetworkRuleSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkRuleSet deserializedNetworkRuleSet = new NetworkRuleSet(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bypass".equals(fieldName)) { + deserializedNetworkRuleSet.bypass = NetworkRuleBypassOptions.fromString(reader.getString()); + } else if ("defaultAction".equals(fieldName)) { + deserializedNetworkRuleSet.defaultAction = NetworkRuleAction.fromString(reader.getString()); + } else if ("ipRules".equals(fieldName)) { + List ipRules = reader.readArray(reader1 -> IpRule.fromJson(reader1)); + deserializedNetworkRuleSet.ipRules = ipRules; + } else if ("virtualNetworkRules".equals(fieldName)) { + List virtualNetworkRules + = reader.readArray(reader1 -> VirtualNetworkRule.fromJson(reader1)); + deserializedNetworkRuleSet.virtualNetworkRules = virtualNetworkRules; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkRuleSet; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationDisplay.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationDisplay.java index f766550bf7806..f81040ce54967 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationDisplay.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationDisplay.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Display metadata associated with the operation. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Display metadata associated with the operation. + */ @Fluent -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* * Service provider: Microsoft Key Vault. */ - @JsonProperty(value = "provider") private String provider; /* * Resource on which the operation is performed etc. */ - @JsonProperty(value = "resource") private String resource; /* * Type of operation: get, read, delete, etc. */ - @JsonProperty(value = "operation") private String operation; /* * Description of operation. */ - @JsonProperty(value = "description") private String description; - /** Creates an instance of OperationDisplay class. */ + /** + * Creates an instance of OperationDisplay class. + */ public OperationDisplay() { } /** * Get the provider property: Service provider: Microsoft Key Vault. - * + * * @return the provider value. */ public String provider() { @@ -49,7 +53,7 @@ public String provider() { /** * Set the provider property: Service provider: Microsoft Key Vault. - * + * * @param provider the provider value to set. * @return the OperationDisplay object itself. */ @@ -60,7 +64,7 @@ public OperationDisplay withProvider(String provider) { /** * Get the resource property: Resource on which the operation is performed etc. - * + * * @return the resource value. */ public String resource() { @@ -69,7 +73,7 @@ public String resource() { /** * Set the resource property: Resource on which the operation is performed etc. - * + * * @param resource the resource value to set. * @return the OperationDisplay object itself. */ @@ -80,7 +84,7 @@ public OperationDisplay withResource(String resource) { /** * Get the operation property: Type of operation: get, read, delete, etc. - * + * * @return the operation value. */ public String operation() { @@ -89,7 +93,7 @@ public String operation() { /** * Set the operation property: Type of operation: get, read, delete, etc. - * + * * @param operation the operation value to set. * @return the OperationDisplay object itself. */ @@ -100,7 +104,7 @@ public OperationDisplay withOperation(String operation) { /** * Get the description property: Description of operation. - * + * * @return the description value. */ public String description() { @@ -109,7 +113,7 @@ public String description() { /** * Set the description property: Description of operation. - * + * * @param description the description value to set. * @return the OperationDisplay object itself. */ @@ -120,9 +124,54 @@ public OperationDisplay withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationListResult.java index c8baa8fba1077..1e6a424dc64fd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/OperationListResult.java @@ -5,8 +5,12 @@ package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -14,26 +18,26 @@ * of results. */ @Fluent -public final class OperationListResult { +public final class OperationListResult implements JsonSerializable { /* * List of Storage operations supported by the Storage resource provider. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of operations. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of OperationListResult class. */ + /** + * Creates an instance of OperationListResult class. + */ public OperationListResult() { } /** * Get the value property: List of Storage operations supported by the Storage resource provider. - * + * * @return the value value. */ public List value() { @@ -42,7 +46,7 @@ public List value() { /** * Set the value property: List of Storage operations supported by the Storage resource provider. - * + * * @param value the value value to set. * @return the OperationListResult object itself. */ @@ -53,7 +57,7 @@ public OperationListResult withValue(List value) { /** * Get the nextLink property: The URL to get the next set of operations. - * + * * @return the nextLink value. */ public String nextLink() { @@ -62,7 +66,7 @@ public String nextLink() { /** * Set the nextLink property: The URL to get the next set of operations. - * + * * @param nextLink the nextLink value to set. * @return the OperationListResult object itself. */ @@ -73,7 +77,7 @@ public OperationListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -81,4 +85,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)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Permissions.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Permissions.java index def1ec2f4bf81..27c8ef880ba82 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Permissions.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Permissions.java @@ -5,43 +5,47 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Permissions the identity has for keys, secrets, certificates and storage. */ +/** + * Permissions the identity has for keys, secrets, certificates and storage. + */ @Fluent -public final class Permissions { +public final class Permissions implements JsonSerializable { /* * Permissions to keys */ - @JsonProperty(value = "keys") private List keys; /* * Permissions to secrets */ - @JsonProperty(value = "secrets") private List secrets; /* * Permissions to certificates */ - @JsonProperty(value = "certificates") private List certificates; /* * Permissions to storage accounts */ - @JsonProperty(value = "storage") private List storage; - /** Creates an instance of Permissions class. */ + /** + * Creates an instance of Permissions class. + */ public Permissions() { } /** * Get the keys property: Permissions to keys. - * + * * @return the keys value. */ public List keys() { @@ -50,7 +54,7 @@ public List keys() { /** * Set the keys property: Permissions to keys. - * + * * @param keys the keys value to set. * @return the Permissions object itself. */ @@ -61,7 +65,7 @@ public Permissions withKeys(List keys) { /** * Get the secrets property: Permissions to secrets. - * + * * @return the secrets value. */ public List secrets() { @@ -70,7 +74,7 @@ public List secrets() { /** * Set the secrets property: Permissions to secrets. - * + * * @param secrets the secrets value to set. * @return the Permissions object itself. */ @@ -81,7 +85,7 @@ public Permissions withSecrets(List secrets) { /** * Get the certificates property: Permissions to certificates. - * + * * @return the certificates value. */ public List certificates() { @@ -90,7 +94,7 @@ public List certificates() { /** * Set the certificates property: Permissions to certificates. - * + * * @param certificates the certificates value to set. * @return the Permissions object itself. */ @@ -101,7 +105,7 @@ public Permissions withCertificates(List certificates) { /** * Get the storage property: Permissions to storage accounts. - * + * * @return the storage value. */ public List storage() { @@ -110,7 +114,7 @@ public List storage() { /** * Set the storage property: Permissions to storage accounts. - * + * * @param storage the storage value to set. * @return the Permissions object itself. */ @@ -121,9 +125,66 @@ public Permissions withStorage(List storage) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("keys", this.keys, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("secrets", this.secrets, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("certificates", this.certificates, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeArrayField("storage", this.storage, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Permissions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Permissions 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 Permissions. + */ + public static Permissions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Permissions deserializedPermissions = new Permissions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keys".equals(fieldName)) { + List keys + = reader.readArray(reader1 -> KeyPermissions.fromString(reader1.getString())); + deserializedPermissions.keys = keys; + } else if ("secrets".equals(fieldName)) { + List secrets + = reader.readArray(reader1 -> SecretPermissions.fromString(reader1.getString())); + deserializedPermissions.secrets = secrets; + } else if ("certificates".equals(fieldName)) { + List certificates + = reader.readArray(reader1 -> CertificatePermissions.fromString(reader1.getString())); + deserializedPermissions.certificates = certificates; + } else if ("storage".equals(fieldName)) { + List storage + = reader.readArray(reader1 -> StoragePermissions.fromString(reader1.getString())); + deserializedPermissions.storage = storage; + } else { + reader.skipChildren(); + } + } + + return deserializedPermissions; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpoint.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpoint.java index fa7cd06f6af70..43403768d7bf0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpoint.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpoint.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Private endpoint object properties. */ +/** + * Private endpoint object properties. + */ @Immutable -public final class PrivateEndpoint { +public final class PrivateEndpoint implements JsonSerializable { /* * Full identifier of the private endpoint resource. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; - /** Creates an instance of PrivateEndpoint class. */ + /** + * Creates an instance of PrivateEndpoint class. + */ public PrivateEndpoint() { } /** * Get the id property: Full identifier of the private endpoint resource. - * + * * @return the id value. */ public String id() { @@ -31,9 +38,44 @@ public String id() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpoint. + */ + public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpoint.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpoint; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionItem.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionItem.java index b16e9187e3981..feae18811281e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionItem.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.PrivateEndpointConnectionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; -/** Private endpoint connection item. */ +/** + * Private endpoint connection item. + */ @Fluent -public final class PrivateEndpointConnectionItem { +public final class PrivateEndpointConnectionItem implements JsonSerializable { /* * Id of private endpoint connection. */ - @JsonProperty(value = "id") private String id; /* * Modified whenever there is a change in the state of private endpoint connection. */ - @JsonProperty(value = "etag") private String etag; /* * Private endpoint connection properties. */ - @JsonProperty(value = "properties") private PrivateEndpointConnectionProperties innerProperties; - /** Creates an instance of PrivateEndpointConnectionItem class. */ + /** + * Creates an instance of PrivateEndpointConnectionItem class. + */ public PrivateEndpointConnectionItem() { } /** * Get the id property: Id of private endpoint connection. - * + * * @return the id value. */ public String id() { @@ -44,7 +49,7 @@ public String id() { /** * Set the id property: Id of private endpoint connection. - * + * * @param id the id value to set. * @return the PrivateEndpointConnectionItem object itself. */ @@ -55,7 +60,7 @@ public PrivateEndpointConnectionItem withId(String id) { /** * Get the etag property: Modified whenever there is a change in the state of private endpoint connection. - * + * * @return the etag value. */ public String etag() { @@ -64,7 +69,7 @@ public String etag() { /** * Set the etag property: Modified whenever there is a change in the state of private endpoint connection. - * + * * @param etag the etag value to set. * @return the PrivateEndpointConnectionItem object itself. */ @@ -75,7 +80,7 @@ public PrivateEndpointConnectionItem withEtag(String etag) { /** * Get the innerProperties property: Private endpoint connection properties. - * + * * @return the innerProperties value. */ private PrivateEndpointConnectionProperties innerProperties() { @@ -84,7 +89,7 @@ private PrivateEndpointConnectionProperties innerProperties() { /** * Get the privateEndpoint property: Properties of the private endpoint object. - * + * * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { @@ -93,7 +98,7 @@ public PrivateEndpoint privateEndpoint() { /** * Set the privateEndpoint property: Properties of the private endpoint object. - * + * * @param privateEndpoint the privateEndpoint value to set. * @return the PrivateEndpointConnectionItem object itself. */ @@ -107,7 +112,7 @@ public PrivateEndpointConnectionItem withPrivateEndpoint(PrivateEndpoint private /** * Get the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { @@ -116,12 +121,12 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { /** * Set the privateLinkServiceConnectionState property: Approval state of the private link connection. - * + * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the PrivateEndpointConnectionItem object itself. */ - public PrivateEndpointConnectionItem withPrivateLinkServiceConnectionState( - PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + public PrivateEndpointConnectionItem + withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { if (this.innerProperties() == null) { this.innerProperties = new PrivateEndpointConnectionProperties(); } @@ -131,7 +136,7 @@ public PrivateEndpointConnectionItem withPrivateLinkServiceConnectionState( /** * Get the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { @@ -140,12 +145,12 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { /** * Set the provisioningState property: Provisioning state of the private endpoint connection. - * + * * @param provisioningState the provisioningState value to set. * @return the PrivateEndpointConnectionItem object itself. */ - public PrivateEndpointConnectionItem withProvisioningState( - PrivateEndpointConnectionProvisioningState provisioningState) { + public PrivateEndpointConnectionItem + withProvisioningState(PrivateEndpointConnectionProvisioningState provisioningState) { if (this.innerProperties() == null) { this.innerProperties = new PrivateEndpointConnectionProperties(); } @@ -155,7 +160,7 @@ public PrivateEndpointConnectionItem withProvisioningState( /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -163,4 +168,48 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("etag", this.etag); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionItem 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 PrivateEndpointConnectionItem. + */ + public static PrivateEndpointConnectionItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionItem deserializedPrivateEndpointConnectionItem + = new PrivateEndpointConnectionItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionItem.id = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedPrivateEndpointConnectionItem.etag = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionItem.innerProperties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionListResult.java index 8b769e04a0504..d888fb5e929c8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionListResult.java @@ -5,32 +5,39 @@ package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.PrivateEndpointConnectionInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of private endpoint connections. */ +/** + * List of private endpoint connections. + */ @Fluent -public final class PrivateEndpointConnectionListResult { +public final class PrivateEndpointConnectionListResult + implements JsonSerializable { /* * The list of private endpoint connections. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of private endpoint connections. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of PrivateEndpointConnectionListResult class. */ + /** + * Creates an instance of PrivateEndpointConnectionListResult class. + */ public PrivateEndpointConnectionListResult() { } /** * Get the value property: The list of private endpoint connections. - * + * * @return the value value. */ public List value() { @@ -39,7 +46,7 @@ public List value() { /** * Set the value property: The list of private endpoint connections. - * + * * @param value the value value to set. * @return the PrivateEndpointConnectionListResult object itself. */ @@ -50,7 +57,7 @@ public PrivateEndpointConnectionListResult withValue(List e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionListResult if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionListResult. + */ + public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult + = new PrivateEndpointConnectionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionProvisioningState.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionProvisioningState.java index 783923057f72e..c37f7bca6c4e4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionProvisioningState.java @@ -5,33 +5,46 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The current provisioning state. */ +/** + * The current provisioning state. + */ public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Creating for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - /** Static value Updating for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Updating for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState UPDATING = fromString("Updating"); - /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Deleting for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Failed for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); - /** Static value Disconnected for PrivateEndpointConnectionProvisioningState. */ + /** + * Static value Disconnected for PrivateEndpointConnectionProvisioningState. + */ public static final PrivateEndpointConnectionProvisioningState DISCONNECTED = fromString("Disconnected"); /** * Creates a new instance of PrivateEndpointConnectionProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -40,18 +53,17 @@ public PrivateEndpointConnectionProvisioningState() { /** * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding PrivateEndpointConnectionProvisioningState. */ - @JsonCreator public static PrivateEndpointConnectionProvisioningState fromString(String name) { return fromString(name, PrivateEndpointConnectionProvisioningState.class); } /** * Gets known PrivateEndpointConnectionProvisioningState values. - * + * * @return known PrivateEndpointConnectionProvisioningState values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutHeaders.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutHeaders.java index 667dba31e8b2a..c8a12eb06159e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutHeaders.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutHeaders.java @@ -7,21 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; -/** The PrivateEndpointConnectionsPutHeaders model. */ +/** + * The PrivateEndpointConnectionsPutHeaders model. + */ @Fluent public final class PrivateEndpointConnectionsPutHeaders { /* * The Retry-After property. */ - @JsonProperty(value = "Retry-After") private Integer retryAfter; /* * The Azure-AsyncOperation property. */ - @JsonProperty(value = "Azure-AsyncOperation") private String azureAsyncOperation; private static final HttpHeaderName AZURE_ASYNC_OPERATION = HttpHeaderName.fromString("Azure-AsyncOperation"); @@ -29,7 +28,7 @@ public final class PrivateEndpointConnectionsPutHeaders { // HttpHeaders containing the raw property values. /** * Creates an instance of PrivateEndpointConnectionsPutHeaders class. - * + * * @param rawHeaders The raw HttpHeaders that will be used to create the property values. */ public PrivateEndpointConnectionsPutHeaders(HttpHeaders rawHeaders) { @@ -42,7 +41,7 @@ public PrivateEndpointConnectionsPutHeaders(HttpHeaders rawHeaders) { /** * Get the retryAfter property: The Retry-After property. - * + * * @return the retryAfter value. */ public Integer retryAfter() { @@ -51,7 +50,7 @@ public Integer retryAfter() { /** * Set the retryAfter property: The Retry-After property. - * + * * @param retryAfter the retryAfter value to set. * @return the PrivateEndpointConnectionsPutHeaders object itself. */ @@ -62,7 +61,7 @@ public PrivateEndpointConnectionsPutHeaders withRetryAfter(Integer retryAfter) { /** * Get the azureAsyncOperation property: The Azure-AsyncOperation property. - * + * * @return the azureAsyncOperation value. */ public String azureAsyncOperation() { @@ -71,7 +70,7 @@ public String azureAsyncOperation() { /** * Set the azureAsyncOperation property: The Azure-AsyncOperation property. - * + * * @param azureAsyncOperation the azureAsyncOperation value to set. * @return the PrivateEndpointConnectionsPutHeaders object itself. */ @@ -82,7 +81,7 @@ public PrivateEndpointConnectionsPutHeaders withAzureAsyncOperation(String azure /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutResponse.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutResponse.java index f8e02329c2b9c..e572270907bf5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutResponse.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointConnectionsPutResponse.java @@ -9,30 +9,28 @@ import com.azure.core.http.rest.ResponseBase; import com.azure.resourcemanager.keyvault.fluent.models.PrivateEndpointConnectionInner; -/** Contains all response data for the put operation. */ +/** + * Contains all response data for the put operation. + */ public final class PrivateEndpointConnectionsPutResponse extends ResponseBase { /** * Creates an instance of PrivateEndpointConnectionsPutResponse. - * + * * @param request the request which resulted in this PrivateEndpointConnectionsPutResponse. * @param statusCode the status code of the HTTP response. * @param rawHeaders the raw headers of the HTTP response. * @param value the deserialized value of the HTTP response. * @param headers the deserialized headers of the HTTP response. */ - public PrivateEndpointConnectionsPutResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - PrivateEndpointConnectionInner value, - PrivateEndpointConnectionsPutHeaders headers) { + public PrivateEndpointConnectionsPutResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + PrivateEndpointConnectionInner value, PrivateEndpointConnectionsPutHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } /** * Gets the deserialized response body. - * + * * @return the deserialized response body. */ @Override diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointServiceConnectionStatus.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointServiceConnectionStatus.java index 7bd0f09954663..75d90ee8ccadf 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateEndpointServiceConnectionStatus.java @@ -5,27 +5,36 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The private endpoint connection status. */ +/** + * The private endpoint connection status. + */ public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { - /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Pending for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Approved for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Rejected for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); - /** Static value Disconnected for PrivateEndpointServiceConnectionStatus. */ + /** + * Static value Disconnected for PrivateEndpointServiceConnectionStatus. + */ public static final PrivateEndpointServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); /** * Creates a new instance of PrivateEndpointServiceConnectionStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +43,17 @@ public PrivateEndpointServiceConnectionStatus() { /** * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding PrivateEndpointServiceConnectionStatus. */ - @JsonCreator public static PrivateEndpointServiceConnectionStatus fromString(String name) { return fromString(name, PrivateEndpointServiceConnectionStatus.class); } /** * Gets known PrivateEndpointServiceConnectionStatus values. - * + * * @return known PrivateEndpointServiceConnectionStatus values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkResource.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkResource.java index 47b0651af3b05..96ac9aafdd37c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkResource.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkResource.java @@ -6,41 +6,96 @@ 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.keyvault.fluent.models.PrivateLinkResourceProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; import java.util.Map; -/** A private link resource. */ +/** + * A private link resource. + */ @Fluent public final class PrivateLinkResource extends Resource { /* * Resource properties. */ - @JsonProperty(value = "properties") private PrivateLinkResourceProperties innerProperties; - /** Creates an instance of PrivateLinkResource class. */ + /* + * 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 PrivateLinkResource class. + */ public PrivateLinkResource() { } /** * Get the innerProperties property: Resource properties. - * + * * @return the innerProperties value. */ private PrivateLinkResourceProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * 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} + */ @Override public PrivateLinkResource withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public PrivateLinkResource withTags(Map tags) { super.withTags(tags); @@ -49,7 +104,7 @@ public PrivateLinkResource withTags(Map tags) { /** * Get the groupId property: Group identifier of private link resource. - * + * * @return the groupId value. */ public String groupId() { @@ -58,7 +113,7 @@ public String groupId() { /** * Get the requiredMembers property: Required member names of private link resource. - * + * * @return the requiredMembers value. */ public List requiredMembers() { @@ -67,7 +122,7 @@ public List requiredMembers() { /** * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. - * + * * @return the requiredZoneNames value. */ public List requiredZoneNames() { @@ -76,7 +131,7 @@ public List requiredZoneNames() { /** * Set the requiredZoneNames property: Required DNS zone names of the the private link resource. - * + * * @param requiredZoneNames the requiredZoneNames value to set. * @return the PrivateLinkResource object itself. */ @@ -90,7 +145,7 @@ public PrivateLinkResource withRequiredZoneNames(List requiredZoneNames) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -98,4 +153,54 @@ public void validate() { innerProperties().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.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResource 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 PrivateLinkResource. + */ + public static PrivateLinkResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResource deserializedPrivateLinkResource = new PrivateLinkResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResource.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResource.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResource.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPrivateLinkResource.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPrivateLinkResource.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResource.innerProperties = PrivateLinkResourceProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResource; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkServiceConnectionState.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkServiceConnectionState.java index 230c701c1b938..ca65aa923eea1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkServiceConnectionState.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PrivateLinkServiceConnectionState.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.keyvault.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; -/** An object that represents the approval state of the private link connection. */ +/** + * An object that represents the approval state of the private link connection. + */ @Fluent -public final class PrivateLinkServiceConnectionState { +public final class PrivateLinkServiceConnectionState implements JsonSerializable { /* * Indicates whether the connection has been approved, rejected or removed by the key vault owner. */ - @JsonProperty(value = "status") private PrivateEndpointServiceConnectionStatus status; /* * The reason for approval or rejection. */ - @JsonProperty(value = "description") private String description; /* * A message indicating if changes on the service provider require any updates on the consumer. */ - @JsonProperty(value = "actionsRequired") private ActionsRequired actionsRequired; - /** Creates an instance of PrivateLinkServiceConnectionState class. */ + /** + * Creates an instance of PrivateLinkServiceConnectionState class. + */ public PrivateLinkServiceConnectionState() { } /** * Get the status property: Indicates whether the connection has been approved, rejected or removed by the key vault * owner. - * + * * @return the status value. */ public PrivateEndpointServiceConnectionStatus status() { @@ -45,7 +50,7 @@ public PrivateEndpointServiceConnectionStatus status() { /** * Set the status property: Indicates whether the connection has been approved, rejected or removed by the key vault * owner. - * + * * @param status the status value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -56,7 +61,7 @@ public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnec /** * Get the description property: The reason for approval or rejection. - * + * * @return the description value. */ public String description() { @@ -65,7 +70,7 @@ public String description() { /** * Set the description property: The reason for approval or rejection. - * + * * @param description the description value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -77,7 +82,7 @@ public PrivateLinkServiceConnectionState withDescription(String description) { /** * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on * the consumer. - * + * * @return the actionsRequired value. */ public ActionsRequired actionsRequired() { @@ -87,7 +92,7 @@ public ActionsRequired actionsRequired() { /** * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on * the consumer. - * + * * @param actionsRequired the actionsRequired value to set. * @return the PrivateLinkServiceConnectionState object itself. */ @@ -98,9 +103,55 @@ public PrivateLinkServiceConnectionState withActionsRequired(ActionsRequired act /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", + this.actionsRequired == null ? null : this.actionsRequired.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkServiceConnectionState. + */ + public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState + = new PrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.status + = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedPrivateLinkServiceConnectionState.actionsRequired + = ActionsRequired.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkServiceConnectionState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ProvisioningState.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ProvisioningState.java index b65ad3de11bc6..8fc8fe53d3e4a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ProvisioningState.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ProvisioningState.java @@ -5,38 +5,55 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Provisioning state. */ +/** + * Provisioning state. + */ public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ProvisioningState. */ + /** + * Static value Succeeded for ProvisioningState. + */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Provisioning for ProvisioningState. */ + /** + * Static value Provisioning for ProvisioningState. + */ public static final ProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Failed for ProvisioningState. */ + /** + * Static value Failed for ProvisioningState. + */ public static final ProvisioningState FAILED = fromString("Failed"); - /** Static value Updating for ProvisioningState. */ + /** + * Static value Updating for ProvisioningState. + */ public static final ProvisioningState UPDATING = fromString("Updating"); - /** Static value Deleting for ProvisioningState. */ + /** + * Static value Deleting for ProvisioningState. + */ public static final ProvisioningState DELETING = fromString("Deleting"); - /** Static value Activated for ProvisioningState. */ + /** + * Static value Activated for ProvisioningState. + */ public static final ProvisioningState ACTIVATED = fromString("Activated"); - /** Static value SecurityDomainRestore for ProvisioningState. */ + /** + * Static value SecurityDomainRestore for ProvisioningState. + */ public static final ProvisioningState SECURITY_DOMAIN_RESTORE = fromString("SecurityDomainRestore"); - /** Static value Restoring for ProvisioningState. */ + /** + * Static value Restoring for ProvisioningState. + */ public static final ProvisioningState RESTORING = fromString("Restoring"); /** * Creates a new instance of ProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -45,18 +62,17 @@ public ProvisioningState() { /** * Creates or finds a ProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningState. */ - @JsonCreator public static ProvisioningState fromString(String name) { return fromString(name, ProvisioningState.class); } /** * Gets known ProvisioningState values. - * + * * @return known ProvisioningState values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ProxyResourceWithoutSystemData.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ProxyResourceWithoutSystemData.java new file mode 100644 index 0000000000000..4c69fa54408f2 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ProxyResourceWithoutSystemData.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +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 java.io.IOException; +import java.util.Map; + +/** + * Resource + * + * Common fields that are returned in the response for all Azure Resource Manager resources. + */ +@Fluent +public class ProxyResourceWithoutSystemData extends ProxyResource { + /* + * Resource tags. + */ + private Map tags; + + /* + * 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 ProxyResourceWithoutSystemData class. + */ + public ProxyResourceWithoutSystemData() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ProxyResourceWithoutSystemData object itself. + */ + public ProxyResourceWithoutSystemData withTags(Map tags) { + this.tags = tags; + 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. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProxyResourceWithoutSystemData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProxyResourceWithoutSystemData 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 ProxyResourceWithoutSystemData. + */ + public static ProxyResourceWithoutSystemData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProxyResourceWithoutSystemData deserializedProxyResourceWithoutSystemData + = new ProxyResourceWithoutSystemData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProxyResourceWithoutSystemData.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProxyResourceWithoutSystemData.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProxyResourceWithoutSystemData.type = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedProxyResourceWithoutSystemData.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedProxyResourceWithoutSystemData; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PublicNetworkAccess.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PublicNetworkAccess.java index 3ab15993e7114..3aa47a9947d83 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PublicNetworkAccess.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/PublicNetworkAccess.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Control permission to the managed HSM from public networks. */ +/** + * Control permission to the managed HSM from public networks. + */ public final class PublicNetworkAccess extends ExpandableStringEnum { - /** Static value Enabled for PublicNetworkAccess. */ + /** + * Static value Enabled for PublicNetworkAccess. + */ public static final PublicNetworkAccess ENABLED = fromString("Enabled"); - /** Static value Disabled for PublicNetworkAccess. */ + /** + * Static value Disabled for PublicNetworkAccess. + */ public static final PublicNetworkAccess DISABLED = fromString("Disabled"); /** * Creates a new instance of PublicNetworkAccess value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public PublicNetworkAccess() { /** * Creates or finds a PublicNetworkAccess from its string representation. - * + * * @param name a name to look for. * @return the corresponding PublicNetworkAccess. */ - @JsonCreator public static PublicNetworkAccess fromString(String name) { return fromString(name, PublicNetworkAccess.class); } /** * Gets known PublicNetworkAccess values. - * + * * @return known PublicNetworkAccess values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Reason.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Reason.java index 5f97546644d98..0a4a18475755f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Reason.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Reason.java @@ -4,18 +4,23 @@ package com.azure.resourcemanager.keyvault.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. */ +/** + * The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. + */ public enum Reason { - /** Enum value AccountNameInvalid. */ + /** + * Enum value AccountNameInvalid. + */ ACCOUNT_NAME_INVALID("AccountNameInvalid"), - /** Enum value AlreadyExists. */ + /** + * Enum value AlreadyExists. + */ ALREADY_EXISTS("AlreadyExists"); - /** The actual serialized value for a Reason instance. */ + /** + * The actual serialized value for a Reason instance. + */ private final String value; Reason(String value) { @@ -24,11 +29,10 @@ public enum Reason { /** * Parses a serialized value to a Reason instance. - * + * * @param value the serialized value to parse. * @return the parsed Reason object, or null if unable to parse. */ - @JsonCreator public static Reason fromString(String value) { if (value == null) { return null; @@ -42,8 +46,9 @@ public static Reason fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ResourceListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ResourceListResult.java index 2ab702c4a21c3..759f1b1f960d5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ResourceListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ResourceListResult.java @@ -6,31 +6,37 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** List of vault resources. */ +/** + * List of vault resources. + */ @Fluent -public final class ResourceListResult { +public final class ResourceListResult implements JsonSerializable { /* * The list of vault resources. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of vault resources. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of ResourceListResult class. */ + /** + * Creates an instance of ResourceListResult class. + */ public ResourceListResult() { } /** * Get the value property: The list of vault resources. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The list of vault resources. - * + * * @param value the value value to set. * @return the ResourceListResult object itself. */ @@ -50,7 +56,7 @@ public ResourceListResult withValue(List value) { /** * Get the nextLink property: The URL to get the next set of vault resources. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URL to get the next set of vault resources. - * + * * @param nextLink the nextLink value to set. * @return the ResourceListResult object itself. */ @@ -70,9 +76,49 @@ public ResourceListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceListResult 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 ResourceListResult. + */ + public static ResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceListResult deserializedResourceListResult = new ResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> Resource.fromJson(reader1)); + deserializedResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/RotationPolicy.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/RotationPolicy.java new file mode 100644 index 0000000000000..91ea76e564ad4 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/RotationPolicy.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The RotationPolicy model. + */ +@Fluent +public final class RotationPolicy implements JsonSerializable { + /* + * The attributes of key rotation policy. + */ + private KeyRotationPolicyAttributes attributes; + + /* + * The lifetimeActions for key rotation action. + */ + private List lifetimeActions; + + /** + * Creates an instance of RotationPolicy class. + */ + public RotationPolicy() { + } + + /** + * Get the attributes property: The attributes of key rotation policy. + * + * @return the attributes value. + */ + public KeyRotationPolicyAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: The attributes of key rotation policy. + * + * @param attributes the attributes value to set. + * @return the RotationPolicy object itself. + */ + public RotationPolicy withAttributes(KeyRotationPolicyAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the lifetimeActions property: The lifetimeActions for key rotation action. + * + * @return the lifetimeActions value. + */ + public List lifetimeActions() { + return this.lifetimeActions; + } + + /** + * Set the lifetimeActions property: The lifetimeActions for key rotation action. + * + * @param lifetimeActions the lifetimeActions value to set. + * @return the RotationPolicy object itself. + */ + public RotationPolicy withLifetimeActions(List lifetimeActions) { + this.lifetimeActions = lifetimeActions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributes() != null) { + attributes().validate(); + } + if (lifetimeActions() != null) { + lifetimeActions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("attributes", this.attributes); + jsonWriter.writeArrayField("lifetimeActions", this.lifetimeActions, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RotationPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RotationPolicy 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 RotationPolicy. + */ + public static RotationPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RotationPolicy deserializedRotationPolicy = new RotationPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attributes".equals(fieldName)) { + deserializedRotationPolicy.attributes = KeyRotationPolicyAttributes.fromJson(reader); + } else if ("lifetimeActions".equals(fieldName)) { + List lifetimeActions + = reader.readArray(reader1 -> LifetimeAction.fromJson(reader1)); + deserializedRotationPolicy.lifetimeActions = lifetimeActions; + } else { + reader.skipChildren(); + } + } + + return deserializedRotationPolicy; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretAttributes.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretAttributes.java new file mode 100644 index 0000000000000..7b90faedeed41 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretAttributes.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * The secret management attributes. + */ +@Fluent +public final class SecretAttributes extends Attributes { + /* + * Creation time in seconds since 1970-01-01T00:00:00Z. + */ + private Long created; + + /* + * Last updated time in seconds since 1970-01-01T00:00:00Z. + */ + private Long updated; + + /** + * Creates an instance of SecretAttributes class. + */ + public SecretAttributes() { + } + + /** + * Get the created property: Creation time in seconds since 1970-01-01T00:00:00Z. + * + * @return the created value. + */ + @Override + public OffsetDateTime created() { + if (this.created == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.created), ZoneOffset.UTC); + } + + /** + * Get the updated property: Last updated time in seconds since 1970-01-01T00:00:00Z. + * + * @return the updated value. + */ + @Override + public OffsetDateTime updated() { + if (this.updated == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.updated), ZoneOffset.UTC); + } + + /** + * {@inheritDoc} + */ + @Override + public SecretAttributes withEnabled(Boolean enabled) { + super.withEnabled(enabled); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SecretAttributes withNotBefore(OffsetDateTime notBefore) { + super.withNotBefore(notBefore); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SecretAttributes withExpires(OffsetDateTime expires) { + super.withExpires(expires); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", enabled()); + if (notBefore() != null) { + jsonWriter.writeNumberField("nbf", notBefore().toEpochSecond()); + } + if (expires() != null) { + jsonWriter.writeNumberField("exp", expires().toEpochSecond()); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretAttributes 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 SecretAttributes. + */ + public static SecretAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretAttributes deserializedSecretAttributes = new SecretAttributes(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedSecretAttributes.withEnabled(reader.getNullable(JsonReader::getBoolean)); + } else if ("nbf".equals(fieldName)) { + Long notBeforeHolder = reader.getNullable(JsonReader::getLong); + if (notBeforeHolder != null) { + deserializedSecretAttributes.withNotBefore( + OffsetDateTime.ofInstant(Instant.ofEpochSecond(notBeforeHolder), ZoneOffset.UTC)); + } + } else if ("exp".equals(fieldName)) { + Long expiresHolder = reader.getNullable(JsonReader::getLong); + if (expiresHolder != null) { + deserializedSecretAttributes.withExpires( + OffsetDateTime.ofInstant(Instant.ofEpochSecond(expiresHolder), ZoneOffset.UTC)); + } + } else if ("created".equals(fieldName)) { + deserializedSecretAttributes.created = reader.getNullable(JsonReader::getLong); + } else if ("updated".equals(fieldName)) { + deserializedSecretAttributes.updated = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretAttributes; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretCreateOrUpdateParameters.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretCreateOrUpdateParameters.java new file mode 100644 index 0000000000000..f323641744d76 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretCreateOrUpdateParameters.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Parameters for creating or updating a secret. + */ +@Fluent +public final class SecretCreateOrUpdateParameters implements JsonSerializable { + /* + * The tags that will be assigned to the secret. + */ + private Map tags; + + /* + * Properties of the secret + */ + private SecretProperties properties; + + /** + * Creates an instance of SecretCreateOrUpdateParameters class. + */ + public SecretCreateOrUpdateParameters() { + } + + /** + * Get the tags property: The tags that will be assigned to the secret. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags that will be assigned to the secret. + * + * @param tags the tags value to set. + * @return the SecretCreateOrUpdateParameters object itself. + */ + public SecretCreateOrUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: Properties of the secret. + * + * @return the properties value. + */ + public SecretProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the secret. + * + * @param properties the properties value to set. + * @return the SecretCreateOrUpdateParameters object itself. + */ + public SecretCreateOrUpdateParameters withProperties(SecretProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model SecretCreateOrUpdateParameters")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SecretCreateOrUpdateParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretCreateOrUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretCreateOrUpdateParameters 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 SecretCreateOrUpdateParameters. + */ + public static SecretCreateOrUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretCreateOrUpdateParameters deserializedSecretCreateOrUpdateParameters + = new SecretCreateOrUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSecretCreateOrUpdateParameters.properties = SecretProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecretCreateOrUpdateParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSecretCreateOrUpdateParameters; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretListResult.java new file mode 100644 index 0000000000000..08c52cc4dd505 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretListResult.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.SecretInner; +import java.io.IOException; +import java.util.List; + +/** + * List of secrets. + */ +@Fluent +public final class SecretListResult implements JsonSerializable { + /* + * The list of secrets. + */ + private List value; + + /* + * The URL to get the next set of secrets. + */ + private String nextLink; + + /** + * Creates an instance of SecretListResult class. + */ + public SecretListResult() { + } + + /** + * Get the value property: The list of secrets. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of secrets. + * + * @param value the value value to set. + * @return the SecretListResult object itself. + */ + public SecretListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of secrets. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of secrets. + * + * @param nextLink the nextLink value to set. + * @return the SecretListResult object itself. + */ + public SecretListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretListResult 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 SecretListResult. + */ + public static SecretListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretListResult deserializedSecretListResult = new SecretListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> SecretInner.fromJson(reader1)); + deserializedSecretListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSecretListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretListResult; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPatchParameters.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPatchParameters.java new file mode 100644 index 0000000000000..548e71e474d6d --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPatchParameters.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Parameters for patching a secret. + */ +@Fluent +public final class SecretPatchParameters implements JsonSerializable { + /* + * The tags that will be assigned to the secret. + */ + private Map tags; + + /* + * Properties of the secret + */ + private SecretPatchProperties properties; + + /** + * Creates an instance of SecretPatchParameters class. + */ + public SecretPatchParameters() { + } + + /** + * Get the tags property: The tags that will be assigned to the secret. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: The tags that will be assigned to the secret. + * + * @param tags the tags value to set. + * @return the SecretPatchParameters object itself. + */ + public SecretPatchParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: Properties of the secret. + * + * @return the properties value. + */ + public SecretPatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the secret. + * + * @param properties the properties value to set. + * @return the SecretPatchParameters object itself. + */ + public SecretPatchParameters withProperties(SecretPatchProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretPatchParameters 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 SecretPatchParameters. + */ + public static SecretPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretPatchParameters deserializedSecretPatchParameters = new SecretPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSecretPatchParameters.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedSecretPatchParameters.properties = SecretPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretPatchParameters; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPatchProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPatchProperties.java new file mode 100644 index 0000000000000..3e4d47ea90b6b --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPatchProperties.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the secret. + */ +@Fluent +public final class SecretPatchProperties implements JsonSerializable { + /* + * The value of the secret. + */ + private String value; + + /* + * The content type of the secret. + */ + private String contentType; + + /* + * The attributes of the secret. + */ + private SecretAttributes attributes; + + /** + * Creates an instance of SecretPatchProperties class. + */ + public SecretPatchProperties() { + } + + /** + * Get the value property: The value of the secret. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the secret. + * + * @param value the value value to set. + * @return the SecretPatchProperties object itself. + */ + public SecretPatchProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the contentType property: The content type of the secret. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The content type of the secret. + * + * @param contentType the contentType value to set. + * @return the SecretPatchProperties object itself. + */ + public SecretPatchProperties withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the attributes property: The attributes of the secret. + * + * @return the attributes value. + */ + public SecretAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: The attributes of the secret. + * + * @param attributes the attributes value to set. + * @return the SecretPatchProperties object itself. + */ + public SecretPatchProperties withAttributes(SecretAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributes() != null) { + attributes().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("contentType", this.contentType); + jsonWriter.writeJsonField("attributes", this.attributes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretPatchProperties 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 SecretPatchProperties. + */ + public static SecretPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretPatchProperties deserializedSecretPatchProperties = new SecretPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSecretPatchProperties.value = reader.getString(); + } else if ("contentType".equals(fieldName)) { + deserializedSecretPatchProperties.contentType = reader.getString(); + } else if ("attributes".equals(fieldName)) { + deserializedSecretPatchProperties.attributes = SecretAttributes.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretPatchProperties; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPermissions.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPermissions.java index a8438c96bc6c5..b756b67391ecb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPermissions.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretPermissions.java @@ -5,41 +5,60 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for SecretPermissions. */ +/** + * Defines values for SecretPermissions. + */ public final class SecretPermissions extends ExpandableStringEnum { - /** Static value all for SecretPermissions. */ + /** + * Static value all for SecretPermissions. + */ public static final SecretPermissions ALL = fromString("all"); - /** Static value get for SecretPermissions. */ + /** + * Static value get for SecretPermissions. + */ public static final SecretPermissions GET = fromString("get"); - /** Static value list for SecretPermissions. */ + /** + * Static value list for SecretPermissions. + */ public static final SecretPermissions LIST = fromString("list"); - /** Static value set for SecretPermissions. */ + /** + * Static value set for SecretPermissions. + */ public static final SecretPermissions SET = fromString("set"); - /** Static value delete for SecretPermissions. */ + /** + * Static value delete for SecretPermissions. + */ public static final SecretPermissions DELETE = fromString("delete"); - /** Static value backup for SecretPermissions. */ + /** + * Static value backup for SecretPermissions. + */ public static final SecretPermissions BACKUP = fromString("backup"); - /** Static value restore for SecretPermissions. */ + /** + * Static value restore for SecretPermissions. + */ public static final SecretPermissions RESTORE = fromString("restore"); - /** Static value recover for SecretPermissions. */ + /** + * Static value recover for SecretPermissions. + */ public static final SecretPermissions RECOVER = fromString("recover"); - /** Static value purge for SecretPermissions. */ + /** + * Static value purge for SecretPermissions. + */ public static final SecretPermissions PURGE = fromString("purge"); /** * Creates a new instance of SecretPermissions value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -48,18 +67,17 @@ public SecretPermissions() { /** * Creates or finds a SecretPermissions from its string representation. - * + * * @param name a name to look for. * @return the corresponding SecretPermissions. */ - @JsonCreator public static SecretPermissions fromString(String name) { return fromString(name, SecretPermissions.class); } /** * Gets known SecretPermissions values. - * + * * @return known SecretPermissions values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretProperties.java new file mode 100644 index 0000000000000..72f8bb5c97984 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SecretProperties.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of the secret. + */ +@Fluent +public final class SecretProperties implements JsonSerializable { + /* + * The value of the secret. NOTE: 'value' will never be returned from the service, as APIs using this model are is + * intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with + * vault secrets. + */ + private String value; + + /* + * The content type of the secret. + */ + private String contentType; + + /* + * The attributes of the secret. + */ + private SecretAttributes attributes; + + /* + * The URI to retrieve the current version of the secret. + */ + private String secretUri; + + /* + * The URI to retrieve the specific version of the secret. + */ + private String secretUriWithVersion; + + /** + * Creates an instance of SecretProperties class. + */ + public SecretProperties() { + } + + /** + * Get the value property: The value of the secret. NOTE: 'value' will never be returned from the service, as APIs + * using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST + * service for interaction with vault secrets. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The value of the secret. NOTE: 'value' will never be returned from the service, as APIs + * using this model are is intended for internal use in ARM deployments. Users should use the data-plane REST + * service for interaction with vault secrets. + * + * @param value the value value to set. + * @return the SecretProperties object itself. + */ + public SecretProperties withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the contentType property: The content type of the secret. + * + * @return the contentType value. + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType property: The content type of the secret. + * + * @param contentType the contentType value to set. + * @return the SecretProperties object itself. + */ + public SecretProperties withContentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Get the attributes property: The attributes of the secret. + * + * @return the attributes value. + */ + public SecretAttributes attributes() { + return this.attributes; + } + + /** + * Set the attributes property: The attributes of the secret. + * + * @param attributes the attributes value to set. + * @return the SecretProperties object itself. + */ + public SecretProperties withAttributes(SecretAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get the secretUri property: The URI to retrieve the current version of the secret. + * + * @return the secretUri value. + */ + public String secretUri() { + return this.secretUri; + } + + /** + * Get the secretUriWithVersion property: The URI to retrieve the specific version of the secret. + * + * @return the secretUriWithVersion value. + */ + public String secretUriWithVersion() { + return this.secretUriWithVersion; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attributes() != null) { + attributes().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("value", this.value); + jsonWriter.writeStringField("contentType", this.contentType); + jsonWriter.writeJsonField("attributes", this.attributes); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SecretProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SecretProperties 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 SecretProperties. + */ + public static SecretProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SecretProperties deserializedSecretProperties = new SecretProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + deserializedSecretProperties.value = reader.getString(); + } else if ("contentType".equals(fieldName)) { + deserializedSecretProperties.contentType = reader.getString(); + } else if ("attributes".equals(fieldName)) { + deserializedSecretProperties.attributes = SecretAttributes.fromJson(reader); + } else if ("secretUri".equals(fieldName)) { + deserializedSecretProperties.secretUri = reader.getString(); + } else if ("secretUriWithVersion".equals(fieldName)) { + deserializedSecretProperties.secretUriWithVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSecretProperties; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ServiceSpecification.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ServiceSpecification.java index 042370226a05d..119f428752ec9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ServiceSpecification.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/ServiceSpecification.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** One property of operation, include log specifications. */ +/** + * One property of operation, include log specifications. + */ @Fluent -public final class ServiceSpecification { +public final class ServiceSpecification implements JsonSerializable { /* * Log specifications of operation. */ - @JsonProperty(value = "logSpecifications") private List logSpecifications; /* * Metric specifications of operation. */ - @JsonProperty(value = "metricSpecifications") private List metricSpecifications; - /** Creates an instance of ServiceSpecification class. */ + /** + * Creates an instance of ServiceSpecification class. + */ public ServiceSpecification() { } /** * Get the logSpecifications property: Log specifications of operation. - * + * * @return the logSpecifications value. */ public List logSpecifications() { @@ -38,7 +44,7 @@ public List logSpecifications() { /** * Set the logSpecifications property: Log specifications of operation. - * + * * @param logSpecifications the logSpecifications value to set. * @return the ServiceSpecification object itself. */ @@ -49,7 +55,7 @@ public ServiceSpecification withLogSpecifications(List logSpec /** * Get the metricSpecifications property: Metric specifications of operation. - * + * * @return the metricSpecifications value. */ public List metricSpecifications() { @@ -58,7 +64,7 @@ public List metricSpecifications() { /** * Set the metricSpecifications property: Metric specifications of operation. - * + * * @param metricSpecifications the metricSpecifications value to set. * @return the ServiceSpecification object itself. */ @@ -69,7 +75,7 @@ public ServiceSpecification withMetricSpecifications(List m /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -80,4 +86,49 @@ public void validate() { metricSpecifications().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("logSpecifications", this.logSpecifications, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("metricSpecifications", this.metricSpecifications, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceSpecification 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 ServiceSpecification. + */ + public static ServiceSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceSpecification deserializedServiceSpecification = new ServiceSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logSpecifications".equals(fieldName)) { + List logSpecifications + = reader.readArray(reader1 -> LogSpecification.fromJson(reader1)); + deserializedServiceSpecification.logSpecifications = logSpecifications; + } else if ("metricSpecifications".equals(fieldName)) { + List metricSpecifications + = reader.readArray(reader1 -> MetricSpecification.fromJson(reader1)); + deserializedServiceSpecification.metricSpecifications = metricSpecifications; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceSpecification; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java index 9efb1ca53605e..1ab96fbce1c40 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Sku.java @@ -6,30 +6,36 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** SKU details. */ +/** + * SKU details. + */ @Fluent -public final class Sku { +public final class Sku implements JsonSerializable { /* * SKU family name */ - @JsonProperty(value = "family", required = true) private SkuFamily family = SkuFamily.A; /* * SKU name to specify whether the key vault is a standard vault or a premium vault. */ - @JsonProperty(value = "name", required = true) private SkuName name; - /** Creates an instance of Sku class. */ + /** + * Creates an instance of Sku class. + */ public Sku() { } /** * Get the family property: SKU family name. - * + * * @return the family value. */ public SkuFamily family() { @@ -38,7 +44,7 @@ public SkuFamily family() { /** * Set the family property: SKU family name. - * + * * @param family the family value to set. * @return the Sku object itself. */ @@ -49,7 +55,7 @@ public Sku withFamily(SkuFamily family) { /** * Get the name property: SKU name to specify whether the key vault is a standard vault or a premium vault. - * + * * @return the name value. */ public SkuName name() { @@ -58,7 +64,7 @@ public SkuName name() { /** * Set the name property: SKU name to specify whether the key vault is a standard vault or a premium vault. - * + * * @param name the name value to set. * @return the Sku object itself. */ @@ -69,19 +75,57 @@ public Sku withName(SkuName name) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (family() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property family in model Sku")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property family in model Sku")); } if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Sku")); + throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); } } private static final ClientLogger LOGGER = new ClientLogger(Sku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("family", this.family == null ? null : this.family.toString()); + jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Sku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Sku if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Sku. + */ + public static Sku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Sku deserializedSku = new Sku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("family".equals(fieldName)) { + deserializedSku.family = SkuFamily.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedSku.name = SkuName.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSku; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java index 84cd8243a7761..1624d9acc5ecf 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuFamily.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** SKU family name. */ +/** + * SKU family name. + */ public final class SkuFamily extends ExpandableStringEnum { - /** Static value A for SkuFamily. */ + /** + * Static value A for SkuFamily. + */ public static final SkuFamily A = fromString("A"); /** * Creates a new instance of SkuFamily value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,18 +27,17 @@ public SkuFamily() { /** * Creates or finds a SkuFamily from its string representation. - * + * * @param name a name to look for. * @return the corresponding SkuFamily. */ - @JsonCreator public static SkuFamily fromString(String name) { return fromString(name, SkuFamily.class); } /** * Gets known SkuFamily values. - * + * * @return known SkuFamily values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuName.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuName.java index c03ec29a18773..741acee9df1c4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuName.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/SkuName.java @@ -4,18 +4,23 @@ package com.azure.resourcemanager.keyvault.models; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** SKU name to specify whether the key vault is a standard vault or a premium vault. */ +/** + * SKU name to specify whether the key vault is a standard vault or a premium vault. + */ public enum SkuName { - /** Enum value standard. */ + /** + * Enum value standard. + */ STANDARD("standard"), - /** Enum value premium. */ + /** + * Enum value premium. + */ PREMIUM("premium"); - /** The actual serialized value for a SkuName instance. */ + /** + * The actual serialized value for a SkuName instance. + */ private final String value; SkuName(String value) { @@ -24,11 +29,10 @@ public enum SkuName { /** * Parses a serialized value to a SkuName instance. - * + * * @param value the serialized value to parse. * @return the parsed SkuName object, or null if unable to parse. */ - @JsonCreator public static SkuName fromString(String value) { if (value == null) { return null; @@ -42,8 +46,9 @@ public static SkuName fromString(String value) { return null; } - /** {@inheritDoc} */ - @JsonValue + /** + * {@inheritDoc} + */ @Override public String toString() { return this.value; diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/StoragePermissions.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/StoragePermissions.java index fd57c9e43992f..1ad202f904b11 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/StoragePermissions.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/StoragePermissions.java @@ -5,59 +5,90 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for StoragePermissions. */ +/** + * Defines values for StoragePermissions. + */ public final class StoragePermissions extends ExpandableStringEnum { - /** Static value all for StoragePermissions. */ + /** + * Static value all for StoragePermissions. + */ public static final StoragePermissions ALL = fromString("all"); - /** Static value get for StoragePermissions. */ + /** + * Static value get for StoragePermissions. + */ public static final StoragePermissions GET = fromString("get"); - /** Static value list for StoragePermissions. */ + /** + * Static value list for StoragePermissions. + */ public static final StoragePermissions LIST = fromString("list"); - /** Static value delete for StoragePermissions. */ + /** + * Static value delete for StoragePermissions. + */ public static final StoragePermissions DELETE = fromString("delete"); - /** Static value set for StoragePermissions. */ + /** + * Static value set for StoragePermissions. + */ public static final StoragePermissions SET = fromString("set"); - /** Static value update for StoragePermissions. */ + /** + * Static value update for StoragePermissions. + */ public static final StoragePermissions UPDATE = fromString("update"); - /** Static value regeneratekey for StoragePermissions. */ + /** + * Static value regeneratekey for StoragePermissions. + */ public static final StoragePermissions REGENERATEKEY = fromString("regeneratekey"); - /** Static value recover for StoragePermissions. */ + /** + * Static value recover for StoragePermissions. + */ public static final StoragePermissions RECOVER = fromString("recover"); - /** Static value purge for StoragePermissions. */ + /** + * Static value purge for StoragePermissions. + */ public static final StoragePermissions PURGE = fromString("purge"); - /** Static value backup for StoragePermissions. */ + /** + * Static value backup for StoragePermissions. + */ public static final StoragePermissions BACKUP = fromString("backup"); - /** Static value restore for StoragePermissions. */ + /** + * Static value restore for StoragePermissions. + */ public static final StoragePermissions RESTORE = fromString("restore"); - /** Static value setsas for StoragePermissions. */ + /** + * Static value setsas for StoragePermissions. + */ public static final StoragePermissions SETSAS = fromString("setsas"); - /** Static value listsas for StoragePermissions. */ + /** + * Static value listsas for StoragePermissions. + */ public static final StoragePermissions LISTSAS = fromString("listsas"); - /** Static value getsas for StoragePermissions. */ + /** + * Static value getsas for StoragePermissions. + */ public static final StoragePermissions GETSAS = fromString("getsas"); - /** Static value deletesas for StoragePermissions. */ + /** + * Static value deletesas for StoragePermissions. + */ public static final StoragePermissions DELETESAS = fromString("deletesas"); /** * Creates a new instance of StoragePermissions value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -66,18 +97,17 @@ public StoragePermissions() { /** * Creates or finds a StoragePermissions from its string representation. - * + * * @param name a name to look for. * @return the corresponding StoragePermissions. */ - @JsonCreator public static StoragePermissions fromString(String name) { return fromString(name, StoragePermissions.class); } /** * Gets known StoragePermissions values. - * + * * @return known StoragePermissions values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Trigger.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Trigger.java new file mode 100644 index 0000000000000..80f348cf19e3f --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/Trigger.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Trigger model. + */ +@Fluent +public final class Trigger implements JsonSerializable { + /* + * The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 + * duration format. Eg: 'P90D', 'P1Y'. + */ + private String timeAfterCreate; + + /* + * The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', + * 'P1Y'. + */ + private String timeBeforeExpiry; + + /** + * Creates an instance of Trigger class. + */ + public Trigger() { + } + + /** + * Get the timeAfterCreate property: The time duration after key creation to rotate the key. It only applies to + * rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @return the timeAfterCreate value. + */ + public String timeAfterCreate() { + return this.timeAfterCreate; + } + + /** + * Set the timeAfterCreate property: The time duration after key creation to rotate the key. It only applies to + * rotate. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @param timeAfterCreate the timeAfterCreate value to set. + * @return the Trigger object itself. + */ + public Trigger withTimeAfterCreate(String timeAfterCreate) { + this.timeAfterCreate = timeAfterCreate; + return this; + } + + /** + * Get the timeBeforeExpiry property: The time duration before key expiring to rotate or notify. It will be in ISO + * 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @return the timeBeforeExpiry value. + */ + public String timeBeforeExpiry() { + return this.timeBeforeExpiry; + } + + /** + * Set the timeBeforeExpiry property: The time duration before key expiring to rotate or notify. It will be in ISO + * 8601 duration format. Eg: 'P90D', 'P1Y'. + * + * @param timeBeforeExpiry the timeBeforeExpiry value to set. + * @return the Trigger object itself. + */ + public Trigger withTimeBeforeExpiry(String timeBeforeExpiry) { + this.timeBeforeExpiry = timeBeforeExpiry; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("timeAfterCreate", this.timeAfterCreate); + jsonWriter.writeStringField("timeBeforeExpiry", this.timeBeforeExpiry); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Trigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Trigger 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 Trigger. + */ + public static Trigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Trigger deserializedTrigger = new Trigger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeAfterCreate".equals(fieldName)) { + deserializedTrigger.timeAfterCreate = reader.getString(); + } else if ("timeBeforeExpiry".equals(fieldName)) { + deserializedTrigger.timeBeforeExpiry = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTrigger; + }); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/UserAssignedIdentity.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/UserAssignedIdentity.java index 5ddf561595e50..95c8cf805dd53 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/UserAssignedIdentity.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/UserAssignedIdentity.java @@ -5,31 +5,37 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.UUID; -/** User assigned identity properties. */ +/** + * User assigned identity properties. + */ @Immutable -public final class UserAssignedIdentity { +public final class UserAssignedIdentity implements JsonSerializable { /* * The principal ID of the assigned identity. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private UUID principalId; /* * The client ID of the assigned identity. */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private UUID clientId; - /** Creates an instance of UserAssignedIdentity class. */ + /** + * Creates an instance of UserAssignedIdentity class. + */ public UserAssignedIdentity() { } /** * Get the principalId property: The principal ID of the assigned identity. - * + * * @return the principalId value. */ public UUID principalId() { @@ -38,7 +44,7 @@ public UUID principalId() { /** * Get the clientId property: The client ID of the assigned identity. - * + * * @return the clientId value. */ public UUID clientId() { @@ -47,9 +53,48 @@ public UUID clientId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserAssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserAssignedIdentity if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the UserAssignedIdentity. + */ + public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserAssignedIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("clientId".equals(fieldName)) { + deserializedUserAssignedIdentity.clientId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedUserAssignedIdentity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultAccessPolicyProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultAccessPolicyProperties.java index 9295c3a2107a5..62faed14151ac 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultAccessPolicyProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultAccessPolicyProperties.java @@ -6,27 +6,34 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Properties of the vault access policy. */ +/** + * Properties of the vault access policy. + */ @Fluent -public final class VaultAccessPolicyProperties { +public final class VaultAccessPolicyProperties implements JsonSerializable { /* * An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same * tenant ID as the key vault's tenant ID. */ - @JsonProperty(value = "accessPolicies", required = true) private List accessPolicies; - /** Creates an instance of VaultAccessPolicyProperties class. */ + /** + * Creates an instance of VaultAccessPolicyProperties class. + */ public VaultAccessPolicyProperties() { } /** * Get the accessPolicies property: An array of 0 to 16 identities that have access to the key vault. All identities * in the array must use the same tenant ID as the key vault's tenant ID. - * + * * @return the accessPolicies value. */ public List accessPolicies() { @@ -36,7 +43,7 @@ public List accessPolicies() { /** * Set the accessPolicies property: An array of 0 to 16 identities that have access to the key vault. All identities * in the array must use the same tenant ID as the key vault's tenant ID. - * + * * @param accessPolicies the accessPolicies value to set. * @return the VaultAccessPolicyProperties object itself. */ @@ -47,19 +54,58 @@ public VaultAccessPolicyProperties withAccessPolicies(List ac /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (accessPolicies() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property accessPolicies in model VaultAccessPolicyProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property accessPolicies in model VaultAccessPolicyProperties")); } else { accessPolicies().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(VaultAccessPolicyProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("accessPolicies", this.accessPolicies, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultAccessPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultAccessPolicyProperties 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 VaultAccessPolicyProperties. + */ + public static VaultAccessPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultAccessPolicyProperties deserializedVaultAccessPolicyProperties = new VaultAccessPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessPolicies".equals(fieldName)) { + List accessPolicies + = reader.readArray(reader1 -> AccessPolicyEntry.fromJson(reader1)); + deserializedVaultAccessPolicyProperties.accessPolicies = accessPolicies; + } else { + reader.skipChildren(); + } + } + + return deserializedVaultAccessPolicyProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCheckNameAvailabilityParameters.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCheckNameAvailabilityParameters.java index f34353b55c563..9b0bbe319d8cf 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCheckNameAvailabilityParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCheckNameAvailabilityParameters.java @@ -6,31 +6,37 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The parameters used to check the availability of the vault name. */ +/** + * The parameters used to check the availability of the vault name. + */ @Fluent -public final class VaultCheckNameAvailabilityParameters { +public final class VaultCheckNameAvailabilityParameters + implements JsonSerializable { /* * The vault name. */ - @JsonProperty(value = "name", required = true) private String name; /* * The type of resource, Microsoft.KeyVault/vaults */ - @JsonProperty(value = "type", required = true) private String type = "Microsoft.KeyVault/vaults"; - /** Creates an instance of VaultCheckNameAvailabilityParameters class. */ + /** + * Creates an instance of VaultCheckNameAvailabilityParameters class. + */ public VaultCheckNameAvailabilityParameters() { - type = "Microsoft.KeyVault/vaults"; } /** * Get the name property: The vault name. - * + * * @return the name value. */ public String name() { @@ -39,7 +45,7 @@ public String name() { /** * Set the name property: The vault name. - * + * * @param name the name value to set. * @return the VaultCheckNameAvailabilityParameters object itself. */ @@ -50,7 +56,7 @@ public VaultCheckNameAvailabilityParameters withName(String name) { /** * Get the type property: The type of resource, Microsoft.KeyVault/vaults. - * + * * @return the type value. */ public String type() { @@ -59,7 +65,7 @@ public String type() { /** * Set the type property: The type of resource, Microsoft.KeyVault/vaults. - * + * * @param type the type value to set. * @return the VaultCheckNameAvailabilityParameters object itself. */ @@ -70,17 +76,55 @@ public VaultCheckNameAvailabilityParameters withType(String type) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property name in model VaultCheckNameAvailabilityParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model VaultCheckNameAvailabilityParameters")); } } private static final ClientLogger LOGGER = new ClientLogger(VaultCheckNameAvailabilityParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultCheckNameAvailabilityParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultCheckNameAvailabilityParameters 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 VaultCheckNameAvailabilityParameters. + */ + public static VaultCheckNameAvailabilityParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultCheckNameAvailabilityParameters deserializedVaultCheckNameAvailabilityParameters + = new VaultCheckNameAvailabilityParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedVaultCheckNameAvailabilityParameters.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultCheckNameAvailabilityParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCreateOrUpdateParameters.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCreateOrUpdateParameters.java index 94d91fe3ecbf8..0885ea537ae87 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCreateOrUpdateParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultCreateOrUpdateParameters.java @@ -6,39 +6,42 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Parameters for creating or updating a vault. */ +/** + * Parameters for creating or updating a vault. + */ @Fluent -public final class VaultCreateOrUpdateParameters { +public final class VaultCreateOrUpdateParameters implements JsonSerializable { /* * The supported Azure location where the key vault should be created. */ - @JsonProperty(value = "location", required = true) private String location; /* * The tags that will be assigned to the key vault. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * Properties of the vault */ - @JsonProperty(value = "properties", required = true) private VaultProperties properties; - /** Creates an instance of VaultCreateOrUpdateParameters class. */ + /** + * Creates an instance of VaultCreateOrUpdateParameters class. + */ public VaultCreateOrUpdateParameters() { } /** * Get the location property: The supported Azure location where the key vault should be created. - * + * * @return the location value. */ public String location() { @@ -47,7 +50,7 @@ public String location() { /** * Set the location property: The supported Azure location where the key vault should be created. - * + * * @param location the location value to set. * @return the VaultCreateOrUpdateParameters object itself. */ @@ -58,7 +61,7 @@ public VaultCreateOrUpdateParameters withLocation(String location) { /** * Get the tags property: The tags that will be assigned to the key vault. - * + * * @return the tags value. */ public Map tags() { @@ -67,7 +70,7 @@ public Map tags() { /** * Set the tags property: The tags that will be assigned to the key vault. - * + * * @param tags the tags value to set. * @return the VaultCreateOrUpdateParameters object itself. */ @@ -78,7 +81,7 @@ public VaultCreateOrUpdateParameters withTags(Map tags) { /** * Get the properties property: Properties of the vault. - * + * * @return the properties value. */ public VaultProperties properties() { @@ -87,7 +90,7 @@ public VaultProperties properties() { /** * Set the properties property: Properties of the vault. - * + * * @param properties the properties value to set. * @return the VaultCreateOrUpdateParameters object itself. */ @@ -98,25 +101,68 @@ public VaultCreateOrUpdateParameters withProperties(VaultProperties properties) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (location() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property location in model VaultCreateOrUpdateParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property location in model VaultCreateOrUpdateParameters")); } if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property properties in model VaultCreateOrUpdateParameters")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model VaultCreateOrUpdateParameters")); } else { properties().validate(); } } private static final ClientLogger LOGGER = new ClientLogger(VaultCreateOrUpdateParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultCreateOrUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultCreateOrUpdateParameters 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 VaultCreateOrUpdateParameters. + */ + public static VaultCreateOrUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultCreateOrUpdateParameters deserializedVaultCreateOrUpdateParameters + = new VaultCreateOrUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedVaultCreateOrUpdateParameters.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedVaultCreateOrUpdateParameters.properties = VaultProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVaultCreateOrUpdateParameters.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedVaultCreateOrUpdateParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultListResult.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultListResult.java index b8af04c2239fb..65d8038fabc75 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultListResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultListResult.java @@ -5,32 +5,38 @@ package com.azure.resourcemanager.keyvault.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.keyvault.fluent.models.VaultInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; -/** List of vaults. */ +/** + * List of vaults. + */ @Fluent -public final class VaultListResult { +public final class VaultListResult implements JsonSerializable { /* * The list of vaults. */ - @JsonProperty(value = "value") private List value; /* * The URL to get the next set of vaults. */ - @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of VaultListResult class. */ + /** + * Creates an instance of VaultListResult class. + */ public VaultListResult() { } /** * Get the value property: The list of vaults. - * + * * @return the value value. */ public List value() { @@ -39,7 +45,7 @@ public List value() { /** * Set the value property: The list of vaults. - * + * * @param value the value value to set. * @return the VaultListResult object itself. */ @@ -50,7 +56,7 @@ public VaultListResult withValue(List value) { /** * Get the nextLink property: The URL to get the next set of vaults. - * + * * @return the nextLink value. */ public String nextLink() { @@ -59,7 +65,7 @@ public String nextLink() { /** * Set the nextLink property: The URL to get the next set of vaults. - * + * * @param nextLink the nextLink value to set. * @return the VaultListResult object itself. */ @@ -70,7 +76,7 @@ public VaultListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -78,4 +84,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)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultListResult 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 VaultListResult. + */ + public static VaultListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultListResult deserializedVaultListResult = new VaultListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> VaultInner.fromJson(reader1)); + deserializedVaultListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedVaultListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultListResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchParameters.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchParameters.java index d301ad7d43451..b2cfce2e4e926 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchParameters.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchParameters.java @@ -5,33 +5,37 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; -/** Parameters for creating or updating a vault. */ +/** + * Parameters for creating or updating a vault. + */ @Fluent -public final class VaultPatchParameters { +public final class VaultPatchParameters implements JsonSerializable { /* * The tags that will be assigned to the key vault. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * Properties of the vault */ - @JsonProperty(value = "properties") private VaultPatchProperties properties; - /** Creates an instance of VaultPatchParameters class. */ + /** + * Creates an instance of VaultPatchParameters class. + */ public VaultPatchParameters() { } /** * Get the tags property: The tags that will be assigned to the key vault. - * + * * @return the tags value. */ public Map tags() { @@ -40,7 +44,7 @@ public Map tags() { /** * Set the tags property: The tags that will be assigned to the key vault. - * + * * @param tags the tags value to set. * @return the VaultPatchParameters object itself. */ @@ -51,7 +55,7 @@ public VaultPatchParameters withTags(Map tags) { /** * Get the properties property: Properties of the vault. - * + * * @return the properties value. */ public VaultPatchProperties properties() { @@ -60,7 +64,7 @@ public VaultPatchProperties properties() { /** * Set the properties property: Properties of the vault. - * + * * @param properties the properties value to set. * @return the VaultPatchParameters object itself. */ @@ -71,7 +75,7 @@ public VaultPatchParameters withProperties(VaultPatchProperties properties) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -79,4 +83,44 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultPatchParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultPatchParameters 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 VaultPatchParameters. + */ + public static VaultPatchParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultPatchParameters deserializedVaultPatchParameters = new VaultPatchParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedVaultPatchParameters.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedVaultPatchParameters.properties = VaultPatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultPatchParameters; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchProperties.java index 81fe45aea77db..4241a89d6b021 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultPatchProperties.java @@ -5,57 +5,57 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.UUID; -/** Properties of the vault. */ +/** + * Properties of the vault. + */ @Fluent -public final class VaultPatchProperties { +public final class VaultPatchProperties implements JsonSerializable { /* * The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. */ - @JsonProperty(value = "tenantId") private UUID tenantId; /* * SKU details */ - @JsonProperty(value = "sku") private Sku sku; /* * An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same * tenant ID as the key vault's tenant ID. */ - @JsonProperty(value = "accessPolicies") private List accessPolicies; /* * Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from * the key vault. */ - @JsonProperty(value = "enabledForDeployment") private Boolean enabledForDeployment; /* * Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap * keys. */ - @JsonProperty(value = "enabledForDiskEncryption") private Boolean enabledForDiskEncryption; /* * Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. */ - @JsonProperty(value = "enabledForTemplateDeployment") private Boolean enabledForTemplateDeployment; /* * Property to specify whether the 'soft delete' functionality is enabled for this key vault. Once set to true, it * cannot be reverted to false. */ - @JsonProperty(value = "enableSoftDelete") private Boolean enableSoftDelete; /* @@ -65,19 +65,16 @@ public final class VaultPatchProperties { * stored on Azure Resource Manager will be ignored. If null or not specified, the value of this property will not * change. */ - @JsonProperty(value = "enableRbacAuthorization") private Boolean enableRbacAuthorization; /* * softDelete data retention days. It accepts >=7 and <=90. */ - @JsonProperty(value = "softDeleteRetentionInDays") private Integer softDeleteRetentionInDays; /* * The vault's create mode to indicate whether the vault need to be recovered or not. */ - @JsonProperty(value = "createMode") private CreateMode createMode; /* @@ -86,32 +83,30 @@ public final class VaultPatchProperties { * hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling this * functionality is irreversible - that is, the property does not accept false as its value. */ - @JsonProperty(value = "enablePurgeProtection") private Boolean enablePurgeProtection; /* * A collection of rules governing the accessibility of the vault from specific network locations. */ - @JsonProperty(value = "networkAcls") private NetworkRuleSet networkAcls; /* * Property to specify whether the vault will accept traffic from public internet. If set to 'disabled' all traffic * except private endpoint traffic and that that originates from trusted services will be blocked. This will - * override the set firewall rules, meaning that even if the firewall rules are present we will not honor the - * rules. + * override the set firewall rules, meaning that even if the firewall rules are present we will not honor the rules. */ - @JsonProperty(value = "publicNetworkAccess") private String publicNetworkAccess; - /** Creates an instance of VaultPatchProperties class. */ + /** + * Creates an instance of VaultPatchProperties class. + */ public VaultPatchProperties() { } /** * Get the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests * to the key vault. - * + * * @return the tenantId value. */ public UUID tenantId() { @@ -121,7 +116,7 @@ public UUID tenantId() { /** * Set the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests * to the key vault. - * + * * @param tenantId the tenantId value to set. * @return the VaultPatchProperties object itself. */ @@ -132,7 +127,7 @@ public VaultPatchProperties withTenantId(UUID tenantId) { /** * Get the sku property: SKU details. - * + * * @return the sku value. */ public Sku sku() { @@ -141,7 +136,7 @@ public Sku sku() { /** * Set the sku property: SKU details. - * + * * @param sku the sku value to set. * @return the VaultPatchProperties object itself. */ @@ -153,7 +148,7 @@ public VaultPatchProperties withSku(Sku sku) { /** * Get the accessPolicies property: An array of 0 to 16 identities that have access to the key vault. All identities * in the array must use the same tenant ID as the key vault's tenant ID. - * + * * @return the accessPolicies value. */ public List accessPolicies() { @@ -163,7 +158,7 @@ public List accessPolicies() { /** * Set the accessPolicies property: An array of 0 to 16 identities that have access to the key vault. All identities * in the array must use the same tenant ID as the key vault's tenant ID. - * + * * @param accessPolicies the accessPolicies value to set. * @return the VaultPatchProperties object itself. */ @@ -175,7 +170,7 @@ public VaultPatchProperties withAccessPolicies(List accessPol /** * Get the enabledForDeployment property: Property to specify whether Azure Virtual Machines are permitted to * retrieve certificates stored as secrets from the key vault. - * + * * @return the enabledForDeployment value. */ public Boolean enabledForDeployment() { @@ -185,7 +180,7 @@ public Boolean enabledForDeployment() { /** * Set the enabledForDeployment property: Property to specify whether Azure Virtual Machines are permitted to * retrieve certificates stored as secrets from the key vault. - * + * * @param enabledForDeployment the enabledForDeployment value to set. * @return the VaultPatchProperties object itself. */ @@ -197,7 +192,7 @@ public VaultPatchProperties withEnabledForDeployment(Boolean enabledForDeploymen /** * Get the enabledForDiskEncryption property: Property to specify whether Azure Disk Encryption is permitted to * retrieve secrets from the vault and unwrap keys. - * + * * @return the enabledForDiskEncryption value. */ public Boolean enabledForDiskEncryption() { @@ -207,7 +202,7 @@ public Boolean enabledForDiskEncryption() { /** * Set the enabledForDiskEncryption property: Property to specify whether Azure Disk Encryption is permitted to * retrieve secrets from the vault and unwrap keys. - * + * * @param enabledForDiskEncryption the enabledForDiskEncryption value to set. * @return the VaultPatchProperties object itself. */ @@ -219,7 +214,7 @@ public VaultPatchProperties withEnabledForDiskEncryption(Boolean enabledForDiskE /** * Get the enabledForTemplateDeployment property: Property to specify whether Azure Resource Manager is permitted to * retrieve secrets from the key vault. - * + * * @return the enabledForTemplateDeployment value. */ public Boolean enabledForTemplateDeployment() { @@ -229,7 +224,7 @@ public Boolean enabledForTemplateDeployment() { /** * Set the enabledForTemplateDeployment property: Property to specify whether Azure Resource Manager is permitted to * retrieve secrets from the key vault. - * + * * @param enabledForTemplateDeployment the enabledForTemplateDeployment value to set. * @return the VaultPatchProperties object itself. */ @@ -241,7 +236,7 @@ public VaultPatchProperties withEnabledForTemplateDeployment(Boolean enabledForT /** * Get the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for * this key vault. Once set to true, it cannot be reverted to false. - * + * * @return the enableSoftDelete value. */ public Boolean enableSoftDelete() { @@ -251,7 +246,7 @@ public Boolean enableSoftDelete() { /** * Set the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for * this key vault. Once set to true, it cannot be reverted to false. - * + * * @param enableSoftDelete the enableSoftDelete value to set. * @return the VaultPatchProperties object itself. */ @@ -266,7 +261,7 @@ public VaultPatchProperties withEnableSoftDelete(Boolean enableSoftDelete) { * specified in vault properties will be ignored. When false, the key vault will use the access policies specified * in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, * the value of this property will not change. - * + * * @return the enableRbacAuthorization value. */ public Boolean enableRbacAuthorization() { @@ -279,7 +274,7 @@ public Boolean enableRbacAuthorization() { * specified in vault properties will be ignored. When false, the key vault will use the access policies specified * in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, * the value of this property will not change. - * + * * @param enableRbacAuthorization the enableRbacAuthorization value to set. * @return the VaultPatchProperties object itself. */ @@ -290,7 +285,7 @@ public VaultPatchProperties withEnableRbacAuthorization(Boolean enableRbacAuthor /** * Get the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. - * + * * @return the softDeleteRetentionInDays value. */ public Integer softDeleteRetentionInDays() { @@ -299,7 +294,7 @@ public Integer softDeleteRetentionInDays() { /** * Set the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. - * + * * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. * @return the VaultPatchProperties object itself. */ @@ -310,7 +305,7 @@ public VaultPatchProperties withSoftDeleteRetentionInDays(Integer softDeleteRete /** * Get the createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. - * + * * @return the createMode value. */ public CreateMode createMode() { @@ -319,7 +314,7 @@ public CreateMode createMode() { /** * Set the createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. - * + * * @param createMode the createMode value to set. * @return the VaultPatchProperties object itself. */ @@ -334,7 +329,7 @@ public VaultPatchProperties withCreateMode(CreateMode createMode) { * Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is * also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its * value. - * + * * @return the enablePurgeProtection value. */ public Boolean enablePurgeProtection() { @@ -347,7 +342,7 @@ public Boolean enablePurgeProtection() { * Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is * also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its * value. - * + * * @param enablePurgeProtection the enablePurgeProtection value to set. * @return the VaultPatchProperties object itself. */ @@ -359,7 +354,7 @@ public VaultPatchProperties withEnablePurgeProtection(Boolean enablePurgeProtect /** * Get the networkAcls property: A collection of rules governing the accessibility of the vault from specific * network locations. - * + * * @return the networkAcls value. */ public NetworkRuleSet networkAcls() { @@ -369,7 +364,7 @@ public NetworkRuleSet networkAcls() { /** * Set the networkAcls property: A collection of rules governing the accessibility of the vault from specific * network locations. - * + * * @param networkAcls the networkAcls value to set. * @return the VaultPatchProperties object itself. */ @@ -383,7 +378,7 @@ public VaultPatchProperties withNetworkAcls(NetworkRuleSet networkAcls) { * internet. If set to 'disabled' all traffic except private endpoint traffic and that that originates from trusted * services will be blocked. This will override the set firewall rules, meaning that even if the firewall rules are * present we will not honor the rules. - * + * * @return the publicNetworkAccess value. */ public String publicNetworkAccess() { @@ -395,7 +390,7 @@ public String publicNetworkAccess() { * internet. If set to 'disabled' all traffic except private endpoint traffic and that that originates from trusted * services will be blocked. This will override the set firewall rules, meaning that even if the firewall rules are * present we will not honor the rules. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the VaultPatchProperties object itself. */ @@ -406,7 +401,7 @@ public VaultPatchProperties withPublicNetworkAccess(String publicNetworkAccess) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -420,4 +415,83 @@ public void validate() { networkAcls().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", Objects.toString(this.tenantId, null)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeArrayField("accessPolicies", this.accessPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("enabledForDeployment", this.enabledForDeployment); + jsonWriter.writeBooleanField("enabledForDiskEncryption", this.enabledForDiskEncryption); + jsonWriter.writeBooleanField("enabledForTemplateDeployment", this.enabledForTemplateDeployment); + jsonWriter.writeBooleanField("enableSoftDelete", this.enableSoftDelete); + jsonWriter.writeBooleanField("enableRbacAuthorization", this.enableRbacAuthorization); + jsonWriter.writeNumberField("softDeleteRetentionInDays", this.softDeleteRetentionInDays); + jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeBooleanField("enablePurgeProtection", this.enablePurgeProtection); + jsonWriter.writeJsonField("networkAcls", this.networkAcls); + jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultPatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultPatchProperties 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 VaultPatchProperties. + */ + public static VaultPatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultPatchProperties deserializedVaultPatchProperties = new VaultPatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedVaultPatchProperties.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("sku".equals(fieldName)) { + deserializedVaultPatchProperties.sku = Sku.fromJson(reader); + } else if ("accessPolicies".equals(fieldName)) { + List accessPolicies + = reader.readArray(reader1 -> AccessPolicyEntry.fromJson(reader1)); + deserializedVaultPatchProperties.accessPolicies = accessPolicies; + } else if ("enabledForDeployment".equals(fieldName)) { + deserializedVaultPatchProperties.enabledForDeployment = reader.getNullable(JsonReader::getBoolean); + } else if ("enabledForDiskEncryption".equals(fieldName)) { + deserializedVaultPatchProperties.enabledForDiskEncryption + = reader.getNullable(JsonReader::getBoolean); + } else if ("enabledForTemplateDeployment".equals(fieldName)) { + deserializedVaultPatchProperties.enabledForTemplateDeployment + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableSoftDelete".equals(fieldName)) { + deserializedVaultPatchProperties.enableSoftDelete = reader.getNullable(JsonReader::getBoolean); + } else if ("enableRbacAuthorization".equals(fieldName)) { + deserializedVaultPatchProperties.enableRbacAuthorization + = reader.getNullable(JsonReader::getBoolean); + } else if ("softDeleteRetentionInDays".equals(fieldName)) { + deserializedVaultPatchProperties.softDeleteRetentionInDays = reader.getNullable(JsonReader::getInt); + } else if ("createMode".equals(fieldName)) { + deserializedVaultPatchProperties.createMode = CreateMode.fromString(reader.getString()); + } else if ("enablePurgeProtection".equals(fieldName)) { + deserializedVaultPatchProperties.enablePurgeProtection = reader.getNullable(JsonReader::getBoolean); + } else if ("networkAcls".equals(fieldName)) { + deserializedVaultPatchProperties.networkAcls = NetworkRuleSet.fromJson(reader); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedVaultPatchProperties.publicNetworkAccess = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultPatchProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProperties.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProperties.java index 18b29462d0190..fe4d97f5d21e0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProperties.java @@ -6,93 +6,88 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.UUID; -/** Properties of the vault. */ +/** + * Properties of the vault. + */ @Fluent -public final class VaultProperties { +public final class VaultProperties implements JsonSerializable { /* * The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault. */ - @JsonProperty(value = "tenantId", required = true) private UUID tenantId; /* * SKU details */ - @JsonProperty(value = "sku", required = true) private Sku sku; /* - * An array of 0 to 1024 identities that have access to the key vault. All identities in the array must use the - * same tenant ID as the key vault's tenant ID. When `createMode` is set to `recover`, access policies are not - * required. Otherwise, access policies are required. + * An array of 0 to 1024 identities that have access to the key vault. All identities in the array must use the same + * tenant ID as the key vault's tenant ID. When `createMode` is set to `recover`, access policies are not required. + * Otherwise, access policies are required. */ - @JsonProperty(value = "accessPolicies") private List accessPolicies; /* * The URI of the vault for performing operations on keys and secrets. */ - @JsonProperty(value = "vaultUri") private String vaultUri; /* * The resource id of HSM Pool. */ - @JsonProperty(value = "hsmPoolResourceId", access = JsonProperty.Access.WRITE_ONLY) private String hsmPoolResourceId; /* * Property to specify whether Azure Virtual Machines are permitted to retrieve certificates stored as secrets from * the key vault. */ - @JsonProperty(value = "enabledForDeployment") private Boolean enabledForDeployment; /* * Property to specify whether Azure Disk Encryption is permitted to retrieve secrets from the vault and unwrap * keys. */ - @JsonProperty(value = "enabledForDiskEncryption") private Boolean enabledForDiskEncryption; /* * Property to specify whether Azure Resource Manager is permitted to retrieve secrets from the key vault. */ - @JsonProperty(value = "enabledForTemplateDeployment") private Boolean enabledForTemplateDeployment; /* - * Property to specify whether the 'soft delete' functionality is enabled for this key vault. If it's not set to - * any value(true or false) when creating new key vault, it will be set to true by default. Once set to true, it - * cannot be reverted to false. + * Property to specify whether the 'soft delete' functionality is enabled for this key vault. If it's not set to any + * value(true or false) when creating new key vault, it will be set to true by default. Once set to true, it cannot + * be reverted to false. */ - @JsonProperty(value = "enableSoftDelete") private Boolean enableSoftDelete; /* * softDelete data retention days. It accepts >=7 and <=90. */ - @JsonProperty(value = "softDeleteRetentionInDays") private Integer softDeleteRetentionInDays; /* * Property that controls how data actions are authorized. When true, the key vault will use Role Based Access * Control (RBAC) for authorization of data actions, and the access policies specified in vault properties will be * ignored. When false, the key vault will use the access policies specified in vault properties, and any policy - * stored on Azure Resource Manager will be ignored. If null or not specified, the vault is created with the - * default value of false. Note that management actions are always authorized with RBAC. + * stored on Azure Resource Manager will be ignored. If null or not specified, the vault is created with the default + * value of false. Note that management actions are always authorized with RBAC. */ - @JsonProperty(value = "enableRbacAuthorization") private Boolean enableRbacAuthorization; /* * The vault's create mode to indicate whether the vault need to be recovered or not. */ - @JsonProperty(value = "createMode") private CreateMode createMode; /* @@ -101,44 +96,40 @@ public final class VaultProperties { * hard, irrecoverable deletion. The setting is effective only if soft delete is also enabled. Enabling this * functionality is irreversible - that is, the property does not accept false as its value. */ - @JsonProperty(value = "enablePurgeProtection") private Boolean enablePurgeProtection; /* * Rules governing the accessibility of the key vault from specific network locations. */ - @JsonProperty(value = "networkAcls") private NetworkRuleSet networkAcls; /* * Provisioning state of the vault. */ - @JsonProperty(value = "provisioningState") private VaultProvisioningState provisioningState; /* * List of private endpoint connections associated with the key vault. */ - @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) private List privateEndpointConnections; /* * Property to specify whether the vault will accept traffic from public internet. If set to 'disabled' all traffic * except private endpoint traffic and that that originates from trusted services will be blocked. This will - * override the set firewall rules, meaning that even if the firewall rules are present we will not honor the - * rules. + * override the set firewall rules, meaning that even if the firewall rules are present we will not honor the rules. */ - @JsonProperty(value = "publicNetworkAccess") private String publicNetworkAccess; - /** Creates an instance of VaultProperties class. */ + /** + * Creates an instance of VaultProperties class. + */ public VaultProperties() { } /** * Get the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests * to the key vault. - * + * * @return the tenantId value. */ public UUID tenantId() { @@ -148,7 +139,7 @@ public UUID tenantId() { /** * Set the tenantId property: The Azure Active Directory tenant ID that should be used for authenticating requests * to the key vault. - * + * * @param tenantId the tenantId value to set. * @return the VaultProperties object itself. */ @@ -159,7 +150,7 @@ public VaultProperties withTenantId(UUID tenantId) { /** * Get the sku property: SKU details. - * + * * @return the sku value. */ public Sku sku() { @@ -168,7 +159,7 @@ public Sku sku() { /** * Set the sku property: SKU details. - * + * * @param sku the sku value to set. * @return the VaultProperties object itself. */ @@ -181,7 +172,7 @@ public VaultProperties withSku(Sku sku) { * Get the accessPolicies property: An array of 0 to 1024 identities that have access to the key vault. All * identities in the array must use the same tenant ID as the key vault's tenant ID. When `createMode` is set to * `recover`, access policies are not required. Otherwise, access policies are required. - * + * * @return the accessPolicies value. */ public List accessPolicies() { @@ -192,7 +183,7 @@ public List accessPolicies() { * Set the accessPolicies property: An array of 0 to 1024 identities that have access to the key vault. All * identities in the array must use the same tenant ID as the key vault's tenant ID. When `createMode` is set to * `recover`, access policies are not required. Otherwise, access policies are required. - * + * * @param accessPolicies the accessPolicies value to set. * @return the VaultProperties object itself. */ @@ -203,7 +194,7 @@ public VaultProperties withAccessPolicies(List accessPolicies /** * Get the vaultUri property: The URI of the vault for performing operations on keys and secrets. - * + * * @return the vaultUri value. */ public String vaultUri() { @@ -212,7 +203,7 @@ public String vaultUri() { /** * Set the vaultUri property: The URI of the vault for performing operations on keys and secrets. - * + * * @param vaultUri the vaultUri value to set. * @return the VaultProperties object itself. */ @@ -223,7 +214,7 @@ public VaultProperties withVaultUri(String vaultUri) { /** * Get the hsmPoolResourceId property: The resource id of HSM Pool. - * + * * @return the hsmPoolResourceId value. */ public String hsmPoolResourceId() { @@ -233,7 +224,7 @@ public String hsmPoolResourceId() { /** * Get the enabledForDeployment property: Property to specify whether Azure Virtual Machines are permitted to * retrieve certificates stored as secrets from the key vault. - * + * * @return the enabledForDeployment value. */ public Boolean enabledForDeployment() { @@ -243,7 +234,7 @@ public Boolean enabledForDeployment() { /** * Set the enabledForDeployment property: Property to specify whether Azure Virtual Machines are permitted to * retrieve certificates stored as secrets from the key vault. - * + * * @param enabledForDeployment the enabledForDeployment value to set. * @return the VaultProperties object itself. */ @@ -255,7 +246,7 @@ public VaultProperties withEnabledForDeployment(Boolean enabledForDeployment) { /** * Get the enabledForDiskEncryption property: Property to specify whether Azure Disk Encryption is permitted to * retrieve secrets from the vault and unwrap keys. - * + * * @return the enabledForDiskEncryption value. */ public Boolean enabledForDiskEncryption() { @@ -265,7 +256,7 @@ public Boolean enabledForDiskEncryption() { /** * Set the enabledForDiskEncryption property: Property to specify whether Azure Disk Encryption is permitted to * retrieve secrets from the vault and unwrap keys. - * + * * @param enabledForDiskEncryption the enabledForDiskEncryption value to set. * @return the VaultProperties object itself. */ @@ -277,7 +268,7 @@ public VaultProperties withEnabledForDiskEncryption(Boolean enabledForDiskEncryp /** * Get the enabledForTemplateDeployment property: Property to specify whether Azure Resource Manager is permitted to * retrieve secrets from the key vault. - * + * * @return the enabledForTemplateDeployment value. */ public Boolean enabledForTemplateDeployment() { @@ -287,7 +278,7 @@ public Boolean enabledForTemplateDeployment() { /** * Set the enabledForTemplateDeployment property: Property to specify whether Azure Resource Manager is permitted to * retrieve secrets from the key vault. - * + * * @param enabledForTemplateDeployment the enabledForTemplateDeployment value to set. * @return the VaultProperties object itself. */ @@ -300,7 +291,7 @@ public VaultProperties withEnabledForTemplateDeployment(Boolean enabledForTempla * Get the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for * this key vault. If it's not set to any value(true or false) when creating new key vault, it will be set to true * by default. Once set to true, it cannot be reverted to false. - * + * * @return the enableSoftDelete value. */ public Boolean enableSoftDelete() { @@ -311,7 +302,7 @@ public Boolean enableSoftDelete() { * Set the enableSoftDelete property: Property to specify whether the 'soft delete' functionality is enabled for * this key vault. If it's not set to any value(true or false) when creating new key vault, it will be set to true * by default. Once set to true, it cannot be reverted to false. - * + * * @param enableSoftDelete the enableSoftDelete value to set. * @return the VaultProperties object itself. */ @@ -322,7 +313,7 @@ public VaultProperties withEnableSoftDelete(Boolean enableSoftDelete) { /** * Get the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. - * + * * @return the softDeleteRetentionInDays value. */ public Integer softDeleteRetentionInDays() { @@ -331,7 +322,7 @@ public Integer softDeleteRetentionInDays() { /** * Set the softDeleteRetentionInDays property: softDelete data retention days. It accepts >=7 and <=90. - * + * * @param softDeleteRetentionInDays the softDeleteRetentionInDays value to set. * @return the VaultProperties object itself. */ @@ -347,7 +338,7 @@ public VaultProperties withSoftDeleteRetentionInDays(Integer softDeleteRetention * in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, * the vault is created with the default value of false. Note that management actions are always authorized with * RBAC. - * + * * @return the enableRbacAuthorization value. */ public Boolean enableRbacAuthorization() { @@ -361,7 +352,7 @@ public Boolean enableRbacAuthorization() { * in vault properties, and any policy stored on Azure Resource Manager will be ignored. If null or not specified, * the vault is created with the default value of false. Note that management actions are always authorized with * RBAC. - * + * * @param enableRbacAuthorization the enableRbacAuthorization value to set. * @return the VaultProperties object itself. */ @@ -372,7 +363,7 @@ public VaultProperties withEnableRbacAuthorization(Boolean enableRbacAuthorizati /** * Get the createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. - * + * * @return the createMode value. */ public CreateMode createMode() { @@ -381,7 +372,7 @@ public CreateMode createMode() { /** * Set the createMode property: The vault's create mode to indicate whether the vault need to be recovered or not. - * + * * @param createMode the createMode value to set. * @return the VaultProperties object itself. */ @@ -396,7 +387,7 @@ public VaultProperties withCreateMode(CreateMode createMode) { * Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is * also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its * value. - * + * * @return the enablePurgeProtection value. */ public Boolean enablePurgeProtection() { @@ -409,7 +400,7 @@ public Boolean enablePurgeProtection() { * Key Vault service may initiate a hard, irrecoverable deletion. The setting is effective only if soft delete is * also enabled. Enabling this functionality is irreversible - that is, the property does not accept false as its * value. - * + * * @param enablePurgeProtection the enablePurgeProtection value to set. * @return the VaultProperties object itself. */ @@ -420,7 +411,7 @@ public VaultProperties withEnablePurgeProtection(Boolean enablePurgeProtection) /** * Get the networkAcls property: Rules governing the accessibility of the key vault from specific network locations. - * + * * @return the networkAcls value. */ public NetworkRuleSet networkAcls() { @@ -429,7 +420,7 @@ public NetworkRuleSet networkAcls() { /** * Set the networkAcls property: Rules governing the accessibility of the key vault from specific network locations. - * + * * @param networkAcls the networkAcls value to set. * @return the VaultProperties object itself. */ @@ -440,7 +431,7 @@ public VaultProperties withNetworkAcls(NetworkRuleSet networkAcls) { /** * Get the provisioningState property: Provisioning state of the vault. - * + * * @return the provisioningState value. */ public VaultProvisioningState provisioningState() { @@ -449,7 +440,7 @@ public VaultProvisioningState provisioningState() { /** * Set the provisioningState property: Provisioning state of the vault. - * + * * @param provisioningState the provisioningState value to set. * @return the VaultProperties object itself. */ @@ -460,7 +451,7 @@ public VaultProperties withProvisioningState(VaultProvisioningState provisioning /** * Get the privateEndpointConnections property: List of private endpoint connections associated with the key vault. - * + * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { @@ -472,7 +463,7 @@ public List privateEndpointConnections() { * internet. If set to 'disabled' all traffic except private endpoint traffic and that that originates from trusted * services will be blocked. This will override the set firewall rules, meaning that even if the firewall rules are * present we will not honor the rules. - * + * * @return the publicNetworkAccess value. */ public String publicNetworkAccess() { @@ -484,7 +475,7 @@ public String publicNetworkAccess() { * internet. If set to 'disabled' all traffic except private endpoint traffic and that that originates from trusted * services will be blocked. This will override the set firewall rules, meaning that even if the firewall rules are * present we will not honor the rules. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the VaultProperties object itself. */ @@ -495,19 +486,17 @@ public VaultProperties withPublicNetworkAccess(String publicNetworkAccess) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (tenantId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property tenantId in model VaultProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property tenantId in model VaultProperties")); } if (sku() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property sku in model VaultProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property sku in model VaultProperties")); } else { sku().validate(); } @@ -523,4 +512,96 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(VaultProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("tenantId", Objects.toString(this.tenantId, null)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeArrayField("accessPolicies", this.accessPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("vaultUri", this.vaultUri); + jsonWriter.writeBooleanField("enabledForDeployment", this.enabledForDeployment); + jsonWriter.writeBooleanField("enabledForDiskEncryption", this.enabledForDiskEncryption); + jsonWriter.writeBooleanField("enabledForTemplateDeployment", this.enabledForTemplateDeployment); + jsonWriter.writeBooleanField("enableSoftDelete", this.enableSoftDelete); + jsonWriter.writeNumberField("softDeleteRetentionInDays", this.softDeleteRetentionInDays); + jsonWriter.writeBooleanField("enableRbacAuthorization", this.enableRbacAuthorization); + jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeBooleanField("enablePurgeProtection", this.enablePurgeProtection); + jsonWriter.writeJsonField("networkAcls", this.networkAcls); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + jsonWriter.writeStringField("publicNetworkAccess", this.publicNetworkAccess); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the VaultProperties. + */ + public static VaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultProperties deserializedVaultProperties = new VaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedVaultProperties.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("sku".equals(fieldName)) { + deserializedVaultProperties.sku = Sku.fromJson(reader); + } else if ("accessPolicies".equals(fieldName)) { + List accessPolicies + = reader.readArray(reader1 -> AccessPolicyEntry.fromJson(reader1)); + deserializedVaultProperties.accessPolicies = accessPolicies; + } else if ("vaultUri".equals(fieldName)) { + deserializedVaultProperties.vaultUri = reader.getString(); + } else if ("hsmPoolResourceId".equals(fieldName)) { + deserializedVaultProperties.hsmPoolResourceId = reader.getString(); + } else if ("enabledForDeployment".equals(fieldName)) { + deserializedVaultProperties.enabledForDeployment = reader.getNullable(JsonReader::getBoolean); + } else if ("enabledForDiskEncryption".equals(fieldName)) { + deserializedVaultProperties.enabledForDiskEncryption = reader.getNullable(JsonReader::getBoolean); + } else if ("enabledForTemplateDeployment".equals(fieldName)) { + deserializedVaultProperties.enabledForTemplateDeployment + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableSoftDelete".equals(fieldName)) { + deserializedVaultProperties.enableSoftDelete = reader.getNullable(JsonReader::getBoolean); + } else if ("softDeleteRetentionInDays".equals(fieldName)) { + deserializedVaultProperties.softDeleteRetentionInDays = reader.getNullable(JsonReader::getInt); + } else if ("enableRbacAuthorization".equals(fieldName)) { + deserializedVaultProperties.enableRbacAuthorization = reader.getNullable(JsonReader::getBoolean); + } else if ("createMode".equals(fieldName)) { + deserializedVaultProperties.createMode = CreateMode.fromString(reader.getString()); + } else if ("enablePurgeProtection".equals(fieldName)) { + deserializedVaultProperties.enablePurgeProtection = reader.getNullable(JsonReader::getBoolean); + } else if ("networkAcls".equals(fieldName)) { + deserializedVaultProperties.networkAcls = NetworkRuleSet.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedVaultProperties.provisioningState + = VaultProvisioningState.fromString(reader.getString()); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionItem.fromJson(reader1)); + deserializedVaultProperties.privateEndpointConnections = privateEndpointConnections; + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedVaultProperties.publicNetworkAccess = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProvisioningState.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProvisioningState.java index 73127c4a2ee31..8cdf47da42660 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProvisioningState.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VaultProvisioningState.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.keyvault.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Provisioning state of the vault. */ +/** + * Provisioning state of the vault. + */ public final class VaultProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for VaultProvisioningState. */ + /** + * Static value Succeeded for VaultProvisioningState. + */ public static final VaultProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value RegisteringDns for VaultProvisioningState. */ + /** + * Static value RegisteringDns for VaultProvisioningState. + */ public static final VaultProvisioningState REGISTERING_DNS = fromString("RegisteringDns"); /** * Creates a new instance of VaultProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public VaultProvisioningState() { /** * Creates or finds a VaultProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding VaultProvisioningState. */ - @JsonCreator public static VaultProvisioningState fromString(String name) { return fromString(name, VaultProvisioningState.class); } /** * Gets known VaultProvisioningState values. - * + * * @return known VaultProvisioningState values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VirtualNetworkRule.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VirtualNetworkRule.java index c89ae8b6f7c3f..d25502ea6a726 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VirtualNetworkRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/VirtualNetworkRule.java @@ -6,32 +6,38 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** A rule governing the accessibility of a vault from a specific virtual network. */ +/** + * A rule governing the accessibility of a vault from a specific virtual network. + */ @Fluent -public final class VirtualNetworkRule { +public final class VirtualNetworkRule implements JsonSerializable { /* * Full resource id of a vnet subnet, such as * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. */ - @JsonProperty(value = "id", required = true) private String id; /* * Property to specify whether NRP will ignore the check if parent subnet has serviceEndpoints configured. */ - @JsonProperty(value = "ignoreMissingVnetServiceEndpoint") private Boolean ignoreMissingVnetServiceEndpoint; - /** Creates an instance of VirtualNetworkRule class. */ + /** + * Creates an instance of VirtualNetworkRule class. + */ public VirtualNetworkRule() { } /** * Get the id property: Full resource id of a vnet subnet, such as * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - * + * * @return the id value. */ public String id() { @@ -41,7 +47,7 @@ public String id() { /** * Set the id property: Full resource id of a vnet subnet, such as * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - * + * * @param id the id value to set. * @return the VirtualNetworkRule object itself. */ @@ -53,7 +59,7 @@ public VirtualNetworkRule withId(String id) { /** * Get the ignoreMissingVnetServiceEndpoint property: Property to specify whether NRP will ignore the check if * parent subnet has serviceEndpoints configured. - * + * * @return the ignoreMissingVnetServiceEndpoint value. */ public Boolean ignoreMissingVnetServiceEndpoint() { @@ -63,7 +69,7 @@ public Boolean ignoreMissingVnetServiceEndpoint() { /** * Set the ignoreMissingVnetServiceEndpoint property: Property to specify whether NRP will ignore the check if * parent subnet has serviceEndpoints configured. - * + * * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set. * @return the VirtualNetworkRule object itself. */ @@ -74,16 +80,56 @@ public VirtualNetworkRule withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMis /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (id() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model VirtualNetworkRule")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model VirtualNetworkRule")); } } private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeBooleanField("ignoreMissingVnetServiceEndpoint", this.ignoreMissingVnetServiceEndpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VirtualNetworkRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VirtualNetworkRule 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 VirtualNetworkRule. + */ + public static VirtualNetworkRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VirtualNetworkRule deserializedVirtualNetworkRule = new VirtualNetworkRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedVirtualNetworkRule.id = reader.getString(); + } else if ("ignoreMissingVnetServiceEndpoint".equals(fieldName)) { + deserializedVirtualNetworkRule.ignoreMissingVnetServiceEndpoint + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedVirtualNetworkRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/package-info.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/package-info.java index 0358489a1fb81..fb6f073e7eee7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/package-info.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for KeyVaultManagementClient. The Azure management API provides a RESTful set of - * web services that interact with Azure Key Vault. + * Package containing the data models for KeyVaultManagementClient. + * The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. */ package com.azure.resourcemanager.keyvault.models; diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/package-info.java b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/package-info.java index c94865ad6dc8c..b44f0fb830f02 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/package-info.java +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/java/com/azure/resourcemanager/keyvault/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for KeyVaultManagementClient. The Azure management API provides a RESTful set of web - * services that interact with Azure Key Vault. + * Package containing the classes for KeyVaultManagementClient. + * The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. */ package com.azure.resourcemanager.keyvault; diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-keyvault/proxy-config.json b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-keyvault/proxy-config.json index 0b6caf451ffff..b11e402ca59d8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-keyvault/proxy-config.json +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-keyvault/proxy-config.json @@ -1 +1 @@ -[ [ "com.azure.resourcemanager.keyvault.implementation.VaultsClientImpl$VaultsService" ], [ "com.azure.resourcemanager.keyvault.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService" ], [ "com.azure.resourcemanager.keyvault.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService" ], [ "com.azure.resourcemanager.keyvault.implementation.ManagedHsmsClientImpl$ManagedHsmsService" ], [ "com.azure.resourcemanager.keyvault.implementation.MhsmPrivateEndpointConnectionsClientImpl$MhsmPrivateEndpointConnectionsService" ], [ "com.azure.resourcemanager.keyvault.implementation.MhsmPrivateLinkResourcesClientImpl$MhsmPrivateLinkResourcesService" ], [ "com.azure.resourcemanager.keyvault.implementation.MhsmRegionsClientImpl$MhsmRegionsService" ], [ "com.azure.resourcemanager.keyvault.implementation.OperationsClientImpl$OperationsService" ] ] \ No newline at end of file +[["com.azure.resourcemanager.keyvault.implementation.KeysClientImpl$KeysService"],["com.azure.resourcemanager.keyvault.implementation.ManagedHsmKeysClientImpl$ManagedHsmKeysService"],["com.azure.resourcemanager.keyvault.implementation.ManagedHsmsClientImpl$ManagedHsmsService"],["com.azure.resourcemanager.keyvault.implementation.MhsmPrivateEndpointConnectionsClientImpl$MhsmPrivateEndpointConnectionsService"],["com.azure.resourcemanager.keyvault.implementation.MhsmPrivateLinkResourcesClientImpl$MhsmPrivateLinkResourcesService"],["com.azure.resourcemanager.keyvault.implementation.MhsmRegionsClientImpl$MhsmRegionsService"],["com.azure.resourcemanager.keyvault.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.keyvault.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.keyvault.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.keyvault.implementation.SecretsClientImpl$SecretsService"],["com.azure.resourcemanager.keyvault.implementation.VaultsClientImpl$VaultsService"]] \ No newline at end of file diff --git a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-keyvault/reflect-config.json b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-keyvault/reflect-config.json index ddd3cdc1bca3b..8b63de7de1614 100644 --- a/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-keyvault/reflect-config.json +++ b/sdk/resourcemanager/azure-resourcemanager-keyvault/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-keyvault/reflect-config.json @@ -1,451 +1 @@ -[ { - "name" : "com.azure.resourcemanager.keyvault.models.ErrorException", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.VaultCreateOrUpdateParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.VaultProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.Sku", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.AccessPolicyEntry", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.Permissions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.NetworkRuleSet", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.IpRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.VirtualNetworkRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.PrivateEndpointConnectionProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.PrivateEndpoint", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.PrivateLinkServiceConnectionState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.VaultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.VaultPatchParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.VaultPatchProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.VaultAccessPolicyParametersInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.VaultAccessPolicyProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.VaultListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.DeletedVaultListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.DeletedVaultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.DeletedVaultProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ResourceListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.VaultCheckNameAvailabilityParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.CheckNameAvailabilityResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.PrivateEndpointConnectionInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.PrivateLinkResourceListResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.PrivateLinkResource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.PrivateLinkResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.ManagedHsmInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ManagedHsmProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MhsmNetworkRuleSet", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MhsmipRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MhsmVirtualNetworkRule", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.MhsmGeoReplicatedRegionInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MhsmPrivateEndpointConnectionItem", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.MhsmPrivateEndpointConnectionProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MhsmPrivateEndpoint", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MhsmPrivateLinkServiceConnectionState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ManagedHsmSecurityDomainProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ManagedHsmResource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ManagedHsmSku", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ManagedServiceIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.UserAssignedIdentity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.Error", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ManagedHsmListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MhsmPrivateEndpointConnectionsListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.MhsmPrivateEndpointConnectionInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.DeletedManagedHsmListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.DeletedManagedHsmInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.DeletedManagedHsmProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.MhsmPrivateLinkResourceListResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MhsmPrivateLinkResource", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.MhsmPrivateLinkResourceProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MhsmRegionsListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.CheckMhsmNameAvailabilityParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.CheckMhsmNameAvailabilityResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.OperationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.OperationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.fluent.models.OperationProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ServiceSpecification", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.LogSpecification", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MetricSpecification", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.DimensionProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionsPutHeaders", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.MhsmPrivateEndpointConnectionsPutHeaders", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.SkuFamily", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.KeyPermissions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.SecretPermissions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.CertificatePermissions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.StoragePermissions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.NetworkRuleBypassOptions", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.NetworkRuleAction", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.VaultProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.PrivateEndpointServiceConnectionStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ActionsRequired", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.PrivateEndpointConnectionProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.GeoReplicationRegionProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.PublicNetworkAccess", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ActivationStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ManagedHsmSkuFamily", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ManagedServiceIdentityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.SkuName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.CreateMode", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.AccessPolicyUpdateKind", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.Reason", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.keyvault.models.ManagedHsmSkuName", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[{"name":"com.azure.resourcemanager.keyvault.models.Error","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.keyvault.models.ErrorException","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true}] \ No newline at end of file diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysCreateIfNotExistSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysCreateIfNotExistSamples.java new file mode 100644 index 0000000000000..d4dbffda12866 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysCreateIfNotExistSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +import com.azure.resourcemanager.keyvault.fluent.models.KeyProperties; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyType; +import com.azure.resourcemanager.keyvault.models.KeyCreateParameters; + +/** + * Samples for Keys CreateIfNotExist. + */ +public final class KeysCreateIfNotExistSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createKey.json + */ + /** + * Sample code: Create a key. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void createAKey(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getKeys() + .createIfNotExistWithResponse("sample-group", "sample-vault-name", "sample-key-name", + new KeyCreateParameters().withProperties(new KeyProperties().withKty(JsonWebKeyType.RSA)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysGetSamples.java new file mode 100644 index 0000000000000..1d86f83bb2245 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +/** + * Samples for Keys Get. + */ +public final class KeysGetSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getKey.json + */ + /** + * Sample code: Get a key. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void getAKey(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getKeys() + .getWithResponse("sample-group", "sample-vault-name", "sample-key-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysGetVersionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysGetVersionSamples.java new file mode 100644 index 0000000000000..d4ee82e3fdc07 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysGetVersionSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +/** + * Samples for Keys GetVersion. + */ +public final class KeysGetVersionSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getKeyVersion.json + */ + /** + * Sample code: Get a key version. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void getAKeyVersion(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getKeys() + .getVersionWithResponse("sample-group", "sample-vault-name", "sample-key-name", + "fd618d9519b74f9aae94ade66b876acc", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysListSamples.java new file mode 100644 index 0000000000000..8476a7f341ea8 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +/** + * Samples for Keys List. + */ +public final class KeysListSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listKeys.json + */ + /** + * Sample code: List keys in the vault. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void listKeysInTheVault(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getKeys() + .list("sample-group", "sample-vault-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysListVersionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysListVersionsSamples.java new file mode 100644 index 0000000000000..be5cec3c3e075 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/KeysListVersionsSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +/** + * Samples for Keys ListVersions. + */ +public final class KeysListVersionsSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listKeyVersions.json + */ + /** + * Sample code: List key versions in the vault. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void listKeyVersionsInTheVault(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getKeys() + .listVersions("sample-group", "sample-vault-name", "sample-key-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysCreateIfNotExistSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysCreateIfNotExistSamples.java new file mode 100644 index 0000000000000..785fc73353d20 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysCreateIfNotExistSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +import com.azure.resourcemanager.keyvault.fluent.models.ManagedHsmKeyProperties; +import com.azure.resourcemanager.keyvault.models.JsonWebKeyType; +import com.azure.resourcemanager.keyvault.models.ManagedHsmKeyCreateParameters; + +/** + * Samples for ManagedHsmKeys CreateIfNotExist. + */ +public final class ManagedHsmKeysCreateIfNotExistSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/managedHsmCreateKey.json + */ + /** + * Sample code: Create a key. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void createAKey(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getManagedHsmKeys() + .createIfNotExistWithResponse( + "sample-group", "sample-managedhsm-name", "sample-key-name", new ManagedHsmKeyCreateParameters() + .withProperties(new ManagedHsmKeyProperties().withKty(JsonWebKeyType.RSA)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysGetSamples.java new file mode 100644 index 0000000000000..eb4db533cc29f --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysGetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +/** + * Samples for ManagedHsmKeys Get. + */ +public final class ManagedHsmKeysGetSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/managedHsmGetKey.json + */ + /** + * Sample code: Get a key. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void getAKey(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getManagedHsmKeys() + .getWithResponse("sample-group", "sample-managedhsm-name", "sample-key-name", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysGetVersionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysGetVersionSamples.java new file mode 100644 index 0000000000000..430feee92a7da --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysGetVersionSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +/** + * Samples for ManagedHsmKeys GetVersion. + */ +public final class ManagedHsmKeysGetVersionSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/managedHsmGetKeyVersion. + * json + */ + /** + * Sample code: Get a key version. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void getAKeyVersion(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getManagedHsmKeys() + .getVersionWithResponse("sample-group", "sample-managedhsm-name", "sample-key-name", + "fd618d9519b74f9aae94ade66b876acc", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysListSamples.java new file mode 100644 index 0000000000000..ce9155450b665 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +/** + * Samples for ManagedHsmKeys List. + */ +public final class ManagedHsmKeysListSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/managedHsmListKeys.json + */ + /** + * Sample code: List keys in the managed HSM. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void listKeysInTheManagedHSM(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getManagedHsmKeys() + .list("sample-group", "sample-managedhsm-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysListVersionsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysListVersionsSamples.java new file mode 100644 index 0000000000000..15ced58bea891 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmKeysListVersionsSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +/** + * Samples for ManagedHsmKeys ListVersions. + */ +public final class ManagedHsmKeysListVersionsSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/managedHsmListKeyVersions. + * json + */ + /** + * Sample code: List key versions in the managed HSM. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void listKeyVersionsInTheManagedHSM(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getManagedHsmKeys() + .listVersions("sample-group", "sample-managedhsm-name", "sample-key-name", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsCheckMhsmNameAvailabilitySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsCheckMhsmNameAvailabilitySamples.java index 37047fb0875e8..62a488e484f2f 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsCheckMhsmNameAvailabilitySamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsCheckMhsmNameAvailabilitySamples.java @@ -6,23 +6,25 @@ import com.azure.resourcemanager.keyvault.models.CheckMhsmNameAvailabilityParameters; -/** Samples for ManagedHsms CheckMhsmNameAvailability. */ +/** + * Samples for ManagedHsms CheckMhsmNameAvailability. + */ public final class ManagedHsmsCheckMhsmNameAvailabilitySamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_checkMhsmNameAvailability.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * ManagedHsm_checkMhsmNameAvailability.json */ /** * Sample code: Validate a managed hsm name. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void validateAManagedHsmName(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getManagedHsms() - .checkMhsmNameAvailabilityWithResponse( - new CheckMhsmNameAvailabilityParameters().withName("sample-mhsm"), com.azure.core.util.Context.NONE); + .checkMhsmNameAvailabilityWithResponse(new CheckMhsmNameAvailabilityParameters().withName("sample-mhsm"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsCreateOrUpdateSamples.java index dc4f1e3e19a87..4ebc46779d1c1 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsCreateOrUpdateSamples.java @@ -14,34 +14,33 @@ import java.util.Map; import java.util.UUID; -/** Samples for ManagedHsms CreateOrUpdate. */ +/** + * Samples for ManagedHsms CreateOrUpdate. + */ public final class ManagedHsmsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_CreateOrUpdate.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_CreateOrUpdate. + * json */ /** * Sample code: Create a new managed HSM Pool or update an existing managed HSM Pool. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ - public static void createANewManagedHSMPoolOrUpdateAnExistingManagedHSMPool( - com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + public static void + createANewManagedHSMPoolOrUpdateAnExistingManagedHSMPool(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() .manager() .serviceClient() .getManagedHsms() - .createOrUpdate( - "hsm-group", - "hsm1", - new ManagedHsmInner() - .withLocation("westus") + .createOrUpdate("hsm-group", "hsm1", + new ManagedHsmInner().withLocation("westus") .withTags(mapOf("Dept", "hsm", "Environment", "dogfood")) .withSku( new ManagedHsmSku().withFamily(ManagedHsmSkuFamily.B).withName(ManagedHsmSkuName.STANDARD_B1)) .withProperties( - new ManagedHsmProperties() - .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + new ManagedHsmProperties().withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) .withInitialAdminObjectIds(Arrays.asList("00000000-0000-0000-0000-000000000000")) .withEnableSoftDelete(true) .withSoftDeleteRetentionInDays(90) diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsDeleteSamples.java index 06a7f2ccb2ba2..b37b4d2352c4f 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsDeleteSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for ManagedHsms Delete. */ +/** + * Samples for ManagedHsms Delete. + */ public final class ManagedHsmsDeleteSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Delete.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Delete.json */ /** * Sample code: Delete a managed HSM Pool. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void deleteAManagedHSMPool(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getManagedHsms() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsGetByResourceGroupSamples.java index b944588531ca4..1246f75f73418 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsGetByResourceGroupSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsGetByResourceGroupSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for ManagedHsms GetByResourceGroup. */ +/** + * Samples for ManagedHsms GetByResourceGroup. + */ public final class ManagedHsmsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Get.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Get.json */ /** * Sample code: Retrieve a managed HSM Pool. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void retrieveAManagedHSMPool(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getManagedHsms() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsGetDeletedSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsGetDeletedSamples.java index 750053a9d5da0..f450f573290e0 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsGetDeletedSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsGetDeletedSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for ManagedHsms GetDeleted. */ +/** + * Samples for ManagedHsms GetDeleted. + */ public final class ManagedHsmsGetDeletedSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Get.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Get.json */ /** * Sample code: Retrieve a deleted managed HSM. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void retrieveADeletedManagedHSM(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getManagedHsms() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListByResourceGroupSamples.java index 1706d858437ef..fb36fbe07992b 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListByResourceGroupSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListByResourceGroupSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for ManagedHsms ListByResourceGroup. */ +/** + * Samples for ManagedHsms ListByResourceGroup. + */ public final class ManagedHsmsListByResourceGroupSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListByResourceGroup.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * ManagedHsm_ListByResourceGroup.json */ /** * Sample code: List managed HSM Pools in a resource group. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void listManagedHSMPoolsInAResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getManagedHsms() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListDeletedSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListDeletedSamples.java index 1c3e908048b71..e40a7649a998e 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListDeletedSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListDeletedSamples.java @@ -4,18 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for ManagedHsms ListDeleted. */ +/** + * Samples for ManagedHsms ListDeleted. + */ public final class ManagedHsmsListDeletedSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_List.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_List.json */ /** * Sample code: List deleted managed HSMs in the specified subscription. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ - public static void listDeletedManagedHSMsInTheSpecifiedSubscription( - com.azure.resourcemanager.AzureResourceManager azure) { + public static void + listDeletedManagedHSMsInTheSpecifiedSubscription(com.azure.resourcemanager.AzureResourceManager azure) { azure.vaults().manager().serviceClient().getManagedHsms().listDeleted(com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListSamples.java index 676134fd905b8..528f20815d58d 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsListSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for ManagedHsms List. */ +/** + * Samples for ManagedHsms List. + */ public final class ManagedHsmsListSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListBySubscription.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * ManagedHsm_ListBySubscription.json */ /** * Sample code: List managed HSM Pools in a subscription. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void listManagedHSMPoolsInASubscription(com.azure.resourcemanager.AzureResourceManager azure) { diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsPurgeDeletedSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsPurgeDeletedSamples.java index dda511651f465..eefc218c5396e 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsPurgeDeletedSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsPurgeDeletedSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for ManagedHsms PurgeDeleted. */ +/** + * Samples for ManagedHsms PurgeDeleted. + */ public final class ManagedHsmsPurgeDeletedSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Purge.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/DeletedManagedHsm_Purge. + * json */ /** * Sample code: Purge a managed HSM Pool. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void purgeAManagedHSMPool(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getManagedHsms() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsUpdateSamples.java index 34d8712c536b6..4da9c28c02465 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/ManagedHsmsUpdateSamples.java @@ -8,25 +8,25 @@ import java.util.HashMap; import java.util.Map; -/** Samples for ManagedHsms Update. */ +/** + * Samples for ManagedHsms Update. + */ public final class ManagedHsmsUpdateSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Update.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_Update.json */ /** * Sample code: Update an existing managed HSM Pool. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void updateAnExistingManagedHSMPool(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getManagedHsms() - .update( - "hsm-group", - "hsm1", + .update("hsm-group", "hsm1", new ManagedHsmInner().withTags(mapOf("Dept", "hsm", "Environment", "dogfood", "Slice", "A")), com.azure.core.util.Context.NONE); } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsDeleteSamples.java index 2bf62527db180..2699bf569c65e 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsDeleteSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for MhsmPrivateEndpointConnections Delete. */ +/** + * Samples for MhsmPrivateEndpointConnections Delete. + */ public final class MhsmPrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_deletePrivateEndpointConnection.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * ManagedHsm_deletePrivateEndpointConnection.json */ /** * Sample code: ManagedHsmDeletePrivateEndpointConnection. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void managedHsmDeletePrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getMhsmPrivateEndpointConnections() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsGetSamples.java index 40bc6493e149c..4e76e9fcd7372 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsGetSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for MhsmPrivateEndpointConnections Get. */ +/** + * Samples for MhsmPrivateEndpointConnections Get. + */ public final class MhsmPrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_getPrivateEndpointConnection.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * ManagedHsm_getPrivateEndpointConnection.json */ /** * Sample code: ManagedHsmGetPrivateEndpointConnection. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void managedHsmGetPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getMhsmPrivateEndpointConnections() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsListByResourceSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsListByResourceSamples.java index 3251395fb48c7..a9e5caf859d8d 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsListByResourceSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsListByResourceSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for MhsmPrivateEndpointConnections ListByResource. */ +/** + * Samples for MhsmPrivateEndpointConnections ListByResource. + */ public final class MhsmPrivateEndpointConnectionsListByResourceSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * ManagedHsm_ListPrivateEndpointConnectionsByResource.json */ /** * Sample code: List managed HSM Pools in a subscription. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void listManagedHSMPoolsInASubscription(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getMhsmPrivateEndpointConnections() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsPutSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsPutSamples.java index fdff83f015ad1..6429f3a620949 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsPutSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateEndpointConnectionsPutSamples.java @@ -8,31 +8,29 @@ import com.azure.resourcemanager.keyvault.models.MhsmPrivateLinkServiceConnectionState; import com.azure.resourcemanager.keyvault.models.PrivateEndpointServiceConnectionStatus; -/** Samples for MhsmPrivateEndpointConnections Put. */ +/** + * Samples for MhsmPrivateEndpointConnections Put. + */ public final class MhsmPrivateEndpointConnectionsPutSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_putPrivateEndpointConnection.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * ManagedHsm_putPrivateEndpointConnection.json */ /** * Sample code: ManagedHsmPutPrivateEndpointConnection. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void managedHsmPutPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getMhsmPrivateEndpointConnections() - .putWithResponse( - "sample-group", - "sample-mhsm", - "sample-pec", + .putWithResponse("sample-group", "sample-mhsm", "sample-pec", new MhsmPrivateEndpointConnectionInner() - .withPrivateLinkServiceConnectionState( - new MhsmPrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("My name is Joe and I'm approving this.")), + .withPrivateLinkServiceConnectionState(new MhsmPrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("My name is Joe and I'm approving this.")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateLinkResourcesListByMhsmResourceSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateLinkResourcesListByMhsmResourceSamples.java index 77285856220b2..80970ec01ef30 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateLinkResourcesListByMhsmResourceSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmPrivateLinkResourcesListByMhsmResourceSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for MhsmPrivateLinkResources ListByMhsmResource. */ +/** + * Samples for MhsmPrivateLinkResources ListByMhsmResource. + */ public final class MhsmPrivateLinkResourcesListByMhsmResourceSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_listPrivateLinkResources.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * ManagedHsm_listPrivateLinkResources.json */ /** * Sample code: KeyVaultListPrivateLinkResources. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void keyVaultListPrivateLinkResources(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getMhsmPrivateLinkResources() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmRegionsListByResourceSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmRegionsListByResourceSamples.java index 177ea1be5e4a5..4c123480eed03 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmRegionsListByResourceSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/MhsmRegionsListByResourceSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for MhsmRegions ListByResource. */ +/** + * Samples for MhsmRegions ListByResource. + */ public final class MhsmRegionsListByResourceSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ManagedHsm_ListRegionsByResource.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * ManagedHsm_ListRegionsByResource.json */ /** * Sample code: List managed HSM Pools in a subscription. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void listManagedHSMPoolsInASubscription(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getMhsmRegions() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/OperationsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/OperationsListSamples.java index d5f030cf671e4..8d4fd535d2951 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/OperationsListSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/OperationsListSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listOperations.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listOperations.json */ /** * Sample code: Lists available Rest API operations. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void listsAvailableRestAPIOperations(com.azure.resourcemanager.AzureResourceManager azure) { diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsDeleteSamples.java index 5324953952824..f90ac1ed5515d 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for PrivateEndpointConnections Delete. */ +/** + * Samples for PrivateEndpointConnections Delete. + */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/deletePrivateEndpointConnection.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * deletePrivateEndpointConnection.json */ /** * Sample code: KeyVaultDeletePrivateEndpointConnection. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void keyVaultDeletePrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getPrivateEndpointConnections() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsGetSamples.java index 45f066cb60fb5..39dcbb2022ea9 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsGetSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for PrivateEndpointConnections Get. */ +/** + * Samples for PrivateEndpointConnections Get. + */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getPrivateEndpointConnection.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * getPrivateEndpointConnection.json */ /** * Sample code: KeyVaultGetPrivateEndpointConnection. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void keyVaultGetPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getPrivateEndpointConnections() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsListByResourceSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsListByResourceSamples.java index 775d0466c7dc9..628ff0adb8173 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsListByResourceSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsListByResourceSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for PrivateEndpointConnections ListByResource. */ +/** + * Samples for PrivateEndpointConnections ListByResource. + */ public final class PrivateEndpointConnectionsListByResourceSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listPrivateEndpointConnection.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * listPrivateEndpointConnection.json */ /** * Sample code: KeyVaultListPrivateEndpointConnection. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void keyVaultListPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getPrivateEndpointConnections() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsPutSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsPutSamples.java index 6d7ad33558f82..ff31ac13aaee7 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsPutSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateEndpointConnectionsPutSamples.java @@ -8,32 +8,29 @@ import com.azure.resourcemanager.keyvault.models.PrivateEndpointServiceConnectionStatus; import com.azure.resourcemanager.keyvault.models.PrivateLinkServiceConnectionState; -/** Samples for PrivateEndpointConnections Put. */ +/** + * Samples for PrivateEndpointConnections Put. + */ public final class PrivateEndpointConnectionsPutSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/putPrivateEndpointConnection.json + * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/ + * putPrivateEndpointConnection.json */ /** * Sample code: KeyVaultPutPrivateEndpointConnection. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void keyVaultPutPrivateEndpointConnection(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getPrivateEndpointConnections() - .putWithResponse( - "sample-group", - "sample-vault", - "sample-pec", - new PrivateEndpointConnectionInner() - .withEtag("") - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("My name is Joe and I'm approving this.")), + .putWithResponse("sample-group", "sample-vault", "sample-pec", + new PrivateEndpointConnectionInner().withEtag("") + .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("My name is Joe and I'm approving this.")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateLinkResourcesListByVaultSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateLinkResourcesListByVaultSamples.java index c698d6e486741..7ea1ee2739163 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateLinkResourcesListByVaultSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/PrivateLinkResourcesListByVaultSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for PrivateLinkResources ListByVault. */ +/** + * Samples for PrivateLinkResources ListByVault. + */ public final class PrivateLinkResourcesListByVaultSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listPrivateLinkResources.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listPrivateLinkResources. + * json */ /** * Sample code: KeyVaultListPrivateLinkResources. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void keyVaultListPrivateLinkResources(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getPrivateLinkResources() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7758f2680e7a8 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +import com.azure.resourcemanager.keyvault.models.SecretCreateOrUpdateParameters; +import com.azure.resourcemanager.keyvault.models.SecretProperties; + +/** + * Samples for Secrets CreateOrUpdate. + */ +public final class SecretsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createSecret.json + */ + /** + * Sample code: Create a secret. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void createASecret(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getSecrets() + .createOrUpdateWithResponse("sample-group", "sample-vault", "secret-name", + new SecretCreateOrUpdateParameters().withProperties(new SecretProperties().withValue("secret-value")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsGetSamples.java new file mode 100644 index 0000000000000..9329214a85944 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +/** + * Samples for Secrets Get. + */ +public final class SecretsGetSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getSecret.json + */ + /** + * Sample code: Get a secret. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void getASecret(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getSecrets() + .getWithResponse("sample-group", "sample-vault", "secret-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsListSamples.java new file mode 100644 index 0000000000000..33f09ab339b8d --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +/** + * Samples for Secrets List. + */ +public final class SecretsListSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listSecrets.json + */ + /** + * Sample code: List secrets in the vault. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void listSecretsInTheVault(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getSecrets() + .list("sample-group", "sample-vault", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsUpdateSamples.java new file mode 100644 index 0000000000000..32395c82db5bb --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/SecretsUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.keyvault.generated; + +import com.azure.resourcemanager.keyvault.models.SecretPatchParameters; +import com.azure.resourcemanager.keyvault.models.SecretPatchProperties; + +/** + * Samples for Secrets Update. + */ +public final class SecretsUpdateSamples { + /* + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateSecret.json + */ + /** + * Sample code: Update a secret. + * + * @param azure The entry point for accessing resource management APIs in Azure. + */ + public static void updateASecret(com.azure.resourcemanager.AzureResourceManager azure) { + azure.vaults() + .manager() + .serviceClient() + .getSecrets() + .updateWithResponse("sample-group", "sample-vault", "secret-name", + new SecretPatchParameters().withProperties(new SecretPatchProperties().withValue("secret-value2")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsCheckNameAvailabilitySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsCheckNameAvailabilitySamples.java index 63767092344cb..f88490e493340 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsCheckNameAvailabilitySamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsCheckNameAvailabilitySamples.java @@ -6,23 +6,26 @@ import com.azure.resourcemanager.keyvault.models.VaultCheckNameAvailabilityParameters; -/** Samples for Vaults CheckNameAvailability. */ +/** + * Samples for Vaults CheckNameAvailability. + */ public final class VaultsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/checkVaultNameAvailability.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/checkVaultNameAvailability. + * json */ /** * Sample code: Validate a vault name. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void validateAVaultName(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getVaults() - .checkNameAvailabilityWithResponse( - new VaultCheckNameAvailabilityParameters().withName("sample-vault"), com.azure.core.util.Context.NONE); + .checkNameAvailabilityWithResponse(new VaultCheckNameAvailabilityParameters().withName("sample-vault"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsCreateOrUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsCreateOrUpdateSamples.java index f701bcf479454..fc6a4ce8e47eb 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsCreateOrUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsCreateOrUpdateSamples.java @@ -22,134 +22,85 @@ import java.util.Arrays; import java.util.UUID; -/** Samples for Vaults CreateOrUpdate. */ +/** + * Samples for Vaults CreateOrUpdate. + */ public final class VaultsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createVaultWithNetworkAcls.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createVaultWithNetworkAcls. + * json */ /** * Sample code: Create or update a vault with network acls. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void createOrUpdateAVaultWithNetworkAcls(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getVaults() - .createOrUpdate( - "sample-resource-group", - "sample-vault", - new VaultCreateOrUpdateParameters() - .withLocation("westus") - .withProperties( - new VaultProperties() - .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) - .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) - .withEnabledForDeployment(true) - .withEnabledForDiskEncryption(true) - .withEnabledForTemplateDeployment(true) - .withNetworkAcls( - new NetworkRuleSet() - .withBypass(NetworkRuleBypassOptions.AZURE_SERVICES) - .withDefaultAction(NetworkRuleAction.DENY) - .withIpRules( - Arrays - .asList( - new IpRule().withValue("124.56.78.91"), - new IpRule().withValue("'10.91.4.0/24'"))) - .withVirtualNetworkRules( - Arrays - .asList( - new VirtualNetworkRule() - .withId( - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"))))), + .createOrUpdate("sample-resource-group", "sample-vault", new VaultCreateOrUpdateParameters() + .withLocation("westus") + .withProperties(new VaultProperties() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) + .withEnabledForDeployment(true) + .withEnabledForDiskEncryption(true) + .withEnabledForTemplateDeployment(true) + .withNetworkAcls(new NetworkRuleSet().withBypass(NetworkRuleBypassOptions.AZURE_SERVICES) + .withDefaultAction(NetworkRuleAction.DENY) + .withIpRules(Arrays.asList(new IpRule().withValue("124.56.78.91"), + new IpRule().withValue("'10.91.4.0/24'"))) + .withVirtualNetworkRules(Arrays.asList(new VirtualNetworkRule().withId( + "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1"))))), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createVault.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/createVault.json */ /** * Sample code: Create a new vault or update an existing vault. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void createANewVaultOrUpdateAnExistingVault(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getVaults() - .createOrUpdate( - "sample-resource-group", - "sample-vault", - new VaultCreateOrUpdateParameters() - .withLocation("westus") - .withProperties( - new VaultProperties() + .createOrUpdate("sample-resource-group", "sample-vault", + new VaultCreateOrUpdateParameters().withLocation("westus") + .withProperties(new VaultProperties() + .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) + .withAccessPolicies(Arrays.asList(new AccessPolicyEntry() .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) - .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) - .withAccessPolicies( - Arrays - .asList( - new AccessPolicyEntry() - .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) - .withObjectId("00000000-0000-0000-0000-000000000000") - .withPermissions( - new Permissions() - .withKeys( - Arrays - .asList( - KeyPermissions.ENCRYPT, - KeyPermissions.DECRYPT, - KeyPermissions.WRAP_KEY, - KeyPermissions.UNWRAP_KEY, - KeyPermissions.SIGN, - KeyPermissions.VERIFY, - KeyPermissions.GET, - KeyPermissions.LIST, - KeyPermissions.CREATE, - KeyPermissions.UPDATE, - KeyPermissions.IMPORT, - KeyPermissions.DELETE, - KeyPermissions.BACKUP, - KeyPermissions.RESTORE, - KeyPermissions.RECOVER, - KeyPermissions.PURGE)) - .withSecrets( - Arrays - .asList( - SecretPermissions.GET, - SecretPermissions.LIST, - SecretPermissions.SET, - SecretPermissions.DELETE, - SecretPermissions.BACKUP, - SecretPermissions.RESTORE, - SecretPermissions.RECOVER, - SecretPermissions.PURGE)) - .withCertificates( - Arrays - .asList( - CertificatePermissions.GET, - CertificatePermissions.LIST, - CertificatePermissions.DELETE, - CertificatePermissions.CREATE, - CertificatePermissions.IMPORT, - CertificatePermissions.UPDATE, - CertificatePermissions.MANAGECONTACTS, - CertificatePermissions.GETISSUERS, - CertificatePermissions.LISTISSUERS, - CertificatePermissions.SETISSUERS, - CertificatePermissions.DELETEISSUERS, - CertificatePermissions.MANAGEISSUERS, - CertificatePermissions.RECOVER, - CertificatePermissions.PURGE))))) - .withEnabledForDeployment(true) - .withEnabledForDiskEncryption(true) - .withEnabledForTemplateDeployment(true) - .withPublicNetworkAccess("Enabled")), + .withObjectId("00000000-0000-0000-0000-000000000000") + .withPermissions(new Permissions() + .withKeys(Arrays.asList(KeyPermissions.ENCRYPT, KeyPermissions.DECRYPT, + KeyPermissions.WRAP_KEY, KeyPermissions.UNWRAP_KEY, KeyPermissions.SIGN, + KeyPermissions.VERIFY, KeyPermissions.GET, KeyPermissions.LIST, + KeyPermissions.CREATE, KeyPermissions.UPDATE, KeyPermissions.IMPORT, + KeyPermissions.DELETE, KeyPermissions.BACKUP, KeyPermissions.RESTORE, + KeyPermissions.RECOVER, KeyPermissions.PURGE)) + .withSecrets(Arrays.asList(SecretPermissions.GET, SecretPermissions.LIST, + SecretPermissions.SET, SecretPermissions.DELETE, SecretPermissions.BACKUP, + SecretPermissions.RESTORE, SecretPermissions.RECOVER, SecretPermissions.PURGE)) + .withCertificates(Arrays.asList(CertificatePermissions.GET, CertificatePermissions.LIST, + CertificatePermissions.DELETE, CertificatePermissions.CREATE, + CertificatePermissions.IMPORT, CertificatePermissions.UPDATE, + CertificatePermissions.MANAGECONTACTS, CertificatePermissions.GETISSUERS, + CertificatePermissions.LISTISSUERS, CertificatePermissions.SETISSUERS, + CertificatePermissions.DELETEISSUERS, CertificatePermissions.MANAGEISSUERS, + CertificatePermissions.RECOVER, CertificatePermissions.PURGE))))) + .withEnabledForDeployment(true) + .withEnabledForDiskEncryption(true) + .withEnabledForTemplateDeployment(true) + .withPublicNetworkAccess("Enabled")), com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsDeleteSamples.java index d2287ea6a7c9d..5d6e8980514dd 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsDeleteSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsDeleteSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for Vaults Delete. */ +/** + * Samples for Vaults Delete. + */ public final class VaultsDeleteSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/deleteVault.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/deleteVault.json */ /** * Sample code: Delete a vault. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void deleteAVault(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getVaults() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsGetByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsGetByResourceGroupSamples.java index 0f4b6b769f896..a9a94438d2da4 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsGetByResourceGroupSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsGetByResourceGroupSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for Vaults GetByResourceGroup. */ +/** + * Samples for Vaults GetByResourceGroup. + */ public final class VaultsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getVault.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getVault.json */ /** * Sample code: Retrieve a vault. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void retrieveAVault(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getVaults() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsGetDeletedSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsGetDeletedSamples.java index 39669f43d5d3b..0cfe2129bfe0c 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsGetDeletedSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsGetDeletedSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for Vaults GetDeleted. */ +/** + * Samples for Vaults GetDeleted. + */ public final class VaultsGetDeletedSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getDeletedVault.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/getDeletedVault.json */ /** * Sample code: Retrieve a deleted vault. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void retrieveADeletedVault(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getVaults() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListByResourceGroupSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListByResourceGroupSamples.java index 0924327796d10..ae0de98c44abf 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListByResourceGroupSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListByResourceGroupSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for Vaults ListByResourceGroup. */ +/** + * Samples for Vaults ListByResourceGroup. + */ public final class VaultsListByResourceGroupSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVaultByResourceGroup.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVaultByResourceGroup. + * json */ /** * Sample code: List vaults in the specified resource group. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void listVaultsInTheSpecifiedResourceGroup(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getVaults() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListBySubscriptionSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListBySubscriptionSamples.java index 7b3799d93bf22..5ed37ac27ce15 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListBySubscriptionSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListBySubscriptionSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for Vaults ListBySubscription. */ +/** + * Samples for Vaults ListBySubscription. + */ public final class VaultsListBySubscriptionSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVaultBySubscription.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVaultBySubscription. + * json */ /** * Sample code: List vaults in the specified subscription. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void listVaultsInTheSpecifiedSubscription(com.azure.resourcemanager.AzureResourceManager azure) { diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListDeletedSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListDeletedSamples.java index b9846108fdd47..3764cd2751a53 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListDeletedSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListDeletedSamples.java @@ -4,18 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for Vaults ListDeleted. */ +/** + * Samples for Vaults ListDeleted. + */ public final class VaultsListDeletedSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listDeletedVaults.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listDeletedVaults.json */ /** * Sample code: List deleted vaults in the specified subscription. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ - public static void listDeletedVaultsInTheSpecifiedSubscription( - com.azure.resourcemanager.AzureResourceManager azure) { + public static void + listDeletedVaultsInTheSpecifiedSubscription(com.azure.resourcemanager.AzureResourceManager azure) { azure.vaults().manager().serviceClient().getVaults().listDeleted(com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListSamples.java index c6b31a99913fa..17bb9c43f958b 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsListSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for Vaults List. */ +/** + * Samples for Vaults List. + */ public final class VaultsListSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVault.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/listVault.json */ /** * Sample code: List vaults in the specified subscription. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void listVaultsInTheSpecifiedSubscription(com.azure.resourcemanager.AzureResourceManager azure) { diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsPurgeDeletedSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsPurgeDeletedSamples.java index 8485fbe9a15fa..90f7ae2d3ba40 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsPurgeDeletedSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsPurgeDeletedSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.keyvault.generated; -/** Samples for Vaults PurgeDeleted. */ +/** + * Samples for Vaults PurgeDeleted. + */ public final class VaultsPurgeDeletedSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/purgeDeletedVault.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/purgeDeletedVault.json */ /** * Sample code: Purge a deleted vault. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void purgeADeletedVault(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getVaults() diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsUpdateAccessPolicySamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsUpdateAccessPolicySamples.java index 08b53720c24dc..a40ffa5fed788 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsUpdateAccessPolicySamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsUpdateAccessPolicySamples.java @@ -15,41 +15,34 @@ import java.util.Arrays; import java.util.UUID; -/** Samples for Vaults UpdateAccessPolicy. */ +/** + * Samples for Vaults UpdateAccessPolicy. + */ public final class VaultsUpdateAccessPolicySamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateAccessPoliciesAdd.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateAccessPoliciesAdd. + * json */ /** * Sample code: Add an access policy, or update an access policy with new permissions. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void addAnAccessPolicyOrUpdateAnAccessPolicyWithNewPermissions( com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getVaults() - .updateAccessPolicyWithResponse( - "sample-group", - "sample-vault", - AccessPolicyUpdateKind.ADD, + .updateAccessPolicyWithResponse("sample-group", "sample-vault", AccessPolicyUpdateKind.ADD, new VaultAccessPolicyParametersInner() - .withProperties( - new VaultAccessPolicyProperties() - .withAccessPolicies( - Arrays - .asList( - new AccessPolicyEntry() - .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) - .withObjectId("00000000-0000-0000-0000-000000000000") - .withPermissions( - new Permissions() - .withKeys(Arrays.asList(KeyPermissions.ENCRYPT)) - .withSecrets(Arrays.asList(SecretPermissions.GET)) - .withCertificates(Arrays.asList(CertificatePermissions.GET)))))), + .withProperties(new VaultAccessPolicyProperties().withAccessPolicies(Arrays.asList( + new AccessPolicyEntry().withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withObjectId("00000000-0000-0000-0000-000000000000") + .withPermissions(new Permissions().withKeys(Arrays.asList(KeyPermissions.ENCRYPT)) + .withSecrets(Arrays.asList(SecretPermissions.GET)) + .withCertificates(Arrays.asList(CertificatePermissions.GET)))))), com.azure.core.util.Context.NONE); } } diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsUpdateSamples.java index 02a960b1a8414..c13983219f790 100644 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsUpdateSamples.java +++ b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/keyvault/generated/VaultsUpdateSamples.java @@ -17,89 +17,52 @@ import java.util.Arrays; import java.util.UUID; -/** Samples for Vaults Update. */ +/** + * Samples for Vaults Update. + */ public final class VaultsUpdateSamples { /* - * x-ms-original-file: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateVault.json + * x-ms-original-file: + * specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2023-07-01/examples/updateVault.json */ /** * Sample code: Update an existing vault. - * + * * @param azure The entry point for accessing resource management APIs in Azure. */ public static void updateAnExistingVault(com.azure.resourcemanager.AzureResourceManager azure) { - azure - .vaults() + azure.vaults() .manager() .serviceClient() .getVaults() - .updateWithResponse( - "sample-resource-group", - "sample-vault", - new VaultPatchParameters() - .withProperties( - new VaultPatchProperties() + .updateWithResponse("sample-resource-group", "sample-vault", + new VaultPatchParameters().withProperties( + new VaultPatchProperties().withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) + .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) + .withAccessPolicies(Arrays.asList(new AccessPolicyEntry() .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) - .withSku(new Sku().withFamily(SkuFamily.A).withName(SkuName.STANDARD)) - .withAccessPolicies( - Arrays - .asList( - new AccessPolicyEntry() - .withTenantId(UUID.fromString("00000000-0000-0000-0000-000000000000")) - .withObjectId("00000000-0000-0000-0000-000000000000") - .withPermissions( - new Permissions() - .withKeys( - Arrays - .asList( - KeyPermissions.ENCRYPT, - KeyPermissions.DECRYPT, - KeyPermissions.WRAP_KEY, - KeyPermissions.UNWRAP_KEY, - KeyPermissions.SIGN, - KeyPermissions.VERIFY, - KeyPermissions.GET, - KeyPermissions.LIST, - KeyPermissions.CREATE, - KeyPermissions.UPDATE, - KeyPermissions.IMPORT, - KeyPermissions.DELETE, - KeyPermissions.BACKUP, - KeyPermissions.RESTORE, - KeyPermissions.RECOVER, - KeyPermissions.PURGE)) - .withSecrets( - Arrays - .asList( - SecretPermissions.GET, - SecretPermissions.LIST, - SecretPermissions.SET, - SecretPermissions.DELETE, - SecretPermissions.BACKUP, - SecretPermissions.RESTORE, - SecretPermissions.RECOVER, - SecretPermissions.PURGE)) - .withCertificates( - Arrays - .asList( - CertificatePermissions.GET, - CertificatePermissions.LIST, - CertificatePermissions.DELETE, - CertificatePermissions.CREATE, - CertificatePermissions.IMPORT, - CertificatePermissions.UPDATE, - CertificatePermissions.MANAGECONTACTS, - CertificatePermissions.GETISSUERS, - CertificatePermissions.LISTISSUERS, - CertificatePermissions.SETISSUERS, - CertificatePermissions.DELETEISSUERS, - CertificatePermissions.MANAGEISSUERS, - CertificatePermissions.RECOVER, - CertificatePermissions.PURGE))))) - .withEnabledForDeployment(true) - .withEnabledForDiskEncryption(true) - .withEnabledForTemplateDeployment(true) - .withPublicNetworkAccess("Enabled")), + .withObjectId("00000000-0000-0000-0000-000000000000") + .withPermissions(new Permissions() + .withKeys(Arrays.asList(KeyPermissions.ENCRYPT, KeyPermissions.DECRYPT, + KeyPermissions.WRAP_KEY, KeyPermissions.UNWRAP_KEY, KeyPermissions.SIGN, + KeyPermissions.VERIFY, KeyPermissions.GET, KeyPermissions.LIST, + KeyPermissions.CREATE, KeyPermissions.UPDATE, KeyPermissions.IMPORT, + KeyPermissions.DELETE, KeyPermissions.BACKUP, KeyPermissions.RESTORE, + KeyPermissions.RECOVER, KeyPermissions.PURGE)) + .withSecrets(Arrays.asList(SecretPermissions.GET, SecretPermissions.LIST, + SecretPermissions.SET, SecretPermissions.DELETE, SecretPermissions.BACKUP, + SecretPermissions.RESTORE, SecretPermissions.RECOVER, SecretPermissions.PURGE)) + .withCertificates(Arrays.asList(CertificatePermissions.GET, CertificatePermissions.LIST, + CertificatePermissions.DELETE, CertificatePermissions.CREATE, + CertificatePermissions.IMPORT, CertificatePermissions.UPDATE, + CertificatePermissions.MANAGECONTACTS, CertificatePermissions.GETISSUERS, + CertificatePermissions.LISTISSUERS, CertificatePermissions.SETISSUERS, + CertificatePermissions.DELETEISSUERS, CertificatePermissions.MANAGEISSUERS, + CertificatePermissions.RECOVER, CertificatePermissions.PURGE))))) + .withEnabledForDeployment(true) + .withEnabledForDiskEncryption(true) + .withEnabledForTemplateDeployment(true) + .withPublicNetworkAccess("Enabled")), com.azure.core.util.Context.NONE); } } From 8bc25b39c516c4ae052222ff920d480fd1527a34 Mon Sep 17 00:00:00 2001 From: xiaofeicao Date: Fri, 26 Jul 2024 14:15:26 +0800 Subject: [PATCH 04/19] regen authorization --- .../ApplicationsApplicationsClient.java | 187 +- .../fluent/ApplicationsClient.java | 563 ++-- .../fluent/AuthorizationManagementClient.java | 44 +- .../fluent/ClassicAdministratorsClient.java | 16 +- .../fluent/DenyAssignmentsClient.java | 223 +- .../fluent/DomainsDomainsClient.java | 114 +- .../fluent/EligibleChildResourcesClient.java | 38 +- .../fluent/GlobalAdministratorsClient.java | 12 +- .../authorization/fluent/GroupsClient.java | 187 +- .../fluent/GroupsGroupsClient.java | 121 +- .../fluent/MicrosoftGraphClient.java | 26 +- .../fluent/PermissionsClient.java | 41 +- .../ProviderOperationsMetadatasClient.java | 34 +- ...RoleAssignmentScheduleInstancesClient.java | 70 +- .../RoleAssignmentScheduleRequestsClient.java | 152 +- .../fluent/RoleAssignmentSchedulesClient.java | 42 +- .../fluent/RoleAssignmentsClient.java | 351 ++- .../fluent/RoleDefinitionsClient.java | 92 +- ...oleEligibilityScheduleInstancesClient.java | 66 +- ...RoleEligibilityScheduleRequestsClient.java | 144 +- .../RoleEligibilitySchedulesClient.java | 42 +- .../fluent/RoleManagementPoliciesClient.java | 52 +- ...RoleManagementPolicyAssignmentsClient.java | 99 +- .../fluent/ServicePrincipalsClient.java | 64 +- ...vicePrincipalsServicePrincipalsClient.java | 142 +- .../fluent/UsersUsersClient.java | 121 +- .../ApplicationsAddKeyRequestBodyInner.java | 113 +- ...plicationsAddPasswordRequestBodyInner.java | 97 +- ...licationsCheckMemberGroupsRequestBody.java | 93 +- ...icationsCheckMemberObjectsRequestBody.java | 97 +- .../fluent/models/ApplicationsExpand.java | 20 +- ...pplicationsGetMemberGroupsRequestBody.java | 93 +- ...plicationsGetMemberObjectsRequestBody.java | 93 +- .../fluent/models/ApplicationsOrderby.java | 68 +- .../ApplicationsRemoveKeyRequestBody.java | 101 +- ...ApplicationsRemovePasswordRequestBody.java | 94 +- .../fluent/models/ApplicationsSelect.java | 40 +- .../models/ClassicAdministratorInner.java | 92 +- .../ClassicAdministratorProperties.java | 68 +- .../models/CollectionOfApplication.java | 104 +- .../models/CollectionOfDirectoryObject.java | 104 +- .../models/CollectionOfDirectoryObject0.java | 104 +- .../fluent/models/CollectionOfDomain.java | 104 +- .../models/CollectionOfExtensionProperty.java | 105 +- .../fluent/models/CollectionOfGroup.java | 104 +- .../CollectionOfHomeRealmDiscoveryPolicy.java | 106 +- .../CollectionOfLinksOfDirectoryObject.java | 104 +- ...tionOfLinksOfHomeRealmDiscoveryPolicy.java | 109 +- .../models/CollectionOfServicePrincipal.java | 104 +- .../fluent/models/CollectionOfUser.java | 104 +- .../fluent/models/DenyAssignmentInner.java | 124 +- .../models/DenyAssignmentProperties.java | 168 +- .../models/EligibleChildResourceInner.java | 66 +- .../fluent/models/Get1ItemsItem.java | 88 +- .../fluent/models/Get2ItemsItem.java | 756 ++++-- .../fluent/models/Get3ItemsItem.java | 260 +- .../fluent/models/Get5ItemsItem.java | 136 +- .../fluent/models/Get6ItemsItem.java | 1084 +++++--- .../fluent/models/Get7ItemsItem.java | 756 ++++-- .../fluent/models/Get8ItemsItem.java | 260 +- .../fluent/models/GroupsOrderby.java | 28 +- .../fluent/models/GroupsSelect.java | 20 +- .../models/MicrosoftGraphActionState.java | 40 +- .../MicrosoftGraphActivityHistoryItem.java | 180 +- .../fluent/models/MicrosoftGraphAddIn.java | 110 +- .../MicrosoftGraphAdministrativeUnit.java | 159 +- .../MicrosoftGraphAlternativeSecurityId.java | 110 +- .../models/MicrosoftGraphApiApplication.java | 156 +- .../fluent/models/MicrosoftGraphAppRole.java | 156 +- .../MicrosoftGraphAppRoleAssignment.java | 164 +- .../MicrosoftGraphApplicationInner.java | 453 ++-- .../models/MicrosoftGraphAssignedLabel.java | 98 +- .../models/MicrosoftGraphAssignedLicense.java | 104 +- .../models/MicrosoftGraphAssignedPlan.java | 122 +- .../models/MicrosoftGraphAttachment.java | 132 +- .../models/MicrosoftGraphAttachmentItem.java | 124 +- .../models/MicrosoftGraphAttachmentType.java | 24 +- .../fluent/models/MicrosoftGraphAttendee.java | 110 +- .../models/MicrosoftGraphAttendeeBase.java | 96 +- .../models/MicrosoftGraphAttendeeType.java | 24 +- .../fluent/models/MicrosoftGraphAudio.java | 210 +- .../MicrosoftGraphAudioConferencing.java | 115 +- ...MicrosoftGraphAutomaticRepliesSetting.java | 149 +- .../MicrosoftGraphAutomaticRepliesStatus.java | 24 +- .../models/MicrosoftGraphBaseItemInner.java | 204 +- .../models/MicrosoftGraphBaseItemVersion.java | 119 +- .../fluent/models/MicrosoftGraphBodyType.java | 20 +- .../MicrosoftGraphCalculatedColumn.java | 107 +- .../fluent/models/MicrosoftGraphCalendar.java | 257 +- .../models/MicrosoftGraphCalendarColor.java | 56 +- .../models/MicrosoftGraphCalendarGroup.java | 122 +- .../MicrosoftGraphCalendarPermission.java | 134 +- .../MicrosoftGraphCalendarRoleType.java | 52 +- .../models/MicrosoftGraphCategoryColor.java | 116 +- .../MicrosoftGraphCertificateAuthority.java | 139 +- ...raphCertificateBasedAuthConfiguration.java | 107 +- .../MicrosoftGraphChangeTrackedEntity.java | 120 +- .../fluent/models/MicrosoftGraphChannel.java | 190 +- .../MicrosoftGraphChannelMembershipType.java | 24 +- .../fluent/models/MicrosoftGraphChat.java | 85 +- .../fluent/models/MicrosoftGraphChatInfo.java | 106 +- .../models/MicrosoftGraphChatMessage.java | 274 +- .../MicrosoftGraphChatMessageAttachment.java | 136 +- ...icrosoftGraphChatMessageHostedContent.java | 86 +- .../MicrosoftGraphChatMessageImportance.java | 28 +- .../MicrosoftGraphChatMessageMention.java | 107 +- ...rosoftGraphChatMessagePolicyViolation.java | 145 +- ...tMessagePolicyViolationDlpActionTypes.java | 36 +- ...phChatMessagePolicyViolationPolicyTip.java | 119 +- ...MessagePolicyViolationUserActionTypes.java | 28 +- ...agePolicyViolationVerdictDetailsTypes.java | 36 +- .../MicrosoftGraphChatMessageReaction.java | 111 +- .../models/MicrosoftGraphChatMessageType.java | 28 +- .../models/MicrosoftGraphChoiceColumn.java | 107 +- .../MicrosoftGraphClaimsMappingPolicy.java | 136 +- .../MicrosoftGraphColumnDefinition.java | 256 +- .../models/MicrosoftGraphColumnLink.java | 96 +- .../models/MicrosoftGraphComplianceState.java | 40 +- .../MicrosoftGraphComplianceStatus.java | 44 +- ...igurationManagerClientEnabledFeatures.java | 152 +- .../fluent/models/MicrosoftGraphContact.java | 439 +++- .../models/MicrosoftGraphContactFolder.java | 145 +- .../models/MicrosoftGraphContentType.java | 168 +- .../models/MicrosoftGraphContentTypeInfo.java | 99 +- .../MicrosoftGraphContentTypeOrder.java | 100 +- .../fluent/models/MicrosoftGraphContract.java | 137 +- .../models/MicrosoftGraphConversation.java | 144 +- .../MicrosoftGraphConversationMember.java | 104 +- .../MicrosoftGraphConversationThread.java | 173 +- .../MicrosoftGraphCopyNotebookModel.java | 218 +- .../models/MicrosoftGraphCurrencyColumn.java | 90 +- .../models/MicrosoftGraphDateTimeColumn.java | 98 +- .../models/MicrosoftGraphDateTimeZone.java | 98 +- .../models/MicrosoftGraphDayOfWeek.java | 40 +- .../MicrosoftGraphDefaultColumnValue.java | 99 +- ...DelegateMeetingMessageDeliveryOptions.java | 36 +- ...raphDelegatedPermissionClassification.java | 121 +- .../fluent/models/MicrosoftGraphDeleted.java | 90 +- .../fluent/models/MicrosoftGraphDevice.java | 330 ++- .../MicrosoftGraphDeviceActionResult.java | 124 +- .../models/MicrosoftGraphDeviceCategory.java | 112 +- ...aphDeviceCompliancePolicySettingState.java | 189 +- ...osoftGraphDeviceCompliancePolicyState.java | 149 +- ...tGraphDeviceConfigurationSettingState.java | 188 +- ...icrosoftGraphDeviceConfigurationState.java | 144 +- .../MicrosoftGraphDeviceEnrollmentType.java | 64 +- ...softGraphDeviceHealthAttestationState.java | 389 ++- ...phDeviceManagementExchangeAccessState.java | 32 +- ...ceManagementExchangeAccessStateReason.java | 124 +- ...hDeviceManagementTroubleshootingEvent.java | 112 +- ...MicrosoftGraphDeviceRegistrationState.java | 48 +- .../models/MicrosoftGraphDirectory.java | 107 +- .../MicrosoftGraphDirectoryObjectInner.java | 99 +- .../models/MicrosoftGraphDirectoryRole.java | 141 +- .../MicrosoftGraphDirectoryRoleTemplate.java | 114 +- .../models/MicrosoftGraphDomainDnsRecord.java | 131 +- .../models/MicrosoftGraphDomainInner.java | 243 +- .../models/MicrosoftGraphDomainState.java | 116 +- .../fluent/models/MicrosoftGraphDrive.java | 265 +- .../models/MicrosoftGraphDriveItem.java | 435 +++- .../MicrosoftGraphDriveItemVersion.java | 133 +- .../models/MicrosoftGraphEmailAddress.java | 98 +- .../models/MicrosoftGraphEmployeeOrgData.java | 99 +- .../fluent/models/MicrosoftGraphEndpoint.java | 139 +- .../fluent/models/MicrosoftGraphEntity.java | 90 +- .../fluent/models/MicrosoftGraphEvent.java | 502 ++-- .../models/MicrosoftGraphEventType.java | 28 +- .../models/MicrosoftGraphExtension.java | 85 +- .../MicrosoftGraphExtensionPropertyInner.java | 141 +- .../MicrosoftGraphExternalAudienceScope.java | 24 +- .../models/MicrosoftGraphExternalLink.java | 90 +- .../models/MicrosoftGraphFieldValueSet.java | 85 +- .../fluent/models/MicrosoftGraphFile.java | 106 +- .../models/MicrosoftGraphFileSystemInfo.java | 118 +- .../fluent/models/MicrosoftGraphFolder.java | 98 +- .../models/MicrosoftGraphFolderView.java | 106 +- .../models/MicrosoftGraphFollowupFlag.java | 116 +- .../MicrosoftGraphFollowupFlagStatus.java | 24 +- .../models/MicrosoftGraphFreeBusyError.java | 98 +- .../models/MicrosoftGraphFreeBusyStatus.java | 36 +- .../models/MicrosoftGraphGeoCoordinates.java | 108 +- .../models/MicrosoftGraphGiphyRatingType.java | 24 +- .../models/MicrosoftGraphGroupInner.java | 761 ++++-- .../MicrosoftGraphGroupLifecyclePolicy.java | 112 +- .../models/MicrosoftGraphGroupSetting.java | 112 +- .../fluent/models/MicrosoftGraphHashes.java | 114 +- ...oftGraphHomeRealmDiscoveryPolicyInner.java | 144 +- .../fluent/models/MicrosoftGraphIdentity.java | 98 +- .../models/MicrosoftGraphIdentitySet.java | 106 +- .../fluent/models/MicrosoftGraphImage.java | 98 +- .../models/MicrosoftGraphImageInfo.java | 114 +- .../MicrosoftGraphImplicitGrantSettings.java | 102 +- .../models/MicrosoftGraphImportance.java | 24 +- .../models/MicrosoftGraphIncompleteData.java | 104 +- ...MicrosoftGraphInferenceClassification.java | 101 +- ...tGraphInferenceClassificationOverride.java | 117 +- ...osoftGraphInferenceClassificationType.java | 20 +- .../MicrosoftGraphInformationalUrl.java | 123 +- .../models/MicrosoftGraphInsightIdentity.java | 107 +- .../MicrosoftGraphInternetMessageHeader.java | 100 +- .../models/MicrosoftGraphItemActionStat.java | 98 +- .../models/MicrosoftGraphItemActivity.java | 127 +- .../MicrosoftGraphItemActivityStat.java | 176 +- .../models/MicrosoftGraphItemAnalytics.java | 114 +- .../fluent/models/MicrosoftGraphItemBody.java | 99 +- .../models/MicrosoftGraphItemReference.java | 147 +- .../MicrosoftGraphKeyCredentialInner.java | 156 +- .../fluent/models/MicrosoftGraphKeyValue.java | 98 +- .../MicrosoftGraphLicenseAssignmentState.java | 129 +- .../models/MicrosoftGraphLicenseDetails.java | 114 +- .../MicrosoftGraphLicenseProcessingState.java | 92 +- .../MicrosoftGraphLicenseUnitsDetail.java | 107 +- .../models/MicrosoftGraphLinkedResource.java | 118 +- .../fluent/models/MicrosoftGraphList.java | 254 +- .../fluent/models/MicrosoftGraphListInfo.java | 106 +- .../fluent/models/MicrosoftGraphListItem.java | 222 +- .../models/MicrosoftGraphListItemVersion.java | 124 +- .../MicrosoftGraphLobbyBypassScope.java | 36 +- .../MicrosoftGraphLobbyBypassSettings.java | 101 +- .../models/MicrosoftGraphLocaleInfo.java | 98 +- .../fluent/models/MicrosoftGraphLocation.java | 149 +- .../models/MicrosoftGraphLocationType.java | 52 +- .../MicrosoftGraphLocationUniqueIdType.java | 32 +- .../models/MicrosoftGraphLookupColumn.java | 124 +- .../models/MicrosoftGraphMailFolder.java | 178 +- .../models/MicrosoftGraphMailboxSettings.java | 157 +- ...MicrosoftGraphManagedAppFlaggedReason.java | 20 +- .../MicrosoftGraphManagedAppOperation.java | 125 +- .../MicrosoftGraphManagedAppPolicy.java | 135 +- .../MicrosoftGraphManagedAppRegistration.java | 242 +- .../models/MicrosoftGraphManagedDevice.java | 614 +++-- .../MicrosoftGraphManagedDeviceOwnerType.java | 24 +- ...nagedDevicePartnerReportedHealthState.java | 64 +- .../MicrosoftGraphManagementAgentType.java | 72 +- .../models/MicrosoftGraphMdmAuthority.java | 28 +- .../MicrosoftGraphMeetingParticipantInfo.java | 110 +- .../MicrosoftGraphMeetingParticipants.java | 102 +- .../fluent/models/MicrosoftGraphMessage.java | 418 ++- .../MicrosoftGraphMessageActionFlag.java | 56 +- .../models/MicrosoftGraphMessageRule.java | 152 +- .../MicrosoftGraphMessageRuleActions.java | 189 +- .../MicrosoftGraphMessageRulePredicates.java | 378 ++- ...GraphMultiValueLegacyExtendedProperty.java | 100 +- .../fluent/models/MicrosoftGraphNotebook.java | 205 +- .../models/MicrosoftGraphNotebookLinks.java | 99 +- .../models/MicrosoftGraphNumberColumn.java | 114 +- .../MicrosoftGraphOAuth2PermissionGrant.java | 127 +- .../models/MicrosoftGraphObjectIdentity.java | 106 +- .../MicrosoftGraphOfferShiftRequest.java | 217 +- .../MicrosoftGraphOfficeGraphInsights.java | 117 +- ...oftGraphOnPremisesExtensionAttributes.java | 208 +- ...osoftGraphOnPremisesProvisioningError.java | 126 +- .../fluent/models/MicrosoftGraphOnenote.java | 156 +- .../MicrosoftGraphOnenoteEntityBaseModel.java | 95 +- ...osoftGraphOnenoteEntityHierarchyModel.java | 147 +- ...ftGraphOnenoteEntitySchemaObjectModel.java | 110 +- .../MicrosoftGraphOnenoteOperation.java | 148 +- .../MicrosoftGraphOnenoteOperationError.java | 100 +- .../models/MicrosoftGraphOnenotePage.java | 200 +- .../MicrosoftGraphOnenotePagePreview.java | 100 +- ...MicrosoftGraphOnenotePagePreviewLinks.java | 93 +- .../MicrosoftGraphOnenotePatchActionType.java | 32 +- ...rosoftGraphOnenotePatchContentCommand.java | 121 +- ...rosoftGraphOnenotePatchInsertPosition.java | 20 +- .../models/MicrosoftGraphOnenoteResource.java | 112 +- .../models/MicrosoftGraphOnenoteSection.java | 190 +- .../MicrosoftGraphOnenoteSourceService.java | 32 +- .../models/MicrosoftGraphOnenoteUserRole.java | 28 +- .../models/MicrosoftGraphOnlineMeeting.java | 214 +- .../MicrosoftGraphOnlineMeetingInfo.java | 135 +- ...MicrosoftGraphOnlineMeetingPresenters.java | 32 +- ...crosoftGraphOnlineMeetingProviderType.java | 28 +- .../MicrosoftGraphOnlineMeetingRole.java | 24 +- .../models/MicrosoftGraphOpenShift.java | 139 +- .../MicrosoftGraphOpenShiftChangeRequest.java | 189 +- .../models/MicrosoftGraphOpenShiftItem.java | 138 +- .../models/MicrosoftGraphOperation.java | 119 +- .../models/MicrosoftGraphOperationError.java | 98 +- .../models/MicrosoftGraphOperationStatus.java | 28 +- .../models/MicrosoftGraphOptionalClaim.java | 116 +- .../models/MicrosoftGraphOptionalClaims.java | 112 +- .../models/MicrosoftGraphOrgContactInner.java | 287 +- .../models/MicrosoftGraphOrganization.java | 348 ++- .../models/MicrosoftGraphOutlookCategory.java | 104 +- .../MicrosoftGraphOutlookGeoCoordinates.java | 129 +- .../models/MicrosoftGraphOutlookItem.java | 127 +- .../models/MicrosoftGraphOutlookUser.java | 97 +- .../fluent/models/MicrosoftGraphPackage.java | 90 +- .../models/MicrosoftGraphPageLinks.java | 98 +- ...MicrosoftGraphParentalControlSettings.java | 111 +- ...MicrosoftGraphPasswordCredentialInner.java | 154 +- .../models/MicrosoftGraphPasswordProfile.java | 127 +- .../MicrosoftGraphPatternedRecurrence.java | 101 +- .../MicrosoftGraphPendingContentUpdate.java | 95 +- .../MicrosoftGraphPendingOperations.java | 96 +- .../models/MicrosoftGraphPermission.java | 172 +- ...softGraphPermissionClassificationType.java | 32 +- .../models/MicrosoftGraphPermissionScope.java | 185 +- .../fluent/models/MicrosoftGraphPerson.java | 252 +- .../MicrosoftGraphPersonOrGroupColumn.java | 108 +- .../models/MicrosoftGraphPersonType.java | 98 +- .../fluent/models/MicrosoftGraphPhone.java | 114 +- .../models/MicrosoftGraphPhoneType.java | 52 +- .../fluent/models/MicrosoftGraphPhoto.java | 158 +- .../models/MicrosoftGraphPhysicalAddress.java | 123 +- .../MicrosoftGraphPhysicalOfficeAddress.java | 132 +- ...hPlannerAssignedToTaskBoardTaskFormat.java | 118 +- .../models/MicrosoftGraphPlannerBucket.java | 120 +- ...GraphPlannerBucketTaskBoardTaskFormat.java | 99 +- ...osoftGraphPlannerCategoryDescriptions.java | 136 +- .../models/MicrosoftGraphPlannerGroup.java | 96 +- .../models/MicrosoftGraphPlannerPlan.java | 150 +- .../MicrosoftGraphPlannerPlanDetails.java | 111 +- .../MicrosoftGraphPlannerPreviewType.java | 32 +- ...aphPlannerProgressTaskBoardTaskFormat.java | 102 +- .../models/MicrosoftGraphPlannerTask.java | 316 ++- .../MicrosoftGraphPlannerTaskDetails.java | 125 +- .../models/MicrosoftGraphPlannerUser.java | 106 +- .../models/MicrosoftGraphPolicyBase.java | 113 +- .../MicrosoftGraphPolicyPlatformType.java | 44 +- .../fluent/models/MicrosoftGraphPost.java | 248 +- ...icrosoftGraphPreAuthorizedApplication.java | 102 +- .../fluent/models/MicrosoftGraphPresence.java | 106 +- .../models/MicrosoftGraphPrivacyProfile.java | 98 +- .../models/MicrosoftGraphProfilePhoto.java | 102 +- .../models/MicrosoftGraphProvisionedPlan.java | 107 +- ...MicrosoftGraphPublicClientApplication.java | 93 +- .../models/MicrosoftGraphPublicError.java | 124 +- .../MicrosoftGraphPublicErrorDetail.java | 107 +- .../MicrosoftGraphPublicInnerError.java | 117 +- .../MicrosoftGraphPublicationFacet.java | 99 +- .../fluent/models/MicrosoftGraphQuota.java | 131 +- .../models/MicrosoftGraphRecentNotebook.java | 121 +- .../MicrosoftGraphRecentNotebookLinks.java | 101 +- .../models/MicrosoftGraphRecipient.java | 90 +- .../MicrosoftGraphRecurrencePattern.java | 156 +- .../MicrosoftGraphRecurrencePatternType.java | 36 +- .../models/MicrosoftGraphRecurrenceRange.java | 134 +- .../MicrosoftGraphRecurrenceRangeType.java | 24 +- .../models/MicrosoftGraphRemoteItem.java | 242 +- .../MicrosoftGraphRequiredResourceAccess.java | 107 +- .../models/MicrosoftGraphResourceAccess.java | 100 +- .../MicrosoftGraphResourceReference.java | 107 +- ...tGraphResourceSpecificPermissionGrant.java | 142 +- .../MicrosoftGraphResourceVisualization.java | 151 +- .../models/MicrosoftGraphResponseStatus.java | 107 +- .../models/MicrosoftGraphResponseType.java | 36 +- ...icrosoftGraphSamlSingleSignOnSettings.java | 92 +- .../fluent/models/MicrosoftGraphSchedule.java | 277 +- .../MicrosoftGraphScheduleChangeRequest.java | 189 +- ...rosoftGraphScheduleChangeRequestActor.java | 36 +- .../MicrosoftGraphScheduleChangeState.java | 28 +- .../models/MicrosoftGraphScheduleEntity.java | 113 +- .../MicrosoftGraphScheduleEntityTheme.java | 64 +- .../MicrosoftGraphScheduleInformation.java | 126 +- .../models/MicrosoftGraphScheduleItem.java | 131 +- .../models/MicrosoftGraphSchedulingGroup.java | 145 +- .../MicrosoftGraphScopedRoleMembership.java | 112 +- .../MicrosoftGraphScoredEmailAddress.java | 122 +- .../models/MicrosoftGraphSearchResult.java | 90 +- .../models/MicrosoftGraphSectionGroup.java | 190 +- .../models/MicrosoftGraphSectionLinks.java | 99 +- ...MicrosoftGraphSelectionLikelihoodInfo.java | 20 +- .../models/MicrosoftGraphSensitivity.java | 28 +- .../models/MicrosoftGraphServicePlanInfo.java | 117 +- .../MicrosoftGraphServicePrincipalInner.java | 590 +++-- .../models/MicrosoftGraphSettingSource.java | 98 +- .../models/MicrosoftGraphSettingValue.java | 98 +- .../fluent/models/MicrosoftGraphShared.java | 118 +- .../models/MicrosoftGraphSharedInsight.java | 143 +- .../models/MicrosoftGraphSharepointIds.java | 138 +- .../models/MicrosoftGraphSharingDetail.java | 127 +- .../MicrosoftGraphSharingInvitation.java | 116 +- .../models/MicrosoftGraphSharingLink.java | 130 +- .../fluent/models/MicrosoftGraphShift.java | 147 +- .../models/MicrosoftGraphShiftActivity.java | 137 +- .../MicrosoftGraphShiftAvailability.java | 110 +- .../models/MicrosoftGraphShiftItem.java | 133 +- .../MicrosoftGraphShiftPreferences.java | 127 +- ...raphSingleValueLegacyExtendedProperty.java | 99 +- .../fluent/models/MicrosoftGraphSite.java | 296 ++- .../models/MicrosoftGraphSiteCollection.java | 109 +- .../models/MicrosoftGraphSizeRange.java | 98 +- .../models/MicrosoftGraphSpecialFolder.java | 90 +- .../fluent/models/MicrosoftGraphStatus.java | 32 +- .../MicrosoftGraphStoragePlanInformation.java | 93 +- .../models/MicrosoftGraphStsPolicy.java | 143 +- .../models/MicrosoftGraphSubscribedSku.java | 147 +- .../models/MicrosoftGraphSubscription.java | 199 +- ...MicrosoftGraphSwapShiftsChangeRequest.java | 221 +- .../models/MicrosoftGraphTaskStatus.java | 32 +- .../models/MicrosoftGraphTeamFunSettings.java | 119 +- .../MicrosoftGraphTeamGuestSettings.java | 101 +- .../models/MicrosoftGraphTeamInner.java | 274 +- .../MicrosoftGraphTeamMemberSettings.java | 141 +- .../MicrosoftGraphTeamMessagingSettings.java | 137 +- .../MicrosoftGraphTeamSpecialization.java | 52 +- .../MicrosoftGraphTeamVisibilityType.java | 28 +- .../fluent/models/MicrosoftGraphTeamsApp.java | 123 +- .../MicrosoftGraphTeamsAppDefinition.java | 111 +- ...rosoftGraphTeamsAppDistributionMethod.java | 32 +- .../MicrosoftGraphTeamsAppInstallation.java | 108 +- .../MicrosoftGraphTeamsAsyncOperation.java | 162 +- ...crosoftGraphTeamsAsyncOperationStatus.java | 36 +- ...MicrosoftGraphTeamsAsyncOperationType.java | 36 +- .../fluent/models/MicrosoftGraphTeamsTab.java | 119 +- .../MicrosoftGraphTeamsTabConfiguration.java | 116 +- .../models/MicrosoftGraphTeamsTemplate.java | 85 +- .../models/MicrosoftGraphTextColumn.java | 124 +- .../models/MicrosoftGraphThumbnail.java | 124 +- .../models/MicrosoftGraphThumbnailSet.java | 118 +- .../fluent/models/MicrosoftGraphTimeOff.java | 139 +- .../models/MicrosoftGraphTimeOffItem.java | 115 +- .../models/MicrosoftGraphTimeOffReason.java | 141 +- .../MicrosoftGraphTimeOffReasonIconType.java | 100 +- .../models/MicrosoftGraphTimeOffRequest.java | 208 +- .../models/MicrosoftGraphTimeRange.java | 98 +- .../fluent/models/MicrosoftGraphTimeSlot.java | 98 +- .../models/MicrosoftGraphTimeZoneBase.java | 90 +- .../fluent/models/MicrosoftGraphTodo.java | 96 +- .../fluent/models/MicrosoftGraphTodoTask.java | 220 +- .../models/MicrosoftGraphTodoTaskList.java | 140 +- .../MicrosoftGraphTokenIssuancePolicy.java | 136 +- .../MicrosoftGraphTokenLifetimePolicy.java | 136 +- .../fluent/models/MicrosoftGraphTrending.java | 134 +- .../models/MicrosoftGraphUploadSession.java | 114 +- .../models/MicrosoftGraphUsageDetails.java | 108 +- .../models/MicrosoftGraphUsedInsight.java | 124 +- .../models/MicrosoftGraphUserActivity.java | 215 +- .../models/MicrosoftGraphUserInner.java | 1194 ++++++--- ...oftGraphUserScopeTeamsAppInstallation.java | 119 +- .../models/MicrosoftGraphUserSettings.java | 125 +- .../models/MicrosoftGraphUserTeamwork.java | 100 +- .../models/MicrosoftGraphVerifiedDomain.java | 122 +- .../fluent/models/MicrosoftGraphVideo.java | 162 +- .../models/MicrosoftGraphVisualInfo.java | 125 +- .../models/MicrosoftGraphWebApplication.java | 120 +- .../fluent/models/MicrosoftGraphWebsite.java | 106 +- .../models/MicrosoftGraphWebsiteType.java | 32 +- .../models/MicrosoftGraphWeekIndex.java | 32 +- .../MicrosoftGraphWellknownListName.java | 28 +- .../fluent/models/MicrosoftGraphWorkbook.java | 152 +- .../MicrosoftGraphWorkbookApplication.java | 98 +- .../models/MicrosoftGraphWorkbookChart.java | 187 +- ...MicrosoftGraphWorkbookChartAreaFormat.java | 105 +- .../MicrosoftGraphWorkbookChartAxes.java | 114 +- .../MicrosoftGraphWorkbookChartAxis.java | 164 +- ...MicrosoftGraphWorkbookChartAxisFormat.java | 105 +- .../MicrosoftGraphWorkbookChartAxisTitle.java | 113 +- ...softGraphWorkbookChartAxisTitleFormat.java | 100 +- ...softGraphWorkbookChartDataLabelFormat.java | 109 +- ...MicrosoftGraphWorkbookChartDataLabels.java | 166 +- .../MicrosoftGraphWorkbookChartFill.java | 86 +- .../MicrosoftGraphWorkbookChartFont.java | 135 +- .../MicrosoftGraphWorkbookChartGridlines.java | 105 +- ...softGraphWorkbookChartGridlinesFormat.java | 100 +- .../MicrosoftGraphWorkbookChartLegend.java | 120 +- ...crosoftGraphWorkbookChartLegendFormat.java | 105 +- ...MicrosoftGraphWorkbookChartLineFormat.java | 95 +- .../MicrosoftGraphWorkbookChartPoint.java | 107 +- ...icrosoftGraphWorkbookChartPointFormat.java | 96 +- .../MicrosoftGraphWorkbookChartSeries.java | 114 +- ...crosoftGraphWorkbookChartSeriesFormat.java | 105 +- .../MicrosoftGraphWorkbookChartTitle.java | 120 +- ...icrosoftGraphWorkbookChartTitleFormat.java | 105 +- .../models/MicrosoftGraphWorkbookComment.java | 113 +- .../MicrosoftGraphWorkbookCommentReply.java | 103 +- .../models/MicrosoftGraphWorkbookFilter.java | 95 +- .../MicrosoftGraphWorkbookFilterCriteria.java | 151 +- .../MicrosoftGraphWorkbookFunctions.java | 86 +- .../models/MicrosoftGraphWorkbookIcon.java | 98 +- .../MicrosoftGraphWorkbookNamedItem.java | 147 +- .../MicrosoftGraphWorkbookOperation.java | 113 +- .../MicrosoftGraphWorkbookOperationError.java | 109 +- ...MicrosoftGraphWorkbookOperationStatus.java | 28 +- .../MicrosoftGraphWorkbookPivotTable.java | 104 +- .../MicrosoftGraphWorkbookSortField.java | 131 +- .../models/MicrosoftGraphWorkbookTable.java | 217 +- .../MicrosoftGraphWorkbookTableColumn.java | 123 +- .../MicrosoftGraphWorkbookTableRow.java | 106 +- .../MicrosoftGraphWorkbookTableSort.java | 113 +- .../MicrosoftGraphWorkbookWorksheet.java | 160 +- ...osoftGraphWorkbookWorksheetProtection.java | 115 +- ...aphWorkbookWorksheetProtectionOptions.java | 187 +- .../models/MicrosoftGraphWorkingHours.java | 117 +- .../fluent/models/OdataErrorMain.java | 163 +- .../models/OdataErrorMainException.java | 12 +- .../fluent/models/PermissionInner.java | 88 +- .../ProviderOperationsMetadataInner.java | 103 +- .../fluent/models/RoleAssignmentInner.java | 148 +- .../models/RoleAssignmentProperties.java | 158 +- .../models/RoleAssignmentScheduleInner.java | 141 +- .../RoleAssignmentScheduleInstanceInner.java | 155 +- ...eAssignmentScheduleInstanceProperties.java | 221 +- .../RoleAssignmentScheduleProperties.java | 210 +- .../RoleAssignmentScheduleRequestInner.java | 156 +- ...leAssignmentScheduleRequestProperties.java | 237 +- .../fluent/models/RoleDefinitionInner.java | 100 +- .../models/RoleDefinitionProperties.java | 117 +- .../models/RoleEligibilityScheduleInner.java | 133 +- .../RoleEligibilityScheduleInstanceInner.java | 131 +- ...EligibilityScheduleInstanceProperties.java | 178 +- .../RoleEligibilityScheduleProperties.java | 189 +- .../RoleEligibilityScheduleRequestInner.java | 149 +- ...eEligibilityScheduleRequestProperties.java | 225 +- .../RoleManagementPolicyAssignmentInner.java | 91 +- ...eManagementPolicyAssignmentProperties.java | 90 +- .../models/RoleManagementPolicyInner.java | 101 +- .../RoleManagementPolicyProperties.java | 119 +- ...rvicePrincipalsAddKeyRequestBodyInner.java | 114 +- ...PrincipalsAddPasswordRequestBodyInner.java | 101 +- ...rvicePrincipalsServicePrincipalExpand.java | 96 +- ...vicePrincipalsServicePrincipalOrderby.java | 392 ++- ...rvicePrincipalsServicePrincipalSelect.java | 268 +- .../fluent/models/package-info.java | 9 +- .../authorization/fluent/package-info.java | 9 +- .../ApplicationsApplicationsClientImpl.java | 735 ++---- .../ApplicationsClientImpl.java | 1956 +++++--------- .../AuthorizationManagementClientBuilder.java | 48 +- .../AuthorizationManagementClientImpl.java | 141 +- .../ClassicAdministratorsClientImpl.java | 179 +- .../DenyAssignmentsClientImpl.java | 1220 ++++----- .../DomainsDomainsClientImpl.java | 515 ++-- .../EligibleChildResourcesClientImpl.java | 205 +- .../GlobalAdministratorsClientImpl.java | 52 +- .../implementation/GroupsClientImpl.java | 992 +++---- .../GroupsGroupsClientImpl.java | 555 ++-- .../MicrosoftGraphClientBuilder.java | 41 +- .../MicrosoftGraphClientImpl.java | 86 +- .../implementation/PermissionsClientImpl.java | 443 +--- ...ProviderOperationsMetadatasClientImpl.java | 237 +- ...AssignmentScheduleInstancesClientImpl.java | 333 +-- ...eAssignmentScheduleRequestsClientImpl.java | 625 ++--- .../RoleAssignmentSchedulesClientImpl.java | 275 +- .../RoleAssignmentsClientImpl.java | 1542 +++++------ .../RoleDefinitionsClientImpl.java | 399 ++- ...ligibilityScheduleInstancesClientImpl.java | 333 +-- ...EligibilityScheduleRequestsClientImpl.java | 615 ++--- .../RoleEligibilitySchedulesClientImpl.java | 276 +- .../RoleManagementPoliciesClientImpl.java | 356 +-- ...ManagementPolicyAssignmentsClientImpl.java | 451 ++-- .../ServicePrincipalsClientImpl.java | 118 +- ...PrincipalsServicePrincipalsClientImpl.java | 629 ++--- .../implementation/UsersUsersClientImpl.java | 549 ++-- .../authorization/models/ApprovalMode.java | 28 +- .../models/ApprovalSettings.java | 95 +- .../authorization/models/ApprovalStage.java | 104 +- .../authorization/models/AssignmentType.java | 20 +- .../ClassicAdministratorListResult.java | 70 +- .../models/DenyAssignmentListResult.java | 69 +- .../models/DenyAssignmentPermission.java | 104 +- .../EligibleChildResourcesListResult.java | 70 +- .../authorization/models/EnablementRules.java | 24 +- .../models/ExpandedProperties.java | 75 +- .../models/ExpandedPropertiesPrincipal.java | 85 +- .../ExpandedPropertiesRoleDefinition.java | 76 +- .../models/ExpandedPropertiesScope.java | 75 +- .../authorization/models/MemberType.java | 24 +- .../models/NotificationDeliveryMechanism.java | 16 +- .../models/NotificationLevel.java | 24 +- .../models/PermissionGetResult.java | 68 +- .../models/PolicyAssignmentProperties.java | 76 +- .../PolicyAssignmentPropertiesPolicy.java | 79 +- ...icyAssignmentPropertiesRoleDefinition.java | 77 +- .../PolicyAssignmentPropertiesScope.java | 76 +- .../models/PolicyProperties.java | 56 +- .../models/PolicyPropertiesScope.java | 75 +- .../authorization/models/Principal.java | 85 +- .../authorization/models/PrincipalType.java | 32 +- .../models/ProviderOperation.java | 101 +- .../ProviderOperationsMetadataListResult.java | 71 +- .../authorization/models/RecipientType.java | 24 +- .../authorization/models/RequestType.java | 48 +- .../authorization/models/ResourceType.java | 77 +- .../RoleAssignmentCreateParameters.java | 113 +- .../models/RoleAssignmentListResult.java | 66 +- ...eAssignmentScheduleInstanceListResult.java | 71 +- .../RoleAssignmentScheduleListResult.java | 70 +- ...leAssignmentScheduleRequestListResult.java | 71 +- ...ScheduleRequestPropertiesScheduleInfo.java | 79 +- ...questPropertiesScheduleInfoExpiration.java | 85 +- ...ntScheduleRequestPropertiesTicketInfo.java | 69 +- .../models/RoleDefinitionListResult.java | 69 +- ...EligibilityScheduleInstanceListResult.java | 71 +- .../RoleEligibilityScheduleListResult.java | 70 +- ...eEligibilityScheduleRequestListResult.java | 71 +- ...ScheduleRequestPropertiesScheduleInfo.java | 79 +- ...questPropertiesScheduleInfoExpiration.java | 85 +- ...tyScheduleRequestPropertiesTicketInfo.java | 70 +- .../RoleManagementPolicyApprovalRule.java | 95 +- ...eManagementPolicyAssignmentListResult.java | 71 +- ...gementPolicyAuthenticationContextRule.java | 105 +- .../RoleManagementPolicyEnablementRule.java | 98 +- .../RoleManagementPolicyExpirationRule.java | 104 +- .../RoleManagementPolicyListResult.java | 70 +- .../RoleManagementPolicyNotificationRule.java | 136 +- .../models/RoleManagementPolicyRule.java | 140 +- .../RoleManagementPolicyRuleTarget.java | 107 +- .../models/RoleManagementPolicyRuleType.java | 52 +- .../authorization/models/Status.java | 100 +- .../authorization/models/Type.java | 24 +- .../authorization/models/UserSet.java | 85 +- .../authorization/models/UserType.java | 20 +- .../authorization/models/package-info.java | 9 +- .../authorization/package-info.java | 9 +- .../proxy-config.json | 2 +- .../reflect-config.json | 432 +-- .../proxy-config.json | 2 +- .../reflect-config.json | 2307 +---------------- .../ClassicAdministratorsListSamples.java | 13 +- .../DenyAssignmentsGetByIdSamples.java | 13 +- .../generated/DenyAssignmentsGetSamples.java | 17 +- ...AssignmentsListByResourceGroupSamples.java | 13 +- ...DenyAssignmentsListForResourceSamples.java | 23 +- .../DenyAssignmentsListForScopeSamples.java | 13 +- .../generated/DenyAssignmentsListSamples.java | 13 +- .../EligibleChildResourcesGetSamples.java | 19 +- ...obalAdministratorElevateAccessSamples.java | 13 +- ...PermissionsListByResourceGroupSamples.java | 13 +- .../PermissionsListForResourceSamples.java | 20 +- .../ProviderOperationsMetadataGetSamples.java | 17 +- ...ProviderOperationsMetadataListSamples.java | 17 +- ...AssignmentScheduleInstancesGetSamples.java | 19 +- ...tScheduleInstancesListForScopeSamples.java | 19 +- ...signmentScheduleRequestsCancelSamples.java | 19 +- ...signmentScheduleRequestsCreateSamples.java | 36 +- ...eAssignmentScheduleRequestsGetSamples.java | 19 +- ...ntScheduleRequestsListForScopeSamples.java | 19 +- ...gnmentScheduleRequestsValidateSamples.java | 40 +- .../RoleAssignmentSchedulesGetSamples.java | 19 +- ...ssignmentSchedulesListForScopeSamples.java | 19 +- .../RoleAssignmentsCreateByIdSamples.java | 13 +- .../RoleAssignmentsCreateSamples.java | 52 +- .../RoleAssignmentsDeleteByIdSamples.java | 16 +- .../RoleAssignmentsDeleteSamples.java | 20 +- .../RoleAssignmentsGetByIdSamples.java | 16 +- .../generated/RoleAssignmentsGetSamples.java | 20 +- ...AssignmentsListByResourceGroupSamples.java | 13 +- ...RoleAssignmentsListForResourceSamples.java | 21 +- .../RoleAssignmentsListForScopeSamples.java | 19 +- .../generated/RoleAssignmentsListSamples.java | 13 +- .../RoleDefinitionsCreateOrUpdateSamples.java | 17 +- .../RoleDefinitionsDeleteSamples.java | 13 +- .../RoleDefinitionsGetByIdSamples.java | 13 +- .../generated/RoleDefinitionsGetSamples.java | 13 +- .../generated/RoleDefinitionsListSamples.java | 13 +- ...ligibilityScheduleInstancesGetSamples.java | 19 +- ...yScheduleInstancesListForScopeSamples.java | 23 +- ...gibilityScheduleRequestsCancelSamples.java | 23 +- ...gibilityScheduleRequestsCreateSamples.java | 36 +- ...EligibilityScheduleRequestsGetSamples.java | 19 +- ...tyScheduleRequestsListForScopeSamples.java | 19 +- ...bilityScheduleRequestsValidateSamples.java | 40 +- .../RoleEligibilitySchedulesGetSamples.java | 19 +- ...igibilitySchedulesListForScopeSamples.java | 19 +- .../RoleManagementPoliciesDeleteSamples.java | 19 +- .../RoleManagementPoliciesGetSamples.java | 19 +- ...ManagementPoliciesListForScopeSamples.java | 20 +- .../RoleManagementPoliciesUpdateSamples.java | 251 +- ...agementPolicyAssignmentsCreateSamples.java | 16 +- ...agementPolicyAssignmentsDeleteSamples.java | 16 +- ...ManagementPolicyAssignmentsGetSamples.java | 16 +- ...tPolicyAssignmentsListForScopeSamples.java | 16 +- 663 files changed, 56739 insertions(+), 32863 deletions(-) diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsApplicationsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsApplicationsClient.java index 4f0092422e0f4..b93cd40bb37fa 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsApplicationsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsApplicationsClient.java @@ -22,11 +22,13 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ApplicationsApplicationsClient. */ +/** + * An instance of this class provides access to all the operations defined in ApplicationsApplicationsClient. + */ public interface ApplicationsApplicationsClient { /** * Get entities from applications. - * + * * @param consistencyLevel Indicates the requested consistency level. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -38,27 +40,20 @@ public interface ApplicationsApplicationsClient { * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from applications as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listApplicationAsync( - String consistencyLevel, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, + PagedFlux listApplicationAsync(String consistencyLevel, Integer top, Integer skip, + String search, String filter, Boolean count, List orderby, List select, List expand); /** * Get entities from applications. - * + * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from applications as paginated response with {@link PagedFlux}. */ @@ -67,9 +62,9 @@ PagedFlux listApplicationAsync( /** * Get entities from applications. - * + * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from applications as paginated response with {@link PagedIterable}. */ @@ -78,7 +73,7 @@ PagedFlux listApplicationAsync( /** * Get entities from applications. - * + * * @param consistencyLevel Indicates the requested consistency level. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -91,44 +86,36 @@ PagedFlux listApplicationAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from applications as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listApplication( - String consistencyLevel, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand, - Context context); + PagedIterable listApplication(String consistencyLevel, Integer top, Integer skip, + String search, String filter, Boolean count, List orderby, List select, + List expand, Context context); /** * Add new entity to applications. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return application along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createApplicationWithResponseAsync( - MicrosoftGraphApplicationInner body); + Mono> + createApplicationWithResponseAsync(MicrosoftGraphApplicationInner body); /** * Add new entity to applications. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return application on successful completion of {@link Mono}. */ @@ -137,26 +124,26 @@ Mono> createApplicationWithResponseAsyn /** * Add new entity to applications. - * + * * @param body New entity. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return application along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createApplicationWithResponse( - MicrosoftGraphApplicationInner body, Context context); + Response createApplicationWithResponse(MicrosoftGraphApplicationInner body, + Context context); /** * Add new entity to applications. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return application. */ @@ -165,28 +152,28 @@ Response createApplicationWithResponse( /** * Get entity from applications by key. - * + * * @param applicationId key: id of application. * @param consistencyLevel Indicates the requested consistency level. * @param select Select properties to be returned. * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from applications by key along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getApplicationWithResponseAsync( - String applicationId, String consistencyLevel, List select, List expand); + Mono> getApplicationWithResponseAsync(String applicationId, + String consistencyLevel, List select, List expand); /** * Get entity from applications by key. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from applications by key on successful completion of {@link Mono}. */ @@ -195,7 +182,7 @@ Mono> getApplicationWithResponseAsync( /** * Get entity from applications by key. - * + * * @param applicationId key: id of application. * @param consistencyLevel Indicates the requested consistency level. * @param select Select properties to be returned. @@ -203,25 +190,21 @@ Mono> getApplicationWithResponseAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from applications by key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getApplicationWithResponse( - String applicationId, - String consistencyLevel, - List select, - List expand, - Context context); + Response getApplicationWithResponse(String applicationId, String consistencyLevel, + List select, List expand, Context context); /** * Get entity from applications by key. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from applications by key. */ @@ -230,12 +213,12 @@ Response getApplicationWithResponse( /** * Update entity in applications. - * + * * @param applicationId key: id of application. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -244,12 +227,12 @@ Response getApplicationWithResponse( /** * Update entity in applications. - * + * * @param applicationId key: id of application. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -258,28 +241,28 @@ Response getApplicationWithResponse( /** * Update entity in applications. - * + * * @param applicationId key: id of application. * @param body New property values. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateApplicationWithResponse( - String applicationId, MicrosoftGraphApplicationInner body, Context context); + Response updateApplicationWithResponse(String applicationId, MicrosoftGraphApplicationInner body, + Context context); /** * Update entity in applications. - * + * * @param applicationId key: id of application. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -287,12 +270,12 @@ Response updateApplicationWithResponse( /** * Delete entity from applications. - * + * * @param applicationId key: id of application. * @param ifMatch ETag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -301,11 +284,11 @@ Response updateApplicationWithResponse( /** * Delete entity from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -314,13 +297,13 @@ Response updateApplicationWithResponse( /** * Delete entity from applications. - * + * * @param applicationId key: id of application. * @param ifMatch ETag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -329,11 +312,11 @@ Response updateApplicationWithResponse( /** * Delete entity from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -341,25 +324,25 @@ Response updateApplicationWithResponse( /** * Get media content for application from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return media content for application from applications along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> getLogoWithResponseAsync(String applicationId); /** * Get media content for application from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return media content for application from applications on successful completion of {@link Mono}. */ @@ -368,12 +351,12 @@ Response updateApplicationWithResponse( /** * Get media content for application from applications. - * + * * @param applicationId key: id of application. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return media content for application from applications along with {@link Response}. */ @@ -382,11 +365,11 @@ Response updateApplicationWithResponse( /** * Get media content for application from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return media content for application from applications. */ @@ -395,13 +378,13 @@ Response updateApplicationWithResponse( /** * Update media content for application in applications. - * + * * @param applicationId key: id of application. * @param data New media content. * @param contentLength The Content-Length header for the request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -410,13 +393,13 @@ Response updateApplicationWithResponse( /** * Update media content for application in applications. - * + * * @param applicationId key: id of application. * @param data New media content. * @param contentLength The Content-Length header for the request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -425,30 +408,30 @@ Response updateApplicationWithResponse( /** * Update media content for application in applications. - * + * * @param applicationId key: id of application. * @param data New media content. * @param contentLength The Content-Length header for the request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response setLogoWithResponse( - String applicationId, Flux data, long contentLength, Context context); + Response setLogoWithResponse(String applicationId, Flux data, long contentLength, + Context context); /** * Update media content for application in applications. - * + * * @param applicationId key: id of application. * @param data New media content. * @param contentLength The Content-Length header for the request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -456,13 +439,13 @@ Response setLogoWithResponse( /** * Update media content for application in applications. - * + * * @param applicationId key: id of application. * @param data New media content. * @param contentLength The Content-Length header for the request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -471,13 +454,13 @@ Response setLogoWithResponse( /** * Update media content for application in applications. - * + * * @param applicationId key: id of application. * @param data New media content. * @param contentLength The Content-Length header for the request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -486,14 +469,14 @@ Response setLogoWithResponse( /** * Update media content for application in applications. - * + * * @param applicationId key: id of application. * @param data New media content. * @param contentLength The Content-Length header for the request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -502,13 +485,13 @@ Response setLogoWithResponse( /** * Update media content for application in applications. - * + * * @param applicationId key: id of application. * @param data New media content. * @param contentLength The Content-Length header for the request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsClient.java index b1d254d73cb3d..b7183b40ff58f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ApplicationsClient.java @@ -31,31 +31,33 @@ import java.util.Map; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ +/** + * An instance of this class provides access to all the operations defined in ApplicationsClient. + */ public interface ApplicationsClient { /** * Get createdOnBehalfOf from applications. - * + * * @param applicationId key: id of application. * @param select Select properties to be returned. * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return createdOnBehalfOf from applications along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getCreatedOnBehalfOfWithResponseAsync( - String applicationId, List select, List expand); + Mono> getCreatedOnBehalfOfWithResponseAsync(String applicationId, + List select, List expand); /** * Get createdOnBehalfOf from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return createdOnBehalfOf from applications on successful completion of {@link Mono}. */ @@ -64,28 +66,28 @@ Mono> getCreatedOnBehalfOfWithRespo /** * Get createdOnBehalfOf from applications. - * + * * @param applicationId key: id of application. * @param select Select properties to be returned. * @param expand Expand related entities. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return createdOnBehalfOf from applications along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getCreatedOnBehalfOfWithResponse( - String applicationId, List select, List expand, Context context); + Response getCreatedOnBehalfOfWithResponse(String applicationId, + List select, List expand, Context context); /** * Get createdOnBehalfOf from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return createdOnBehalfOf from applications. */ @@ -94,25 +96,25 @@ Response getCreatedOnBehalfOfWithResponse( /** * Get ref of createdOnBehalfOf from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ref of createdOnBehalfOf from applications along with {@link Response} on successful completion of {@link - * Mono}. + * @return ref of createdOnBehalfOf from applications along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> getRefCreatedOnBehalfOfWithResponseAsync(String applicationId); /** * Get ref of createdOnBehalfOf from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of createdOnBehalfOf from applications on successful completion of {@link Mono}. */ @@ -121,12 +123,12 @@ Response getCreatedOnBehalfOfWithResponse( /** * Get ref of createdOnBehalfOf from applications. - * + * * @param applicationId key: id of application. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of createdOnBehalfOf from applications along with {@link Response}. */ @@ -135,11 +137,11 @@ Response getCreatedOnBehalfOfWithResponse( /** * Get ref of createdOnBehalfOf from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of createdOnBehalfOf from applications. */ @@ -148,12 +150,12 @@ Response getCreatedOnBehalfOfWithResponse( /** * Update the ref of navigation property createdOnBehalfOf in applications. - * + * * @param applicationId key: id of application. * @param body New navigation property ref values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -162,12 +164,12 @@ Response getCreatedOnBehalfOfWithResponse( /** * Update the ref of navigation property createdOnBehalfOf in applications. - * + * * @param applicationId key: id of application. * @param body New navigation property ref values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -176,13 +178,13 @@ Response getCreatedOnBehalfOfWithResponse( /** * Update the ref of navigation property createdOnBehalfOf in applications. - * + * * @param applicationId key: id of application. * @param body New navigation property ref values. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -191,12 +193,12 @@ Response getCreatedOnBehalfOfWithResponse( /** * Update the ref of navigation property createdOnBehalfOf in applications. - * + * * @param applicationId key: id of application. * @param body New navigation property ref values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -204,12 +206,12 @@ Response getCreatedOnBehalfOfWithResponse( /** * Delete ref of navigation property createdOnBehalfOf for applications. - * + * * @param applicationId key: id of application. * @param ifMatch ETag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -218,11 +220,11 @@ Response getCreatedOnBehalfOfWithResponse( /** * Delete ref of navigation property createdOnBehalfOf for applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -231,13 +233,13 @@ Response getCreatedOnBehalfOfWithResponse( /** * Delete ref of navigation property createdOnBehalfOf for applications. - * + * * @param applicationId key: id of application. * @param ifMatch ETag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -246,11 +248,11 @@ Response getCreatedOnBehalfOfWithResponse( /** * Delete ref of navigation property createdOnBehalfOf for applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -258,7 +260,7 @@ Response getCreatedOnBehalfOfWithResponse( /** * Get extensionProperties from applications. - * + * * @param applicationId key: id of application. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -270,29 +272,22 @@ Response getCreatedOnBehalfOfWithResponse( * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperties from applications as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listExtensionPropertiesAsync( - String applicationId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand); + PagedFlux listExtensionPropertiesAsync(String applicationId, Integer top, + Integer skip, String search, String filter, Boolean count, List orderby, + List select, List expand); /** * Get extensionProperties from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperties from applications as paginated response with {@link PagedFlux}. */ @@ -301,11 +296,11 @@ PagedFlux listExtensionPropertiesAsync( /** * Get extensionProperties from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperties from applications as paginated response with {@link PagedIterable}. */ @@ -314,7 +309,7 @@ PagedFlux listExtensionPropertiesAsync( /** * Get extensionProperties from applications. - * + * * @param applicationId key: id of application. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -327,120 +322,112 @@ PagedFlux listExtensionPropertiesAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperties from applications as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listExtensionProperties( - String applicationId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand, - Context context); + PagedIterable listExtensionProperties(String applicationId, Integer top, + Integer skip, String search, String filter, Boolean count, List orderby, + List select, List expand, Context context); /** * Create new navigation property to extensionProperties for applications. - * + * * @param applicationId key: id of application. * @param body New navigation property. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperty along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createExtensionPropertiesWithResponseAsync( - String applicationId, MicrosoftGraphExtensionPropertyInner body); + Mono> + createExtensionPropertiesWithResponseAsync(String applicationId, MicrosoftGraphExtensionPropertyInner body); /** * Create new navigation property to extensionProperties for applications. - * + * * @param applicationId key: id of application. * @param body New navigation property. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperty on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createExtensionPropertiesAsync( - String applicationId, MicrosoftGraphExtensionPropertyInner body); + Mono createExtensionPropertiesAsync(String applicationId, + MicrosoftGraphExtensionPropertyInner body); /** * Create new navigation property to extensionProperties for applications. - * + * * @param applicationId key: id of application. * @param body New navigation property. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperty along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createExtensionPropertiesWithResponse( - String applicationId, MicrosoftGraphExtensionPropertyInner body, Context context); + Response createExtensionPropertiesWithResponse(String applicationId, + MicrosoftGraphExtensionPropertyInner body, Context context); /** * Create new navigation property to extensionProperties for applications. - * + * * @param applicationId key: id of application. * @param body New navigation property. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperty. */ @ServiceMethod(returns = ReturnType.SINGLE) - MicrosoftGraphExtensionPropertyInner createExtensionProperties( - String applicationId, MicrosoftGraphExtensionPropertyInner body); + MicrosoftGraphExtensionPropertyInner createExtensionProperties(String applicationId, + MicrosoftGraphExtensionPropertyInner body); /** * Get extensionProperties from applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @param select Select properties to be returned. * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extensionProperties from applications along with {@link Response} on successful completion of {@link - * Mono}. + * @return extensionProperties from applications along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getExtensionPropertiesWithResponseAsync( - String applicationId, String extensionPropertyId, List select, List expand); + Mono> getExtensionPropertiesWithResponseAsync(String applicationId, + String extensionPropertyId, List select, List expand); /** * Get extensionProperties from applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperties from applications on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getExtensionPropertiesAsync( - String applicationId, String extensionPropertyId); + Mono getExtensionPropertiesAsync(String applicationId, + String extensionPropertyId); /** * Get extensionProperties from applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @param select Select properties to be returned. @@ -448,26 +435,22 @@ Mono getExtensionPropertiesAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperties from applications along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getExtensionPropertiesWithResponse( - String applicationId, - String extensionPropertyId, - List select, - List expand, - Context context); + Response getExtensionPropertiesWithResponse(String applicationId, + String extensionPropertyId, List select, List expand, Context context); /** * Get extensionProperties from applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return extensionProperties from applications. */ @@ -476,92 +459,92 @@ Response getExtensionPropertiesWithRespons /** * Update the navigation property extensionProperties in applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @param body New navigation property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateExtensionPropertiesWithResponseAsync( - String applicationId, String extensionPropertyId, MicrosoftGraphExtensionPropertyInner body); + Mono> updateExtensionPropertiesWithResponseAsync(String applicationId, String extensionPropertyId, + MicrosoftGraphExtensionPropertyInner body); /** * Update the navigation property extensionProperties in applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @param body New navigation property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateExtensionPropertiesAsync( - String applicationId, String extensionPropertyId, MicrosoftGraphExtensionPropertyInner body); + Mono updateExtensionPropertiesAsync(String applicationId, String extensionPropertyId, + MicrosoftGraphExtensionPropertyInner body); /** * Update the navigation property extensionProperties in applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @param body New navigation property values. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateExtensionPropertiesWithResponse( - String applicationId, String extensionPropertyId, MicrosoftGraphExtensionPropertyInner body, Context context); + Response updateExtensionPropertiesWithResponse(String applicationId, String extensionPropertyId, + MicrosoftGraphExtensionPropertyInner body, Context context); /** * Update the navigation property extensionProperties in applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @param body New navigation property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void updateExtensionProperties( - String applicationId, String extensionPropertyId, MicrosoftGraphExtensionPropertyInner body); + void updateExtensionProperties(String applicationId, String extensionPropertyId, + MicrosoftGraphExtensionPropertyInner body); /** * Delete navigation property extensionProperties for applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @param ifMatch ETag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteExtensionPropertiesWithResponseAsync( - String applicationId, String extensionPropertyId, String ifMatch); + Mono> deleteExtensionPropertiesWithResponseAsync(String applicationId, String extensionPropertyId, + String ifMatch); /** * Delete navigation property extensionProperties for applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -570,29 +553,29 @@ Mono> deleteExtensionPropertiesWithResponseAsync( /** * Delete navigation property extensionProperties for applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @param ifMatch ETag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteExtensionPropertiesWithResponse( - String applicationId, String extensionPropertyId, String ifMatch, Context context); + Response deleteExtensionPropertiesWithResponse(String applicationId, String extensionPropertyId, + String ifMatch, Context context); /** * Delete navigation property extensionProperties for applications. - * + * * @param applicationId key: id of application. * @param extensionPropertyId key: id of extensionProperty. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -600,7 +583,7 @@ Response deleteExtensionPropertiesWithResponse( /** * Get homeRealmDiscoveryPolicies from applications. - * + * * @param applicationId key: id of application. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -612,29 +595,22 @@ Response deleteExtensionPropertiesWithResponse( * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return homeRealmDiscoveryPolicies from applications as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listHomeRealmDiscoveryPoliciesAsync( - String applicationId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand); + PagedFlux listHomeRealmDiscoveryPoliciesAsync(String applicationId, + Integer top, Integer skip, String search, String filter, Boolean count, List orderby, + List select, List expand); /** * Get homeRealmDiscoveryPolicies from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return homeRealmDiscoveryPolicies from applications as paginated response with {@link PagedFlux}. */ @@ -643,11 +619,11 @@ PagedFlux listHomeRealmDiscoveryPol /** * Get homeRealmDiscoveryPolicies from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return homeRealmDiscoveryPolicies from applications as paginated response with {@link PagedIterable}. */ @@ -656,7 +632,7 @@ PagedFlux listHomeRealmDiscoveryPol /** * Get homeRealmDiscoveryPolicies from applications. - * + * * @param applicationId key: id of application. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -669,26 +645,18 @@ PagedFlux listHomeRealmDiscoveryPol * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return homeRealmDiscoveryPolicies from applications as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listHomeRealmDiscoveryPolicies( - String applicationId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand, - Context context); + PagedIterable listHomeRealmDiscoveryPolicies(String applicationId, + Integer top, Integer skip, String search, String filter, Boolean count, List orderby, + List select, List expand, Context context); /** * Get ref of homeRealmDiscoveryPolicies from applications. - * + * * @param applicationId key: id of application. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -698,27 +666,21 @@ PagedIterable listHomeRealmDiscover * @param orderby Order items by property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of homeRealmDiscoveryPolicies from applications as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listRefHomeRealmDiscoveryPoliciesAsync( - String applicationId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby); + PagedFlux listRefHomeRealmDiscoveryPoliciesAsync(String applicationId, Integer top, Integer skip, + String search, String filter, Boolean count, List orderby); /** * Get ref of homeRealmDiscoveryPolicies from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of homeRealmDiscoveryPolicies from applications as paginated response with {@link PagedFlux}. */ @@ -727,11 +689,11 @@ PagedFlux listRefHomeRealmDiscoveryPoliciesAsync( /** * Get ref of homeRealmDiscoveryPolicies from applications. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of homeRealmDiscoveryPolicies from applications as paginated response with {@link PagedIterable}. */ @@ -740,7 +702,7 @@ PagedFlux listRefHomeRealmDiscoveryPoliciesAsync( /** * Get ref of homeRealmDiscoveryPolicies from applications. - * + * * @param applicationId key: id of application. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -751,44 +713,37 @@ PagedFlux listRefHomeRealmDiscoveryPoliciesAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of homeRealmDiscoveryPolicies from applications as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRefHomeRealmDiscoveryPolicies( - String applicationId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - Context context); + PagedIterable listRefHomeRealmDiscoveryPolicies(String applicationId, Integer top, Integer skip, + String search, String filter, Boolean count, List orderby, Context context); /** * Create new navigation property ref to homeRealmDiscoveryPolicies for applications. - * + * * @param applicationId key: id of application. * @param body New navigation property ref value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return dictionary of <AnyObject> along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createRefHomeRealmDiscoveryPoliciesWithResponseAsync( - String applicationId, Map body); + Mono>> createRefHomeRealmDiscoveryPoliciesWithResponseAsync(String applicationId, + Map body); /** * Create new navigation property ref to homeRealmDiscoveryPolicies for applications. - * + * * @param applicationId key: id of application. * @param body New navigation property ref value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return dictionary of <AnyObject> on successful completion of {@link Mono}. */ @@ -797,28 +752,28 @@ Mono>> createRefHomeRealmDiscoveryPoliciesWithRespo /** * Create new navigation property ref to homeRealmDiscoveryPolicies for applications. - * + * * @param applicationId key: id of application. * @param body New navigation property ref value. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return dictionary of <AnyObject> along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response> createRefHomeRealmDiscoveryPoliciesWithResponse( - String applicationId, Map body, Context context); + Response> createRefHomeRealmDiscoveryPoliciesWithResponse(String applicationId, + Map body, Context context); /** * Create new navigation property ref to homeRealmDiscoveryPolicies for applications. - * + * * @param applicationId key: id of application. * @param body New navigation property ref value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return dictionary of <AnyObject>. */ @@ -827,27 +782,27 @@ Response> createRefHomeRealmDiscoveryPoliciesWithResponse( /** * Invoke action addKey. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keyCredential along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addKeyWithResponseAsync( - String applicationId, ApplicationsAddKeyRequestBodyInner body); + Mono> addKeyWithResponseAsync(String applicationId, + ApplicationsAddKeyRequestBodyInner body); /** * Invoke action addKey. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keyCredential on successful completion of {@link Mono}. */ @@ -856,28 +811,28 @@ Mono> addKeyWithResponseAsync( /** * Invoke action addKey. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keyCredential along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response addKeyWithResponse( - String applicationId, ApplicationsAddKeyRequestBodyInner body, Context context); + Response addKeyWithResponse(String applicationId, + ApplicationsAddKeyRequestBodyInner body, Context context); /** * Invoke action addKey. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keyCredential. */ @@ -886,89 +841,89 @@ Response addKeyWithResponse( /** * Invoke action addPassword. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return passwordCredential along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addPasswordWithResponseAsync( - String applicationId, ApplicationsAddPasswordRequestBodyInner body); + Mono> addPasswordWithResponseAsync(String applicationId, + ApplicationsAddPasswordRequestBodyInner body); /** * Invoke action addPassword. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return passwordCredential on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono addPasswordAsync( - String applicationId, ApplicationsAddPasswordRequestBodyInner body); + Mono addPasswordAsync(String applicationId, + ApplicationsAddPasswordRequestBodyInner body); /** * Invoke action addPassword. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return passwordCredential along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response addPasswordWithResponse( - String applicationId, ApplicationsAddPasswordRequestBodyInner body, Context context); + Response addPasswordWithResponse(String applicationId, + ApplicationsAddPasswordRequestBodyInner body, Context context); /** * Invoke action addPassword. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return passwordCredential. */ @ServiceMethod(returns = ReturnType.SINGLE) - MicrosoftGraphPasswordCredentialInner addPassword( - String applicationId, ApplicationsAddPasswordRequestBodyInner body); + MicrosoftGraphPasswordCredentialInner addPassword(String applicationId, + ApplicationsAddPasswordRequestBodyInner body); /** * Invoke action checkMemberGroups. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of Post200ApplicationJsonItemsItem along with {@link Response} on successful completion of {@link - * Mono}. + * @return array of Post200ApplicationJsonItemsItem along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> checkMemberGroupsWithResponseAsync( - String applicationId, ApplicationsCheckMemberGroupsRequestBody body); + Mono>> checkMemberGroupsWithResponseAsync(String applicationId, + ApplicationsCheckMemberGroupsRequestBody body); /** * Invoke action checkMemberGroups. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of Post200ApplicationJsonItemsItem on successful completion of {@link Mono}. */ @@ -977,28 +932,28 @@ Mono>> checkMemberGroupsWithResponseAsync( /** * Invoke action checkMemberGroups. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of Post200ApplicationJsonItemsItem along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response> checkMemberGroupsWithResponse( - String applicationId, ApplicationsCheckMemberGroupsRequestBody body, Context context); + Response> checkMemberGroupsWithResponse(String applicationId, + ApplicationsCheckMemberGroupsRequestBody body, Context context); /** * Invoke action checkMemberGroups. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of Post200ApplicationJsonItemsItem. */ @@ -1007,27 +962,27 @@ Response> checkMemberGroupsWithResponse( /** * Invoke action checkMemberObjects. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> checkMemberObjectsWithResponseAsync( - String applicationId, ApplicationsCheckMemberObjectsRequestBody body); + Mono>> checkMemberObjectsWithResponseAsync(String applicationId, + ApplicationsCheckMemberObjectsRequestBody body); /** * Invoke action checkMemberObjects. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String on successful completion of {@link Mono}. */ @@ -1036,28 +991,28 @@ Mono>> checkMemberObjectsWithResponseAsync( /** * Invoke action checkMemberObjects. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response> checkMemberObjectsWithResponse( - String applicationId, ApplicationsCheckMemberObjectsRequestBody body, Context context); + Response> checkMemberObjectsWithResponse(String applicationId, + ApplicationsCheckMemberObjectsRequestBody body, Context context); /** * Invoke action checkMemberObjects. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String. */ @@ -1066,27 +1021,27 @@ Response> checkMemberObjectsWithResponse( /** * Invoke action getMemberGroups. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getMemberGroupsWithResponseAsync( - String applicationId, ApplicationsGetMemberGroupsRequestBody body); + Mono>> getMemberGroupsWithResponseAsync(String applicationId, + ApplicationsGetMemberGroupsRequestBody body); /** * Invoke action getMemberGroups. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String on successful completion of {@link Mono}. */ @@ -1095,28 +1050,28 @@ Mono>> getMemberGroupsWithResponseAsync( /** * Invoke action getMemberGroups. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response> getMemberGroupsWithResponse( - String applicationId, ApplicationsGetMemberGroupsRequestBody body, Context context); + Response> getMemberGroupsWithResponse(String applicationId, + ApplicationsGetMemberGroupsRequestBody body, Context context); /** * Invoke action getMemberGroups. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String. */ @@ -1125,27 +1080,27 @@ Response> getMemberGroupsWithResponse( /** * Invoke action getMemberObjects. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> getMemberObjectsWithResponseAsync( - String applicationId, ApplicationsGetMemberObjectsRequestBody body); + Mono>> getMemberObjectsWithResponseAsync(String applicationId, + ApplicationsGetMemberObjectsRequestBody body); /** * Invoke action getMemberObjects. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String on successful completion of {@link Mono}. */ @@ -1154,28 +1109,28 @@ Mono>> getMemberObjectsWithResponseAsync( /** * Invoke action getMemberObjects. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response> getMemberObjectsWithResponse( - String applicationId, ApplicationsGetMemberObjectsRequestBody body, Context context); + Response> getMemberObjectsWithResponse(String applicationId, + ApplicationsGetMemberObjectsRequestBody body, Context context); /** * Invoke action getMemberObjects. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return array of String. */ @@ -1184,12 +1139,12 @@ Response> getMemberObjectsWithResponse( /** * Invoke action removeKey. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -1198,12 +1153,12 @@ Response> getMemberObjectsWithResponse( /** * Invoke action removeKey. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -1212,13 +1167,13 @@ Response> getMemberObjectsWithResponse( /** * Invoke action removeKey. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -1227,12 +1182,12 @@ Response> getMemberObjectsWithResponse( /** * Invoke action removeKey. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1240,27 +1195,27 @@ Response> getMemberObjectsWithResponse( /** * Invoke action removePassword. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> removePasswordWithResponseAsync( - String applicationId, ApplicationsRemovePasswordRequestBody body); + Mono> removePasswordWithResponseAsync(String applicationId, + ApplicationsRemovePasswordRequestBody body); /** * Invoke action removePassword. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -1269,28 +1224,28 @@ Mono> removePasswordWithResponseAsync( /** * Invoke action removePassword. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response removePasswordWithResponse( - String applicationId, ApplicationsRemovePasswordRequestBody body, Context context); + Response removePasswordWithResponse(String applicationId, ApplicationsRemovePasswordRequestBody body, + Context context); /** * Invoke action removePassword. - * + * * @param applicationId key: id of application. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1298,11 +1253,11 @@ Response removePasswordWithResponse( /** * Invoke action restore. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return directoryObject along with {@link Response} on successful completion of {@link Mono}. */ @@ -1311,11 +1266,11 @@ Response removePasswordWithResponse( /** * Invoke action restore. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return directoryObject on successful completion of {@link Mono}. */ @@ -1324,12 +1279,12 @@ Response removePasswordWithResponse( /** * Invoke action restore. - * + * * @param applicationId key: id of application. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return directoryObject along with {@link Response}. */ @@ -1338,11 +1293,11 @@ Response removePasswordWithResponse( /** * Invoke action restore. - * + * * @param applicationId key: id of application. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return directoryObject. */ diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/AuthorizationManagementClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/AuthorizationManagementClient.java index b51eeddd6a8d0..83e910a2f1002 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/AuthorizationManagementClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/AuthorizationManagementClient.java @@ -7,144 +7,146 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for AuthorizationManagementClient class. */ +/** + * The interface for AuthorizationManagementClient class. + */ public interface AuthorizationManagementClient { /** * Gets The ID of the target subscription. - * + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** * Gets the ClassicAdministratorsClient object to access its operations. - * + * * @return the ClassicAdministratorsClient object. */ ClassicAdministratorsClient getClassicAdministrators(); /** * Gets the GlobalAdministratorsClient object to access its operations. - * + * * @return the GlobalAdministratorsClient object. */ GlobalAdministratorsClient getGlobalAdministrators(); /** * Gets the DenyAssignmentsClient object to access its operations. - * + * * @return the DenyAssignmentsClient object. */ DenyAssignmentsClient getDenyAssignments(); /** * Gets the ProviderOperationsMetadatasClient object to access its operations. - * + * * @return the ProviderOperationsMetadatasClient object. */ ProviderOperationsMetadatasClient getProviderOperationsMetadatas(); /** * Gets the RoleAssignmentsClient object to access its operations. - * + * * @return the RoleAssignmentsClient object. */ RoleAssignmentsClient getRoleAssignments(); /** * Gets the PermissionsClient object to access its operations. - * + * * @return the PermissionsClient object. */ PermissionsClient getPermissions(); /** * Gets the RoleDefinitionsClient object to access its operations. - * + * * @return the RoleDefinitionsClient object. */ RoleDefinitionsClient getRoleDefinitions(); /** * Gets the EligibleChildResourcesClient object to access its operations. - * + * * @return the EligibleChildResourcesClient object. */ EligibleChildResourcesClient getEligibleChildResources(); /** * Gets the RoleAssignmentSchedulesClient object to access its operations. - * + * * @return the RoleAssignmentSchedulesClient object. */ RoleAssignmentSchedulesClient getRoleAssignmentSchedules(); /** * Gets the RoleAssignmentScheduleInstancesClient object to access its operations. - * + * * @return the RoleAssignmentScheduleInstancesClient object. */ RoleAssignmentScheduleInstancesClient getRoleAssignmentScheduleInstances(); /** * Gets the RoleAssignmentScheduleRequestsClient object to access its operations. - * + * * @return the RoleAssignmentScheduleRequestsClient object. */ RoleAssignmentScheduleRequestsClient getRoleAssignmentScheduleRequests(); /** * Gets the RoleEligibilitySchedulesClient object to access its operations. - * + * * @return the RoleEligibilitySchedulesClient object. */ RoleEligibilitySchedulesClient getRoleEligibilitySchedules(); /** * Gets the RoleEligibilityScheduleInstancesClient object to access its operations. - * + * * @return the RoleEligibilityScheduleInstancesClient object. */ RoleEligibilityScheduleInstancesClient getRoleEligibilityScheduleInstances(); /** * Gets the RoleEligibilityScheduleRequestsClient object to access its operations. - * + * * @return the RoleEligibilityScheduleRequestsClient object. */ RoleEligibilityScheduleRequestsClient getRoleEligibilityScheduleRequests(); /** * Gets the RoleManagementPoliciesClient object to access its operations. - * + * * @return the RoleManagementPoliciesClient object. */ RoleManagementPoliciesClient getRoleManagementPolicies(); /** * Gets the RoleManagementPolicyAssignmentsClient object to access its operations. - * + * * @return the RoleManagementPolicyAssignmentsClient object. */ RoleManagementPolicyAssignmentsClient getRoleManagementPolicyAssignments(); diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ClassicAdministratorsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ClassicAdministratorsClient.java index b943773b48fdc..fae6220a6903e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ClassicAdministratorsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ClassicAdministratorsClient.java @@ -11,39 +11,41 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.authorization.fluent.models.ClassicAdministratorInner; -/** An instance of this class provides access to all the operations defined in ClassicAdministratorsClient. */ +/** + * An instance of this class provides access to all the operations defined in ClassicAdministratorsClient. + */ public interface ClassicAdministratorsClient { /** * Gets service administrator, account administrator, and co-administrators for the subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service administrator, account administrator, and co-administrators for the subscription as paginated - * response with {@link PagedFlux}. + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listAsync(); /** * Gets service administrator, account administrator, and co-administrators for the subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service administrator, account administrator, and co-administrators for the subscription as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Gets service administrator, account administrator, and co-administrators for the subscription. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return service administrator, account administrator, and co-administrators for the subscription as paginated - * response with {@link PagedIterable}. + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DenyAssignmentsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DenyAssignmentsClient.java index 927822d9e643d..0108b0475ed7e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DenyAssignmentsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DenyAssignmentsClient.java @@ -14,41 +14,38 @@ import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DenyAssignmentsClient. */ +/** + * An instance of this class provides access to all the operations defined in DenyAssignmentsClient. + */ public interface DenyAssignmentsClient extends InnerSupportsListing { /** * Gets deny assignments for a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type of the resource. * @param resourceName The name of the resource to get deny assignments for. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or - * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified - * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the - * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and - * below the scope for the specified principal. This filter is different from the principalId filter as it - * returns not only those deny assignments that contain the specified principal is the Principals list but also - * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when - * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it returns + * not only those deny assignments that contain the specified principal is the Principals list but also those deny + * assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return deny assignments for a resource as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter); + PagedFlux listForResourceAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String filter); /** * Gets deny assignments for a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. @@ -60,16 +57,12 @@ PagedFlux listForResourceAsync( * @return deny assignments for a resource as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); + PagedFlux listForResourceAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName); /** * Gets deny assignments for a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. @@ -81,29 +74,25 @@ PagedFlux listForResourceAsync( * @return deny assignments for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); + PagedIterable listForResource(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName); /** * Gets deny assignments for a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. * @param resourceType The resource type of the resource. * @param resourceName The name of the resource to get deny assignments for. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or - * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified - * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the - * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and - * below the scope for the specified principal. This filter is different from the principalId filter as it - * returns not only those deny assignments that contain the specified principal is the Principals list but also - * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when - * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it returns + * not only those deny assignments that contain the specified principal is the Principals list but also those deny + * assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. * @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. @@ -111,27 +100,21 @@ PagedIterable listForResource( * @return deny assignments for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - String filter, - Context context); + PagedIterable listForResource(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, String filter, Context context); /** * Gets deny assignments for a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or - * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified - * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the - * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and - * below the scope for the specified principal. This filter is different from the principalId filter as it - * returns not only those deny assignments that contain the specified principal is the Principals list but also - * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when - * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it returns + * not only those deny assignments that contain the specified principal is the Principals list but also those deny + * assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. * @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. @@ -142,7 +125,7 @@ PagedIterable listForResource( /** * Gets deny assignments for a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -154,7 +137,7 @@ PagedIterable listForResource( /** * Gets deny assignments for a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -166,16 +149,16 @@ PagedIterable listForResource( /** * Gets deny assignments for a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or - * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified - * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the - * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and - * below the scope for the specified principal. This filter is different from the principalId filter as it - * returns not only those deny assignments that contain the specified principal is the Principals list but also - * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when - * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it returns + * not only those deny assignments that contain the specified principal is the Principals list but also those deny + * assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. * @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. @@ -187,15 +170,15 @@ PagedIterable listForResource( /** * Gets all deny assignments for the subscription. - * + * * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or - * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified - * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the - * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and - * below the scope for the specified principal. This filter is different from the principalId filter as it - * returns not only those deny assignments that contain the specified principal is the Principals list but also - * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when - * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it returns + * not only those deny assignments that contain the specified principal is the Principals list but also those deny + * assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. * @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. @@ -206,7 +189,7 @@ PagedIterable listForResource( /** * Gets all deny assignments for the subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all deny assignments for the subscription as paginated response with {@link PagedFlux}. @@ -216,7 +199,7 @@ PagedIterable listForResource( /** * Gets all deny assignments for the subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return all deny assignments for the subscription as paginated response with {@link PagedIterable}. @@ -226,15 +209,15 @@ PagedIterable listForResource( /** * Gets all deny assignments for the subscription. - * + * * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or - * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified - * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the - * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and - * below the scope for the specified principal. This filter is different from the principalId filter as it - * returns not only those deny assignments that contain the specified principal is the Principals list but also - * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when - * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it returns + * not only those deny assignments that contain the specified principal is the Principals list but also those deny + * assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. * @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. @@ -246,7 +229,7 @@ PagedIterable listForResource( /** * Get the specified deny assignment. - * + * * @param scope The scope of the deny assignment. * @param denyAssignmentId The ID of the deny assignment to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -259,7 +242,7 @@ PagedIterable listForResource( /** * Get the specified deny assignment. - * + * * @param scope The scope of the deny assignment. * @param denyAssignmentId The ID of the deny assignment to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -272,7 +255,7 @@ PagedIterable listForResource( /** * Get the specified deny assignment. - * + * * @param scope The scope of the deny assignment. * @param denyAssignmentId The ID of the deny assignment to get. * @param context The context to associate with this operation. @@ -286,7 +269,7 @@ PagedIterable listForResource( /** * Get the specified deny assignment. - * + * * @param scope The scope of the deny assignment. * @param denyAssignmentId The ID of the deny assignment to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -299,11 +282,11 @@ PagedIterable listForResource( /** * Gets a deny assignment by ID. - * + * * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription - * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant - * level deny assignments. + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription level + * deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny + * assignments. * @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. @@ -314,11 +297,11 @@ PagedIterable listForResource( /** * Gets a deny assignment by ID. - * + * * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription - * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant - * level deny assignments. + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription level + * deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny + * assignments. * @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. @@ -329,11 +312,11 @@ PagedIterable listForResource( /** * Gets a deny assignment by ID. - * + * * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription - * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant - * level deny assignments. + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription level + * deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny + * assignments. * @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. @@ -345,11 +328,11 @@ PagedIterable listForResource( /** * Gets a deny assignment by ID. - * + * * @param denyAssignmentId The fully qualified deny assignment ID. For example, use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription - * level deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant - * level deny assignments. + * /subscriptions/{guid}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for subscription level + * deny assignments, or /providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId} for tenant level deny + * assignments. * @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. @@ -360,16 +343,16 @@ PagedIterable listForResource( /** * Gets deny assignments for a scope. - * + * * @param scope The scope of the deny assignments. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or - * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified - * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the - * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and - * below the scope for the specified principal. This filter is different from the principalId filter as it - * returns not only those deny assignments that contain the specified principal is the Principals list but also - * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when - * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it returns + * not only those deny assignments that contain the specified principal is the Principals list but also those deny + * assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. * @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. @@ -380,7 +363,7 @@ PagedIterable listForResource( /** * Gets deny assignments for a scope. - * + * * @param scope The scope of the deny assignments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -392,7 +375,7 @@ PagedIterable listForResource( /** * Gets deny assignments for a scope. - * + * * @param scope The scope of the deny assignments. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -404,16 +387,16 @@ PagedIterable listForResource( /** * Gets deny assignments for a scope. - * + * * @param scope The scope of the deny assignments. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all deny assignments at or - * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified - * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the - * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and - * below the scope for the specified principal. This filter is different from the principalId filter as it - * returns not only those deny assignments that contain the specified principal is the Principals list but also - * those deny assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when - * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. + * above the scope. Use $filter=denyAssignmentName eq '{name}' to search deny assignments by name at specified + * scope. Use $filter=principalId eq '{id}' to return all deny assignments at, above and below the scope for the + * specified principal. Use $filter=gdprExportPrincipalId eq '{id}' to return all deny assignments at, above and + * below the scope for the specified principal. This filter is different from the principalId filter as it returns + * not only those deny assignments that contain the specified principal is the Principals list but also those deny + * assignments that contain the specified principal is the ExcludePrincipals list. Additionally, when + * gdprExportPrincipalId filter is used, only the deny assignment name and description properties are returned. * @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-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DomainsDomainsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DomainsDomainsClient.java index 8262f207793c5..6027a8f049c3e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DomainsDomainsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DomainsDomainsClient.java @@ -19,11 +19,13 @@ import java.util.List; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DomainsDomainsClient. */ +/** + * An instance of this class provides access to all the operations defined in DomainsDomainsClient. + */ public interface DomainsDomainsClient { /** * Get entities from domains. - * + * * @param top Show only the first n items. * @param skip Skip the first n items. * @param search Search items by search phrases. @@ -34,26 +36,19 @@ public interface DomainsDomainsClient { * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from domains as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listDomainAsync( - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand); + PagedFlux listDomainAsync(Integer top, Integer skip, String search, String filter, + Boolean count, List orderby, List select, List expand); /** * Get entities from domains. - * + * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from domains as paginated response with {@link PagedFlux}. */ @@ -62,9 +57,9 @@ PagedFlux listDomainAsync( /** * Get entities from domains. - * + * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from domains as paginated response with {@link PagedIterable}. */ @@ -73,7 +68,7 @@ PagedFlux listDomainAsync( /** * Get entities from domains. - * + * * @param top Show only the first n items. * @param skip Skip the first n items. * @param search Search items by search phrases. @@ -85,29 +80,22 @@ PagedFlux listDomainAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from domains as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDomain( - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand, + PagedIterable listDomain(Integer top, Integer skip, String search, String filter, + Boolean count, List orderby, List select, List expand, Context context); /** * Add new entity to domains. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return domain along with {@link Response} on successful completion of {@link Mono}. */ @@ -116,11 +104,11 @@ PagedIterable listDomain( /** * Add new entity to domains. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return domain on successful completion of {@link Mono}. */ @@ -129,12 +117,12 @@ PagedIterable listDomain( /** * Add new entity to domains. - * + * * @param body New entity. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return domain along with {@link Response}. */ @@ -143,11 +131,11 @@ PagedIterable listDomain( /** * Add new entity to domains. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return domain. */ @@ -156,27 +144,27 @@ PagedIterable listDomain( /** * Get entity from domains by key. - * + * * @param domainId key: id of domain. * @param select Select properties to be returned. * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from domains by key along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDomainWithResponseAsync( - String domainId, List select, List expand); + Mono> getDomainWithResponseAsync(String domainId, List select, + List expand); /** * Get entity from domains by key. - * + * * @param domainId key: id of domain. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from domains by key on successful completion of {@link Mono}. */ @@ -185,28 +173,28 @@ Mono> getDomainWithResponseAsync( /** * Get entity from domains by key. - * + * * @param domainId key: id of domain. * @param select Select properties to be returned. * @param expand Expand related entities. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from domains by key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getDomainWithResponse( - String domainId, List select, List expand, Context context); + Response getDomainWithResponse(String domainId, List select, + List expand, Context context); /** * Get entity from domains by key. - * + * * @param domainId key: id of domain. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from domains by key. */ @@ -215,12 +203,12 @@ Response getDomainWithResponse( /** * Update entity in domains. - * + * * @param domainId key: id of domain. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -229,12 +217,12 @@ Response getDomainWithResponse( /** * Update entity in domains. - * + * * @param domainId key: id of domain. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -243,13 +231,13 @@ Response getDomainWithResponse( /** * Update entity in domains. - * + * * @param domainId key: id of domain. * @param body New property values. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -258,12 +246,12 @@ Response getDomainWithResponse( /** * Update entity in domains. - * + * * @param domainId key: id of domain. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -271,12 +259,12 @@ Response getDomainWithResponse( /** * Delete entity from domains. - * + * * @param domainId key: id of domain. * @param ifMatch ETag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -285,11 +273,11 @@ Response getDomainWithResponse( /** * Delete entity from domains. - * + * * @param domainId key: id of domain. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -298,13 +286,13 @@ Response getDomainWithResponse( /** * Delete entity from domains. - * + * * @param domainId key: id of domain. * @param ifMatch ETag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -313,11 +301,11 @@ Response getDomainWithResponse( /** * Delete entity from domains. - * + * * @param domainId key: id of domain. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/EligibleChildResourcesClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/EligibleChildResourcesClient.java index 95e0c043b8672..00077929d2b60 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/EligibleChildResourcesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/EligibleChildResourcesClient.java @@ -11,65 +11,65 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.authorization.fluent.models.EligibleChildResourceInner; -/** An instance of this class provides access to all the operations defined in EligibleChildResourcesClient. */ +/** + * An instance of this class provides access to all the operations defined in EligibleChildResourcesClient. + */ public interface EligibleChildResourcesClient { /** * Get the child resources of a resource on which user has eligible access. - * + * * @param scope The scope of the role management policy. * @param filter The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only - * resource of type = 'Subscription'. Use - * $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = - * 'Subscription' or 'ResourceGroup'. + * resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' + * to filter on resource of type = 'Subscription' or 'ResourceGroup'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the child resources of a resource on which user has eligible access as paginated response with {@link - * PagedFlux}. + * @return the child resources of a resource on which user has eligible access as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux getAsync(String scope, String filter); /** * Get the child resources of a resource on which user has eligible access. - * + * * @param scope The scope of the role management policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the child resources of a resource on which user has eligible access as paginated response with {@link - * PagedFlux}. + * @return the child resources of a resource on which user has eligible access as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux getAsync(String scope); /** * Get the child resources of a resource on which user has eligible access. - * + * * @param scope The scope of the role management policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the child resources of a resource on which user has eligible access as paginated response with {@link - * PagedIterable}. + * @return the child resources of a resource on which user has eligible access as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable get(String scope); /** * Get the child resources of a resource on which user has eligible access. - * + * * @param scope The scope of the role management policy. * @param filter The filter to apply on the operation. Use $filter=resourceType+eq+'Subscription' to filter on only - * resource of type = 'Subscription'. Use - * $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' to filter on resource of type = - * 'Subscription' or 'ResourceGroup'. + * resource of type = 'Subscription'. Use $filter=resourceType+eq+'subscription'+or+resourceType+eq+'resourcegroup' + * to filter on resource of type = 'Subscription' or 'ResourceGroup'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the child resources of a resource on which user has eligible access as paginated response with {@link - * PagedIterable}. + * @return the child resources of a resource on which user has eligible access as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable get(String scope, String filter, Context context); diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GlobalAdministratorsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GlobalAdministratorsClient.java index 7510e28e0ef98..3a6c986b20723 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GlobalAdministratorsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GlobalAdministratorsClient.java @@ -10,11 +10,13 @@ import com.azure.core.util.Context; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in GlobalAdministratorsClient. */ +/** + * An instance of this class provides access to all the operations defined in GlobalAdministratorsClient. + */ public interface GlobalAdministratorsClient { /** * Elevates access for a Global Administrator. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. @@ -24,7 +26,7 @@ public interface GlobalAdministratorsClient { /** * Elevates access for a Global Administrator. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. @@ -34,7 +36,7 @@ public interface GlobalAdministratorsClient { /** * Elevates access for a Global Administrator. - * + * * @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. @@ -46,7 +48,7 @@ public interface GlobalAdministratorsClient { /** * Elevates access for a Global Administrator. - * + * * @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. */ diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsClient.java index 351412cb13b66..efbcdf5b5f39a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsClient.java @@ -17,11 +17,13 @@ import java.util.Map; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in GroupsClient. */ +/** + * An instance of this class provides access to all the operations defined in GroupsClient. + */ public interface GroupsClient { /** * Get acceptedSenders from groups. - * + * * @param groupId key: id of group. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -33,29 +35,22 @@ public interface GroupsClient { * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return acceptedSenders from groups as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAcceptedSendersAsync( - String groupId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, + PagedFlux listAcceptedSendersAsync(String groupId, Integer top, Integer skip, + String search, String filter, Boolean count, List orderby, List select, List expand); /** * Get acceptedSenders from groups. - * + * * @param groupId key: id of group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return acceptedSenders from groups as paginated response with {@link PagedFlux}. */ @@ -64,11 +59,11 @@ PagedFlux listAcceptedSendersAsync( /** * Get acceptedSenders from groups. - * + * * @param groupId key: id of group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return acceptedSenders from groups as paginated response with {@link PagedIterable}. */ @@ -77,7 +72,7 @@ PagedFlux listAcceptedSendersAsync( /** * Get acceptedSenders from groups. - * + * * @param groupId key: id of group. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -90,77 +85,69 @@ PagedFlux listAcceptedSendersAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return acceptedSenders from groups as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAcceptedSenders( - String groupId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand, - Context context); + PagedIterable listAcceptedSenders(String groupId, Integer top, Integer skip, + String search, String filter, Boolean count, List orderby, List select, + List expand, Context context); /** * Create new navigation property to acceptedSenders for groups. - * + * * @param groupId key: id of group. * @param body New navigation property. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return directoryObject along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createAcceptedSendersWithResponseAsync( - String groupId, MicrosoftGraphDirectoryObjectInner body); + Mono> createAcceptedSendersWithResponseAsync(String groupId, + MicrosoftGraphDirectoryObjectInner body); /** * Create new navigation property to acceptedSenders for groups. - * + * * @param groupId key: id of group. * @param body New navigation property. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return directoryObject on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAcceptedSendersAsync( - String groupId, MicrosoftGraphDirectoryObjectInner body); + Mono createAcceptedSendersAsync(String groupId, + MicrosoftGraphDirectoryObjectInner body); /** * Create new navigation property to acceptedSenders for groups. - * + * * @param groupId key: id of group. * @param body New navigation property. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return directoryObject along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createAcceptedSendersWithResponse( - String groupId, MicrosoftGraphDirectoryObjectInner body, Context context); + Response createAcceptedSendersWithResponse(String groupId, + MicrosoftGraphDirectoryObjectInner body, Context context); /** * Create new navigation property to acceptedSenders for groups. - * + * * @param groupId key: id of group. * @param body New navigation property. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return directoryObject. */ @@ -169,7 +156,7 @@ Response createAcceptedSendersWithResponse( /** * Get members from groups. - * + * * @param groupId key: id of group. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -181,29 +168,22 @@ Response createAcceptedSendersWithResponse( * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return members from groups as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMembersAsync( - String groupId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, + PagedFlux listMembersAsync(String groupId, Integer top, Integer skip, + String search, String filter, Boolean count, List orderby, List select, List expand); /** * Get members from groups. - * + * * @param groupId key: id of group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return members from groups as paginated response with {@link PagedFlux}. */ @@ -212,11 +192,11 @@ PagedFlux listMembersAsync( /** * Get members from groups. - * + * * @param groupId key: id of group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return members from groups as paginated response with {@link PagedIterable}. */ @@ -225,7 +205,7 @@ PagedFlux listMembersAsync( /** * Get members from groups. - * + * * @param groupId key: id of group. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -238,26 +218,18 @@ PagedFlux listMembersAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return members from groups as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMembers( - String groupId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand, - Context context); + PagedIterable listMembers(String groupId, Integer top, Integer skip, + String search, String filter, Boolean count, List orderby, List select, + List expand, Context context); /** * Get ref of members from groups. - * + * * @param groupId key: id of group. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -267,27 +239,21 @@ PagedIterable listMembers( * @param orderby Order items by property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of members from groups as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listRefMembersAsync( - String groupId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby); + PagedFlux listRefMembersAsync(String groupId, Integer top, Integer skip, String search, String filter, + Boolean count, List orderby); /** * Get ref of members from groups. - * + * * @param groupId key: id of group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of members from groups as paginated response with {@link PagedFlux}. */ @@ -296,11 +262,11 @@ PagedFlux listRefMembersAsync( /** * Get ref of members from groups. - * + * * @param groupId key: id of group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of members from groups as paginated response with {@link PagedIterable}. */ @@ -309,7 +275,7 @@ PagedFlux listRefMembersAsync( /** * Get ref of members from groups. - * + * * @param groupId key: id of group. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -320,29 +286,22 @@ PagedFlux listRefMembersAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return ref of members from groups as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listRefMembers( - String groupId, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - Context context); + PagedIterable listRefMembers(String groupId, Integer top, Integer skip, String search, String filter, + Boolean count, List orderby, Context context); /** * Create new navigation property ref to members for groups. - * + * * @param groupId key: id of group. * @param body New navigation property ref value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -351,12 +310,12 @@ PagedIterable listRefMembers( /** * Create new navigation property ref to members for groups. - * + * * @param groupId key: id of group. * @param body New navigation property ref value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -365,13 +324,13 @@ PagedIterable listRefMembers( /** * Create new navigation property ref to members for groups. - * + * * @param groupId key: id of group. * @param body New navigation property ref value. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -380,12 +339,12 @@ PagedIterable listRefMembers( /** * Create new navigation property ref to members for groups. - * + * * @param groupId key: id of group. * @param body New navigation property ref value. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -393,13 +352,13 @@ PagedIterable listRefMembers( /** * Delete ref of member from groups. - * + * * @param groupId key: id of group. * @param directoryObjectId key: directoryObject-id. * @param ifMatch ETag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -408,12 +367,12 @@ PagedIterable listRefMembers( /** * Delete ref of member from groups. - * + * * @param groupId key: id of group. * @param directoryObjectId key: directoryObject-id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -422,29 +381,29 @@ PagedIterable listRefMembers( /** * Delete ref of member from groups. - * + * * @param groupId key: id of group. * @param directoryObjectId key: directoryObject-id. * @param ifMatch ETag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteRefMemberWithResponse( - String groupId, String directoryObjectId, String ifMatch, Context context); + Response deleteRefMemberWithResponse(String groupId, String directoryObjectId, String ifMatch, + Context context); /** * Delete ref of member from groups. - * + * * @param groupId key: id of group. * @param directoryObjectId key: directoryObject-id. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsGroupsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsGroupsClient.java index 6c3efd226f085..e155f177e9cf0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsGroupsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/GroupsGroupsClient.java @@ -19,11 +19,13 @@ import java.util.List; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in GroupsGroupsClient. */ +/** + * An instance of this class provides access to all the operations defined in GroupsGroupsClient. + */ public interface GroupsGroupsClient { /** * Get entities from groups. - * + * * @param consistencyLevel Indicates the requested consistency level. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -35,27 +37,20 @@ public interface GroupsGroupsClient { * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from groups as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listGroupAsync( - String consistencyLevel, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, + PagedFlux listGroupAsync(String consistencyLevel, Integer top, Integer skip, + String search, String filter, Boolean count, List orderby, List select, List expand); /** * Get entities from groups. - * + * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from groups as paginated response with {@link PagedFlux}. */ @@ -64,9 +59,9 @@ PagedFlux listGroupAsync( /** * Get entities from groups. - * + * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from groups as paginated response with {@link PagedIterable}. */ @@ -75,7 +70,7 @@ PagedFlux listGroupAsync( /** * Get entities from groups. - * + * * @param consistencyLevel Indicates the requested consistency level. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -88,30 +83,22 @@ PagedFlux listGroupAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from groups as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listGroup( - String consistencyLevel, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand, - Context context); + PagedIterable listGroup(String consistencyLevel, Integer top, Integer skip, String search, + String filter, Boolean count, List orderby, List select, + List expand, Context context); /** * Add new entity to groups. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return group along with {@link Response} on successful completion of {@link Mono}. */ @@ -120,11 +107,11 @@ PagedIterable listGroup( /** * Add new entity to groups. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return group on successful completion of {@link Mono}. */ @@ -133,12 +120,12 @@ PagedIterable listGroup( /** * Add new entity to groups. - * + * * @param body New entity. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return group along with {@link Response}. */ @@ -147,11 +134,11 @@ PagedIterable listGroup( /** * Add new entity to groups. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return group. */ @@ -160,28 +147,28 @@ PagedIterable listGroup( /** * Get entity from groups by key. - * + * * @param groupId key: id of group. * @param consistencyLevel Indicates the requested consistency level. * @param select Select properties to be returned. * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from groups by key along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getGroupWithResponseAsync( - String groupId, String consistencyLevel, List select, List expand); + Mono> getGroupWithResponseAsync(String groupId, String consistencyLevel, + List select, List expand); /** * Get entity from groups by key. - * + * * @param groupId key: id of group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from groups by key on successful completion of {@link Mono}. */ @@ -190,7 +177,7 @@ Mono> getGroupWithResponseAsync( /** * Get entity from groups by key. - * + * * @param groupId key: id of group. * @param consistencyLevel Indicates the requested consistency level. * @param select Select properties to be returned. @@ -198,25 +185,21 @@ Mono> getGroupWithResponseAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from groups by key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getGroupWithResponse( - String groupId, - String consistencyLevel, - List select, - List expand, - Context context); + Response getGroupWithResponse(String groupId, String consistencyLevel, + List select, List expand, Context context); /** * Get entity from groups by key. - * + * * @param groupId key: id of group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from groups by key. */ @@ -225,12 +208,12 @@ Response getGroupWithResponse( /** * Update entity in groups. - * + * * @param groupId key: id of group. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -239,12 +222,12 @@ Response getGroupWithResponse( /** * Update entity in groups. - * + * * @param groupId key: id of group. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -253,13 +236,13 @@ Response getGroupWithResponse( /** * Update entity in groups. - * + * * @param groupId key: id of group. * @param body New property values. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -268,12 +251,12 @@ Response getGroupWithResponse( /** * Update entity in groups. - * + * * @param groupId key: id of group. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -281,12 +264,12 @@ Response getGroupWithResponse( /** * Delete entity from groups. - * + * * @param groupId key: id of group. * @param ifMatch ETag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -295,11 +278,11 @@ Response getGroupWithResponse( /** * Delete entity from groups. - * + * * @param groupId key: id of group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -308,13 +291,13 @@ Response getGroupWithResponse( /** * Delete entity from groups. - * + * * @param groupId key: id of group. * @param ifMatch ETag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -323,11 +306,11 @@ Response getGroupWithResponse( /** * Delete entity from groups. - * + * * @param groupId key: id of group. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/MicrosoftGraphClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/MicrosoftGraphClient.java index bb8508118199a..0c5c18334ec4c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/MicrosoftGraphClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/MicrosoftGraphClient.java @@ -7,81 +7,83 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for MicrosoftGraphClient class. */ +/** + * The interface for MicrosoftGraphClient class. + */ public interface MicrosoftGraphClient { /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** * Gets the ApplicationsApplicationsClient object to access its operations. - * + * * @return the ApplicationsApplicationsClient object. */ ApplicationsApplicationsClient getApplicationsApplications(); /** * Gets the ApplicationsClient object to access its operations. - * + * * @return the ApplicationsClient object. */ ApplicationsClient getApplications(); /** * Gets the ServicePrincipalsServicePrincipalsClient object to access its operations. - * + * * @return the ServicePrincipalsServicePrincipalsClient object. */ ServicePrincipalsServicePrincipalsClient getServicePrincipalsServicePrincipals(); /** * Gets the ServicePrincipalsClient object to access its operations. - * + * * @return the ServicePrincipalsClient object. */ ServicePrincipalsClient getServicePrincipals(); /** * Gets the GroupsGroupsClient object to access its operations. - * + * * @return the GroupsGroupsClient object. */ GroupsGroupsClient getGroupsGroups(); /** * Gets the GroupsClient object to access its operations. - * + * * @return the GroupsClient object. */ GroupsClient getGroups(); /** * Gets the UsersUsersClient object to access its operations. - * + * * @return the UsersUsersClient object. */ UsersUsersClient getUsersUsers(); /** * Gets the DomainsDomainsClient object to access its operations. - * + * * @return the DomainsDomainsClient object. */ DomainsDomainsClient getDomainsDomains(); diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/PermissionsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/PermissionsClient.java index 226688e210a36..adbfbfabebb77 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/PermissionsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/PermissionsClient.java @@ -11,11 +11,13 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.authorization.fluent.models.PermissionInner; -/** An instance of this class provides access to all the operations defined in PermissionsClient. */ +/** + * An instance of this class provides access to all the operations defined in PermissionsClient. + */ public interface PermissionsClient { /** * Gets all permissions the caller has for a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -27,7 +29,7 @@ public interface PermissionsClient { /** * Gets all permissions the caller has for a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -39,7 +41,7 @@ public interface PermissionsClient { /** * Gets all permissions the caller has for a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -52,7 +54,7 @@ public interface PermissionsClient { /** * Gets all permissions the caller has for a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. @@ -64,16 +66,12 @@ public interface PermissionsClient { * @return all permissions the caller has for a resource as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); + PagedFlux listForResourceAsync(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName); /** * Gets all permissions the caller has for a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. @@ -85,16 +83,12 @@ PagedFlux listForResourceAsync( * @return all permissions the caller has for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName); + PagedIterable listForResource(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName); /** * Gets all permissions the caller has for a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param parentResourcePath The parent resource identity. @@ -107,11 +101,6 @@ PagedIterable listForResource( * @return all permissions the caller has for a resource as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String parentResourcePath, - String resourceType, - String resourceName, - Context context); + PagedIterable listForResource(String resourceGroupName, String resourceProviderNamespace, + String parentResourcePath, String resourceType, String resourceName, Context context); } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ProviderOperationsMetadatasClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ProviderOperationsMetadatasClient.java index a70ec93d998ca..13bd78775aea9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ProviderOperationsMetadatasClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ProviderOperationsMetadatasClient.java @@ -13,39 +13,41 @@ import com.azure.resourcemanager.authorization.fluent.models.ProviderOperationsMetadataInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ProviderOperationsMetadatasClient. */ +/** + * An instance of this class provides access to all the operations defined in ProviderOperationsMetadatasClient. + */ public interface ProviderOperationsMetadatasClient { /** * Gets provider operations metadata for the specified resource provider. - * + * * @param resourceProviderNamespace The namespace of the resource provider. * @param expand Specifies whether to expand the values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return provider operations metadata for the specified resource provider along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String resourceProviderNamespace, String expand); + Mono> getWithResponseAsync(String resourceProviderNamespace, + String expand); /** * Gets provider operations metadata for the specified resource provider. - * + * * @param resourceProviderNamespace The namespace of the resource provider. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return provider operations metadata for the specified resource provider on successful completion of {@link - * Mono}. + * @return provider operations metadata for the specified resource provider on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono getAsync(String resourceProviderNamespace); /** * Gets provider operations metadata for the specified resource provider. - * + * * @param resourceProviderNamespace The namespace of the resource provider. * @param expand Specifies whether to expand the values. * @param context The context to associate with this operation. @@ -55,12 +57,12 @@ Mono> getWithResponseAsync( * @return provider operations metadata for the specified resource provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceProviderNamespace, String expand, Context context); + Response getWithResponse(String resourceProviderNamespace, String expand, + Context context); /** * Gets provider operations metadata for the specified resource provider. - * + * * @param resourceProviderNamespace The namespace of the resource provider. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -72,7 +74,7 @@ Response getWithResponse( /** * Gets provider operations metadata for all resource providers. - * + * * @param expand Specifies whether to expand the values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -84,7 +86,7 @@ Response getWithResponse( /** * Gets provider operations metadata for all resource providers. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return provider operations metadata for all resource providers as paginated response with {@link PagedFlux}. @@ -94,7 +96,7 @@ Response getWithResponse( /** * Gets provider operations metadata for all resource providers. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return provider operations metadata for all resource providers as paginated response with {@link PagedIterable}. @@ -104,7 +106,7 @@ Response getWithResponse( /** * Gets provider operations metadata for all resource providers. - * + * * @param expand Specifies whether to expand the values. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentScheduleInstancesClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentScheduleInstancesClient.java index 670706f72f330..97dbbad963147 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentScheduleInstancesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentScheduleInstancesClient.java @@ -13,93 +13,95 @@ import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentScheduleInstanceInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RoleAssignmentScheduleInstancesClient. */ +/** + * An instance of this class provides access to all the operations defined in RoleAssignmentScheduleInstancesClient. + */ public interface RoleAssignmentScheduleInstancesClient { /** * Gets role assignment schedule instances of a role assignment schedule. - * + * * @param scope The scope of the role assignment schedule. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or - * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment - * schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances - * created for the current user. + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below + * the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedule + * instances for the user. Use $filter=asTarget() to return all role assignment schedule instances created for the + * current user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment schedule instances of a role assignment schedule as paginated response with {@link - * PagedFlux}. + * @return role assignment schedule instances of a role assignment schedule as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listForScopeAsync(String scope, String filter); /** * Gets role assignment schedule instances of a role assignment schedule. - * + * * @param scope The scope of the role assignment schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment schedule instances of a role assignment schedule as paginated response with {@link - * PagedFlux}. + * @return role assignment schedule instances of a role assignment schedule as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listForScopeAsync(String scope); /** * Gets role assignment schedule instances of a role assignment schedule. - * + * * @param scope The scope of the role assignment schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment schedule instances of a role assignment schedule as paginated response with {@link - * PagedIterable}. + * @return role assignment schedule instances of a role assignment schedule as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForScope(String scope); /** * Gets role assignment schedule instances of a role assignment schedule. - * + * * @param scope The scope of the role assignment schedule. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or - * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment - * schedule instances for the user. Use $filter=asTarget() to return all role assignment schedule instances - * created for the current user. + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below + * the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedule + * instances for the user. Use $filter=asTarget() to return all role assignment schedule instances created for the + * current user. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role assignment schedule instances of a role assignment schedule as paginated response with {@link - * PagedIterable}. + * @return role assignment schedule instances of a role assignment schedule as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForScope(String scope, String filter, Context context); /** * Gets the specified role assignment schedule instance. - * + * * @param scope The scope of the role assignments schedules. * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule - * to get. + * to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified role assignment schedule instance along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String scope, String roleAssignmentScheduleInstanceName); + Mono> getWithResponseAsync(String scope, + String roleAssignmentScheduleInstanceName); /** * Gets the specified role assignment schedule instance. - * + * * @param scope The scope of the role assignments schedules. * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule - * to get. + * to get. * @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. @@ -110,10 +112,10 @@ Mono> getWithResponseAsync( /** * Gets the specified role assignment schedule instance. - * + * * @param scope The scope of the role assignments schedules. * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule - * to get. + * to get. * @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. @@ -121,15 +123,15 @@ Mono> getWithResponseAsync( * @return the specified role assignment schedule instance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String roleAssignmentScheduleInstanceName, Context context); + Response getWithResponse(String scope, + String roleAssignmentScheduleInstanceName, Context context); /** * Gets the specified role assignment schedule instance. - * + * * @param scope The scope of the role assignments schedules. * @param roleAssignmentScheduleInstanceName The name (hash of schedule name + time) of the role assignment schedule - * to get. + * to get. * @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. diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentScheduleRequestsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentScheduleRequestsClient.java index fd00043c2e992..a8a380cf0945d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentScheduleRequestsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentScheduleRequestsClient.java @@ -13,18 +13,20 @@ import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentScheduleRequestInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RoleAssignmentScheduleRequestsClient. */ +/** + * An instance of this class provides access to all the operations defined in RoleAssignmentScheduleRequestsClient. + */ public interface RoleAssignmentScheduleRequestsClient { /** * Creates a role assignment schedule request. - * + * * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource - * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. + * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and - * different for each role assignment. + * different for each role assignment. * @param parameters Parameters for the role assignment schedule request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -32,19 +34,19 @@ public interface RoleAssignmentScheduleRequestsClient { * @return role Assignment schedule request along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); + Mono> createWithResponseAsync(String scope, + String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); /** * Creates a role assignment schedule request. - * + * * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource - * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. + * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and - * different for each role assignment. + * different for each role assignment. * @param parameters Parameters for the role assignment schedule request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -52,19 +54,19 @@ Mono> createWithResponseAsync( * @return role Assignment schedule request on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); + Mono createAsync(String scope, String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters); /** * Creates a role assignment schedule request. - * + * * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource - * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. + * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and - * different for each role assignment. + * different for each role assignment. * @param parameters Parameters for the role assignment schedule request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -73,22 +75,19 @@ Mono createAsync( * @return role Assignment schedule request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String scope, - String roleAssignmentScheduleRequestName, - RoleAssignmentScheduleRequestInner parameters, - Context context); + Response createWithResponse(String scope, + String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters, Context context); /** * Creates a role assignment schedule request. - * + * * @param scope The scope of the role assignment schedule request to create. The scope can be any REST resource - * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. + * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. * @param roleAssignmentScheduleRequestName A GUID for the role assignment to create. The name must be unique and - * different for each role assignment. + * different for each role assignment. * @param parameters Parameters for the role assignment schedule request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -96,27 +95,27 @@ Response createWithResponse( * @return role Assignment schedule request. */ @ServiceMethod(returns = ReturnType.SINGLE) - RoleAssignmentScheduleRequestInner create( - String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); + RoleAssignmentScheduleRequestInner create(String scope, String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters); /** * Get the specified role assignment schedule request. - * + * * @param scope The scope of the role assignment schedule request. * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified role assignment schedule request along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String scope, String roleAssignmentScheduleRequestName); + Mono> getWithResponseAsync(String scope, + String roleAssignmentScheduleRequestName); /** * Get the specified role assignment schedule request. - * + * * @param scope The scope of the role assignment schedule request. * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -129,7 +128,7 @@ Mono> getWithResponseAsync( /** * Get the specified role assignment schedule request. - * + * * @param scope The scope of the role assignment schedule request. * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. * @param context The context to associate with this operation. @@ -139,12 +138,12 @@ Mono> getWithResponseAsync( * @return the specified role assignment schedule request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String roleAssignmentScheduleRequestName, Context context); + Response getWithResponse(String scope, String roleAssignmentScheduleRequestName, + Context context); /** * Get the specified role assignment schedule request. - * + * * @param scope The scope of the role assignment schedule request. * @param roleAssignmentScheduleRequestName The name (guid) of the role assignment schedule request to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -157,14 +156,14 @@ Response getWithResponse( /** * Gets role assignment schedule requests for a scope. - * + * * @param scope The scope of the role assignments schedule requests. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule - * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule - * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all - * role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role - * assignment schedule requests created for the current user. Use $filter=asApprover() to return all role - * assignment schedule requests where the current user is an approver. + * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests + * at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment + * schedule requests requested by the current user. Use $filter=asTarget() to return all role assignment schedule + * requests created for the current user. Use $filter=asApprover() to return all role assignment schedule requests + * where the current user is an approver. * @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. @@ -175,7 +174,7 @@ Response getWithResponse( /** * Gets role assignment schedule requests for a scope. - * + * * @param scope The scope of the role assignments schedule requests. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -187,7 +186,7 @@ Response getWithResponse( /** * Gets role assignment schedule requests for a scope. - * + * * @param scope The scope of the role assignments schedule requests. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -199,14 +198,14 @@ Response getWithResponse( /** * Gets role assignment schedule requests for a scope. - * + * * @param scope The scope of the role assignments schedule requests. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedule - * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule - * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all - * role assignment schedule requests requested by the current user. Use $filter=asTarget() to return all role - * assignment schedule requests created for the current user. Use $filter=asApprover() to return all role - * assignment schedule requests where the current user is an approver. + * requests at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedule requests + * at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role assignment + * schedule requests requested by the current user. Use $filter=asTarget() to return all role assignment schedule + * requests created for the current user. Use $filter=asApprover() to return all role assignment schedule requests + * where the current user is an approver. * @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. @@ -218,7 +217,7 @@ Response getWithResponse( /** * Cancels a pending role assignment schedule request. - * + * * @param scope The scope of the role assignment request to cancel. * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -231,7 +230,7 @@ Response getWithResponse( /** * Cancels a pending role assignment schedule request. - * + * * @param scope The scope of the role assignment request to cancel. * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -244,7 +243,7 @@ Response getWithResponse( /** * Cancels a pending role assignment schedule request. - * + * * @param scope The scope of the role assignment request to cancel. * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. * @param context The context to associate with this operation. @@ -258,7 +257,7 @@ Response getWithResponse( /** * Cancels a pending role assignment schedule request. - * + * * @param scope The scope of the role assignment request to cancel. * @param roleAssignmentScheduleRequestName The name of the role assignment request to cancel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -270,7 +269,7 @@ Response getWithResponse( /** * Validates a new role assignment schedule request. - * + * * @param scope The scope of the role assignment request to validate. * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. * @param parameters Parameters for the role assignment schedule request. @@ -280,12 +279,12 @@ Response getWithResponse( * @return role Assignment schedule request along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> validateWithResponseAsync( - String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); + Mono> validateWithResponseAsync(String scope, + String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); /** * Validates a new role assignment schedule request. - * + * * @param scope The scope of the role assignment request to validate. * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. * @param parameters Parameters for the role assignment schedule request. @@ -295,12 +294,12 @@ Mono> validateWithResponseAsync( * @return role Assignment schedule request on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateAsync( - String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); + Mono validateAsync(String scope, String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters); /** * Validates a new role assignment schedule request. - * + * * @param scope The scope of the role assignment request to validate. * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. * @param parameters Parameters for the role assignment schedule request. @@ -311,15 +310,12 @@ Mono validateAsync( * @return role Assignment schedule request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse( - String scope, - String roleAssignmentScheduleRequestName, - RoleAssignmentScheduleRequestInner parameters, - Context context); + Response validateWithResponse(String scope, + String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters, Context context); /** * Validates a new role assignment schedule request. - * + * * @param scope The scope of the role assignment request to validate. * @param roleAssignmentScheduleRequestName The name of the role assignment request to validate. * @param parameters Parameters for the role assignment schedule request. @@ -329,6 +325,6 @@ Response validateWithResponse( * @return role Assignment schedule request. */ @ServiceMethod(returns = ReturnType.SINGLE) - RoleAssignmentScheduleRequestInner validate( - String scope, String roleAssignmentScheduleRequestName, RoleAssignmentScheduleRequestInner parameters); + RoleAssignmentScheduleRequestInner validate(String scope, String roleAssignmentScheduleRequestName, + RoleAssignmentScheduleRequestInner parameters); } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentSchedulesClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentSchedulesClient.java index ec31643e600ed..26ce786a3b5f0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentSchedulesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentSchedulesClient.java @@ -13,25 +13,27 @@ import com.azure.resourcemanager.authorization.fluent.models.RoleAssignmentScheduleInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RoleAssignmentSchedulesClient. */ +/** + * An instance of this class provides access to all the operations defined in RoleAssignmentSchedulesClient. + */ public interface RoleAssignmentSchedulesClient { /** * Get the specified role assignment schedule for a resource scope. - * + * * @param scope The scope of the role assignment schedule. * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified role assignment schedule for a resource scope along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> getWithResponseAsync(String scope, String roleAssignmentScheduleName); /** * Get the specified role assignment schedule for a resource scope. - * + * * @param scope The scope of the role assignment schedule. * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -44,7 +46,7 @@ public interface RoleAssignmentSchedulesClient { /** * Get the specified role assignment schedule for a resource scope. - * + * * @param scope The scope of the role assignment schedule. * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. * @param context The context to associate with this operation. @@ -54,12 +56,12 @@ public interface RoleAssignmentSchedulesClient { * @return the specified role assignment schedule for a resource scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String roleAssignmentScheduleName, Context context); + Response getWithResponse(String scope, String roleAssignmentScheduleName, + Context context); /** * Get the specified role assignment schedule for a resource scope. - * + * * @param scope The scope of the role assignment schedule. * @param roleAssignmentScheduleName The name (guid) of the role assignment schedule to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -72,13 +74,13 @@ Response getWithResponse( /** * Gets role assignment schedules for a resource scope. - * + * * @param scope The scope of the role assignments schedules. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or - * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment - * schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for - * the current user. + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below + * the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules + * for the current user. Use $filter=asTarget() to return all role assignment schedules created for the current + * user. * @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. @@ -89,7 +91,7 @@ Response getWithResponse( /** * Gets role assignment schedules for a resource scope. - * + * * @param scope The scope of the role assignments schedules. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -101,7 +103,7 @@ Response getWithResponse( /** * Gets role assignment schedules for a resource scope. - * + * * @param scope The scope of the role assignments schedules. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -113,13 +115,13 @@ Response getWithResponse( /** * Gets role assignment schedules for a resource scope. - * + * * @param scope The scope of the role assignments schedules. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or - * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment - * schedules for the current user. Use $filter=asTarget() to return all role assignment schedules created for - * the current user. + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below + * the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role assignment schedules + * for the current user. Use $filter=asTarget() to return all role assignment schedules created for the current + * user. * @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-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentsClient.java index fdc1ae18a433e..6174f7f9ce29f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleAssignmentsClient.java @@ -16,15 +16,17 @@ import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RoleAssignmentsClient. */ +/** + * An instance of this class provides access to all the operations defined in RoleAssignmentsClient. + */ public interface RoleAssignmentsClient extends InnerSupportsListing, InnerSupportsDelete { /** * List all role assignments that apply to a subscription. - * + * * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for + * the specified principal. * @param tenantId Tenant ID for cross-tenant request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -36,7 +38,7 @@ public interface RoleAssignmentsClient /** * List all role assignments that apply to a subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return role assignment list operation result as paginated response with {@link PagedFlux}. @@ -46,7 +48,7 @@ public interface RoleAssignmentsClient /** * List all role assignments that apply to a subscription. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return role assignment list operation result as paginated response with {@link PagedIterable}. @@ -56,10 +58,10 @@ public interface RoleAssignmentsClient /** * List all role assignments that apply to a subscription. - * + * * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for + * the specified principal. * @param tenantId Tenant ID for cross-tenant request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -72,11 +74,11 @@ public interface RoleAssignmentsClient /** * List all role assignments that apply to a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for + * the specified principal. * @param tenantId Tenant ID for cross-tenant request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -88,7 +90,7 @@ public interface RoleAssignmentsClient /** * List all role assignments that apply to a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -100,7 +102,7 @@ public interface RoleAssignmentsClient /** * List all role assignments that apply to a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -112,11 +114,11 @@ public interface RoleAssignmentsClient /** * List all role assignments that apply to a resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for + * the specified principal. * @param tenantId Tenant ID for cross-tenant request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -125,20 +127,20 @@ public interface RoleAssignmentsClient * @return role assignment list operation result as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, String tenantId, Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String filter, String tenantId, + Context context); /** * List all role assignments that apply to a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). + * Microsoft.Web/sites). * @param resourceName The resource name. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for + * the specified principal. * @param tenantId Tenant ID for cross-tenant request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -146,21 +148,16 @@ PagedIterable listByResourceGroup( * @return role assignment list operation result as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync( - String resourceGroupName, - String resourceProviderNamespace, - String resourceType, - String resourceName, - String filter, - String tenantId); + PagedFlux listForResourceAsync(String resourceGroupName, String resourceProviderNamespace, + String resourceType, String resourceName, String filter, String tenantId); /** * List all role assignments that apply to a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). + * Microsoft.Web/sites). * @param resourceName The resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -168,16 +165,16 @@ PagedFlux listForResourceAsync( * @return role assignment list operation result as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listForResourceAsync( - String resourceGroupName, String resourceProviderNamespace, String resourceType, String resourceName); + PagedFlux listForResourceAsync(String resourceGroupName, String resourceProviderNamespace, + String resourceType, String resourceName); /** * List all role assignments that apply to a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). + * Microsoft.Web/sites). * @param resourceName The resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -185,20 +182,20 @@ PagedFlux listForResourceAsync( * @return role assignment list operation result as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, String resourceProviderNamespace, String resourceType, String resourceName); + PagedIterable listForResource(String resourceGroupName, String resourceProviderNamespace, + String resourceType, String resourceName); /** * List all role assignments that apply to a resource. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceProviderNamespace The namespace of the resource provider. * @param resourceType The resource type name. For example the type name of a web app is 'sites' (from - * Microsoft.Web/sites). + * Microsoft.Web/sites). * @param resourceName The resource name. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for + * the specified principal. * @param tenantId Tenant ID for cross-tenant request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -207,22 +204,16 @@ PagedIterable listForResource( * @return role assignment list operation result as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForResource( - String resourceGroupName, - String resourceProviderNamespace, - String resourceType, - String resourceName, - String filter, - String tenantId, - Context context); + PagedIterable listForResource(String resourceGroupName, String resourceProviderNamespace, + String resourceType, String resourceName, String filter, String tenantId, Context context); /** * Get a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @param tenantId Tenant ID for cross-tenant request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -235,11 +226,11 @@ PagedIterable listForResource( /** * Get a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -251,11 +242,11 @@ PagedIterable listForResource( /** * Get a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @param tenantId Tenant ID for cross-tenant request. * @param context The context to associate with this operation. @@ -265,16 +256,16 @@ PagedIterable listForResource( * @return a role assignment by scope and name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String roleAssignmentName, String tenantId, Context context); + Response getWithResponse(String scope, String roleAssignmentName, String tenantId, + Context context); /** * Get a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -286,11 +277,11 @@ Response getWithResponse( /** * Create or update a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @param parameters Parameters for the role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -299,16 +290,16 @@ Response getWithResponse( * @return role Assignments along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters); + Mono> createWithResponseAsync(String scope, String roleAssignmentName, + RoleAssignmentCreateParameters parameters); /** * Create or update a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @param parameters Parameters for the role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -317,16 +308,16 @@ Mono> createWithResponseAsync( * @return role Assignments on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters); + Mono createAsync(String scope, String roleAssignmentName, + RoleAssignmentCreateParameters parameters); /** * Create or update a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @param parameters Parameters for the role assignment. * @param context The context to associate with this operation. @@ -336,16 +327,16 @@ Mono createAsync( * @return role Assignments along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters, Context context); + Response createWithResponse(String scope, String roleAssignmentName, + RoleAssignmentCreateParameters parameters, Context context); /** * Create or update a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @param parameters Parameters for the role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -358,11 +349,11 @@ Response createWithResponse( /** * Delete a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @param tenantId Tenant ID for cross-tenant request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -371,16 +362,16 @@ Response createWithResponse( * @return role Assignments along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> deleteWithResponseAsync( - String scope, String roleAssignmentName, String tenantId); + Mono> deleteWithResponseAsync(String scope, String roleAssignmentName, + String tenantId); /** * Delete a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -392,11 +383,11 @@ Mono> deleteWithResponseAsync( /** * Delete a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @param tenantId Tenant ID for cross-tenant request. * @param context The context to associate with this operation. @@ -406,16 +397,16 @@ Mono> deleteWithResponseAsync( * @return role Assignments along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String scope, String roleAssignmentName, String tenantId, Context context); + Response deleteWithResponse(String scope, String roleAssignmentName, String tenantId, + Context context); /** * Delete a role assignment by scope and name. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param roleAssignmentName The name of the role assignment. It can be any valid GUID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -427,17 +418,17 @@ Response deleteWithResponse( /** * List all role assignments that apply to a scope. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for + * the specified principal. * @param tenantId Tenant ID for cross-tenant request. * @param skipToken The skipToken to apply on the operation. Use $skipToken={skiptoken} to return paged role - * assignments following the skipToken passed. Only supported on provider level calls. + * assignments following the skipToken passed. Only supported on provider level calls. * @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. @@ -448,11 +439,11 @@ Response deleteWithResponse( /** * List all role assignments that apply to a scope. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @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. @@ -463,11 +454,11 @@ Response deleteWithResponse( /** * List all role assignments that apply to a scope. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @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. @@ -478,17 +469,17 @@ Response deleteWithResponse( /** * List all role assignments that apply to a scope. - * + * * @param scope The scope of the operation or resource. Valid scopes are: subscription (format: - * '/subscriptions/{subscriptionId}'), resource group (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. + * '/subscriptions/{subscriptionId}'), resource group (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or - * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope - * for the specified principal. + * above the scope. Use $filter=principalId eq {id} to return all role assignments at, above or below the scope for + * the specified principal. * @param tenantId Tenant ID for cross-tenant request. * @param skipToken The skipToken to apply on the operation. Use $skipToken={skiptoken} to return paged role - * assignments following the skipToken passed. Only supported on provider level calls. + * assignments following the skipToken passed. Only supported on provider level calls. * @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. @@ -496,16 +487,15 @@ Response deleteWithResponse( * @return role assignment list operation result as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listForScope( - String scope, String filter, String tenantId, String skipToken, Context context); + PagedIterable listForScope(String scope, String filter, String tenantId, String skipToken, + Context context); /** * Get a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @param tenantId Tenant ID for cross-tenant request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -517,11 +507,10 @@ PagedIterable listForScope( /** * Get a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @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. @@ -532,11 +521,10 @@ PagedIterable listForScope( /** * Get a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @param tenantId Tenant ID for cross-tenant request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -549,11 +537,10 @@ PagedIterable listForScope( /** * Get a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @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. @@ -564,11 +551,10 @@ PagedIterable listForScope( /** * Create or update a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @param parameters Parameters for the role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -576,16 +562,15 @@ PagedIterable listForScope( * @return role Assignments along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createByIdWithResponseAsync( - String roleAssignmentId, RoleAssignmentCreateParameters parameters); + Mono> createByIdWithResponseAsync(String roleAssignmentId, + RoleAssignmentCreateParameters parameters); /** * Create or update a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @param parameters Parameters for the role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -597,11 +582,10 @@ Mono> createByIdWithResponseAsync( /** * Create or update a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @param parameters Parameters for the role assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -610,16 +594,15 @@ Mono> createByIdWithResponseAsync( * @return role Assignments along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createByIdWithResponse( - String roleAssignmentId, RoleAssignmentCreateParameters parameters, Context context); + Response createByIdWithResponse(String roleAssignmentId, + RoleAssignmentCreateParameters parameters, Context context); /** * Create or update a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @param parameters Parameters for the role assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -631,11 +614,10 @@ Response createByIdWithResponse( /** * Delete a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @param tenantId Tenant ID for cross-tenant request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -647,11 +629,10 @@ Response createByIdWithResponse( /** * Delete a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @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. @@ -662,11 +643,10 @@ Response createByIdWithResponse( /** * Delete a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @param tenantId Tenant ID for cross-tenant request. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -679,11 +659,10 @@ Response createByIdWithResponse( /** * Delete a role assignment by ID. - * + * * @param roleAssignmentId The fully qualified ID of the role assignment including scope, resource name, and - * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. - * Example: - * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. + * resource type. Format: /{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}. Example: + * /subscriptions/<SUB_ID>/resourcegroups/<RESOURCE_GROUP>/providers/Microsoft.Authorization/roleAssignments/<ROLE_ASSIGNMENT_NAME>. * @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. diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleDefinitionsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleDefinitionsClient.java index 7140290a153fa..8630664df8241 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleDefinitionsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleDefinitionsClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RoleDefinitionsClient. */ +/** + * An instance of this class provides access to all the operations defined in RoleDefinitionsClient. + */ public interface RoleDefinitionsClient extends InnerSupportsDelete { /** * Deletes a role definition. - * + * * @param scope The scope of the role definition. * @param roleDefinitionId The ID of the role definition to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,7 +33,7 @@ public interface RoleDefinitionsClient extends InnerSupportsDelete> createOrUpdateWithResponseAsync( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition); + Mono> createOrUpdateWithResponseAsync(String scope, String roleDefinitionId, + RoleDefinitionInner roleDefinition); /** * Creates or updates a role definition. - * + * * @param scope The scope of the role definition. * @param roleDefinitionId The ID of the role definition. * @param roleDefinition The values for the role definition. @@ -149,12 +151,12 @@ Mono> createOrUpdateWithResponseAsync( * @return role definition on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition); + Mono createOrUpdateAsync(String scope, String roleDefinitionId, + RoleDefinitionInner roleDefinition); /** * Creates or updates a role definition. - * + * * @param scope The scope of the role definition. * @param roleDefinitionId The ID of the role definition. * @param roleDefinition The values for the role definition. @@ -165,12 +167,12 @@ Mono createOrUpdateAsync( * @return role definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, String roleDefinitionId, RoleDefinitionInner roleDefinition, Context context); + Response createOrUpdateWithResponse(String scope, String roleDefinitionId, + RoleDefinitionInner roleDefinition, Context context); /** * Creates or updates a role definition. - * + * * @param scope The scope of the role definition. * @param roleDefinitionId The ID of the role definition. * @param roleDefinition The values for the role definition. @@ -184,10 +186,10 @@ Response createOrUpdateWithResponse( /** * Get all role definitions that are applicable at scope and above. - * + * * @param scope The scope of the role definition. * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as - * well. + * well. * @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. @@ -198,7 +200,7 @@ Response createOrUpdateWithResponse( /** * Get all role definitions that are applicable at scope and above. - * + * * @param scope The scope of the role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -210,40 +212,40 @@ Response createOrUpdateWithResponse( /** * Get all role definitions that are applicable at scope and above. - * + * * @param scope The scope of the role definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above as paginated response with {@link - * PagedIterable}. + * @return all role definitions that are applicable at scope and above as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope); /** * Get all role definitions that are applicable at scope and above. - * + * * @param scope The scope of the role definition. * @param filter The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as - * well. + * well. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all role definitions that are applicable at scope and above as paginated response with {@link - * PagedIterable}. + * @return all role definitions that are applicable at scope and above as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope, String filter, Context context); /** * Gets a role definition by ID. - * + * * @param roleId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level + * role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role + * definitions. * @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. @@ -254,11 +256,11 @@ Response createOrUpdateWithResponse( /** * Gets a role definition by ID. - * + * * @param roleId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level + * role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role + * definitions. * @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. @@ -269,11 +271,11 @@ Response createOrUpdateWithResponse( /** * Gets a role definition by ID. - * + * * @param roleId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level + * role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role + * definitions. * @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. @@ -285,11 +287,11 @@ Response createOrUpdateWithResponse( /** * Gets a role definition by ID. - * + * * @param roleId The fully qualified role definition ID. Use the format, - * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription - * level role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant - * level role definitions. + * /subscriptions/{guid}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for subscription level + * role definitions, or /providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId} for tenant level role + * definitions. * @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. diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilityScheduleInstancesClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilityScheduleInstancesClient.java index 9d85182ecdd2f..bad147a26efac 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilityScheduleInstancesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilityScheduleInstancesClient.java @@ -19,89 +19,89 @@ public interface RoleEligibilityScheduleInstancesClient { /** * Gets role eligibility schedule instances of a role eligibility schedule. - * + * * @param scope The scope of the role eligibility schedule. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or - * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role - * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created - * for the current user. + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below + * the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility + * schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for the current + * user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role eligibility schedule instances of a role eligibility schedule as paginated response with {@link - * PagedFlux}. + * @return role eligibility schedule instances of a role eligibility schedule as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listForScopeAsync(String scope, String filter); /** * Gets role eligibility schedule instances of a role eligibility schedule. - * + * * @param scope The scope of the role eligibility schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role eligibility schedule instances of a role eligibility schedule as paginated response with {@link - * PagedFlux}. + * @return role eligibility schedule instances of a role eligibility schedule as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux listForScopeAsync(String scope); /** * Gets role eligibility schedule instances of a role eligibility schedule. - * + * * @param scope The scope of the role eligibility schedule. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role eligibility schedule instances of a role eligibility schedule as paginated response with {@link - * PagedIterable}. + * @return role eligibility schedule instances of a role eligibility schedule as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForScope(String scope); /** * Gets role eligibility schedule instances of a role eligibility schedule. - * + * * @param scope The scope of the role eligibility schedule. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role assignment schedules - * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or - * below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role - * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created - * for the current user. + * at or above the scope. Use $filter=principalId eq {id} to return all role assignment schedules at, above or below + * the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role eligibility + * schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for the current + * user. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role eligibility schedule instances of a role eligibility schedule as paginated response with {@link - * PagedIterable}. + * @return role eligibility schedule instances of a role eligibility schedule as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForScope(String scope, String filter, Context context); /** * Gets the specified role eligibility schedule instance. - * + * * @param scope The scope of the role eligibility schedules. * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility - * schedule to get. + * schedule to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified role eligibility schedule instance along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String scope, String roleEligibilityScheduleInstanceName); + Mono> getWithResponseAsync(String scope, + String roleEligibilityScheduleInstanceName); /** * Gets the specified role eligibility schedule instance. - * + * * @param scope The scope of the role eligibility schedules. * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility - * schedule to get. + * schedule to get. * @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. @@ -112,10 +112,10 @@ Mono> getWithResponseAsync( /** * Gets the specified role eligibility schedule instance. - * + * * @param scope The scope of the role eligibility schedules. * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility - * schedule to get. + * schedule to get. * @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. @@ -123,15 +123,15 @@ Mono> getWithResponseAsync( * @return the specified role eligibility schedule instance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String roleEligibilityScheduleInstanceName, Context context); + Response getWithResponse(String scope, + String roleEligibilityScheduleInstanceName, Context context); /** * Gets the specified role eligibility schedule instance. - * + * * @param scope The scope of the role eligibility schedules. * @param roleEligibilityScheduleInstanceName The name (hash of schedule name + time) of the role eligibility - * schedule to get. + * schedule to get. * @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. diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilityScheduleRequestsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilityScheduleRequestsClient.java index 2ba23d7b9791c..6f2038a51a8e9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilityScheduleRequestsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilityScheduleRequestsClient.java @@ -13,16 +13,18 @@ import com.azure.resourcemanager.authorization.fluent.models.RoleEligibilityScheduleRequestInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RoleEligibilityScheduleRequestsClient. */ +/** + * An instance of this class provides access to all the operations defined in RoleEligibilityScheduleRequestsClient. + */ public interface RoleEligibilityScheduleRequestsClient { /** * Creates a role eligibility schedule request. - * + * * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource - * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. + * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. * @param parameters Parameters for the role eligibility schedule request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,17 +33,17 @@ public interface RoleEligibilityScheduleRequestsClient { * @return role Eligibility schedule request along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); + Mono> createWithResponseAsync(String scope, + String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); /** * Creates a role eligibility schedule request. - * + * * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource - * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. + * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. * @param parameters Parameters for the role eligibility schedule request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -50,17 +52,17 @@ Mono> createWithResponseAsync( * @return role Eligibility schedule request on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); + Mono createAsync(String scope, String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters); /** * Creates a role eligibility schedule request. - * + * * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource - * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. + * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. * @param parameters Parameters for the role eligibility schedule request. * @param context The context to associate with this operation. @@ -70,20 +72,17 @@ Mono createAsync( * @return role Eligibility schedule request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String scope, - String roleEligibilityScheduleRequestName, - RoleEligibilityScheduleRequestInner parameters, - Context context); + Response createWithResponse(String scope, + String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters, Context context); /** * Creates a role eligibility schedule request. - * + * * @param scope The scope of the role eligibility schedule request to create. The scope can be any REST resource - * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and - * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' - * for a resource. + * instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and + * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider}/{resource-type}/{resource-name}' + * for a resource. * @param roleEligibilityScheduleRequestName The name of the role eligibility to create. It can be any valid GUID. * @param parameters Parameters for the role eligibility schedule request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -92,27 +91,27 @@ Response createWithResponse( * @return role Eligibility schedule request. */ @ServiceMethod(returns = ReturnType.SINGLE) - RoleEligibilityScheduleRequestInner create( - String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); + RoleEligibilityScheduleRequestInner create(String scope, String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters); /** * Get the specified role eligibility schedule request. - * + * * @param scope The scope of the role eligibility schedule request. * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified role eligibility schedule request along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String scope, String roleEligibilityScheduleRequestName); + Mono> getWithResponseAsync(String scope, + String roleEligibilityScheduleRequestName); /** * Get the specified role eligibility schedule request. - * + * * @param scope The scope of the role eligibility schedule request. * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -125,7 +124,7 @@ Mono> getWithResponseAsync( /** * Get the specified role eligibility schedule request. - * + * * @param scope The scope of the role eligibility schedule request. * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. * @param context The context to associate with this operation. @@ -135,12 +134,12 @@ Mono> getWithResponseAsync( * @return the specified role eligibility schedule request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String roleEligibilityScheduleRequestName, Context context); + Response getWithResponse(String scope, + String roleEligibilityScheduleRequestName, Context context); /** * Get the specified role eligibility schedule request. - * + * * @param scope The scope of the role eligibility schedule request. * @param roleEligibilityScheduleRequestName The name (guid) of the role eligibility schedule request to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -153,14 +152,14 @@ Response getWithResponse( /** * Gets role eligibility schedule requests for a scope. - * + * * @param scope The scope of the role eligibility schedule requests. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule - * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule - * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all - * role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role - * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role - * eligibility schedule requests where the current user is an approver. + * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests + * at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role + * eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role + * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role + * eligibility schedule requests where the current user is an approver. * @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. @@ -171,7 +170,7 @@ Response getWithResponse( /** * Gets role eligibility schedule requests for a scope. - * + * * @param scope The scope of the role eligibility schedule requests. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -183,7 +182,7 @@ Response getWithResponse( /** * Gets role eligibility schedule requests for a scope. - * + * * @param scope The scope of the role eligibility schedule requests. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -195,14 +194,14 @@ Response getWithResponse( /** * Gets role eligibility schedule requests for a scope. - * + * * @param scope The scope of the role eligibility schedule requests. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility schedule - * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule - * requests at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all - * role eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role - * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role - * eligibility schedule requests where the current user is an approver. + * requests at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedule requests + * at, above or below the scope for the specified principal. Use $filter=asRequestor() to return all role + * eligibility schedule requests requested by the current user. Use $filter=asTarget() to return all role + * eligibility schedule requests created for the current user. Use $filter=asApprover() to return all role + * eligibility schedule requests where the current user is an approver. * @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. @@ -214,7 +213,7 @@ Response getWithResponse( /** * Cancels a pending role eligibility schedule request. - * + * * @param scope The scope of the role eligibility request to cancel. * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -227,7 +226,7 @@ Response getWithResponse( /** * Cancels a pending role eligibility schedule request. - * + * * @param scope The scope of the role eligibility request to cancel. * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -240,7 +239,7 @@ Response getWithResponse( /** * Cancels a pending role eligibility schedule request. - * + * * @param scope The scope of the role eligibility request to cancel. * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. * @param context The context to associate with this operation. @@ -254,7 +253,7 @@ Response getWithResponse( /** * Cancels a pending role eligibility schedule request. - * + * * @param scope The scope of the role eligibility request to cancel. * @param roleEligibilityScheduleRequestName The name of the role eligibility request to cancel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -266,7 +265,7 @@ Response getWithResponse( /** * Validates a new role eligibility schedule request. - * + * * @param scope The scope of the role eligibility request to validate. * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. * @param parameters Parameters for the role eligibility schedule request. @@ -276,12 +275,12 @@ Response getWithResponse( * @return role Eligibility schedule request along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> validateWithResponseAsync( - String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); + Mono> validateWithResponseAsync(String scope, + String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); /** * Validates a new role eligibility schedule request. - * + * * @param scope The scope of the role eligibility request to validate. * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. * @param parameters Parameters for the role eligibility schedule request. @@ -291,12 +290,12 @@ Mono> validateWithResponseAsync( * @return role Eligibility schedule request on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono validateAsync( - String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); + Mono validateAsync(String scope, String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters); /** * Validates a new role eligibility schedule request. - * + * * @param scope The scope of the role eligibility request to validate. * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. * @param parameters Parameters for the role eligibility schedule request. @@ -307,15 +306,12 @@ Mono validateAsync( * @return role Eligibility schedule request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse( - String scope, - String roleEligibilityScheduleRequestName, - RoleEligibilityScheduleRequestInner parameters, - Context context); + Response validateWithResponse(String scope, + String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters, Context context); /** * Validates a new role eligibility schedule request. - * + * * @param scope The scope of the role eligibility request to validate. * @param roleEligibilityScheduleRequestName The name of the role eligibility request to validate. * @param parameters Parameters for the role eligibility schedule request. @@ -325,6 +321,6 @@ Response validateWithResponse( * @return role Eligibility schedule request. */ @ServiceMethod(returns = ReturnType.SINGLE) - RoleEligibilityScheduleRequestInner validate( - String scope, String roleEligibilityScheduleRequestName, RoleEligibilityScheduleRequestInner parameters); + RoleEligibilityScheduleRequestInner validate(String scope, String roleEligibilityScheduleRequestName, + RoleEligibilityScheduleRequestInner parameters); } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilitySchedulesClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilitySchedulesClient.java index 7b1d05da6977b..ec063a5934ee5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilitySchedulesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleEligibilitySchedulesClient.java @@ -13,25 +13,27 @@ import com.azure.resourcemanager.authorization.fluent.models.RoleEligibilityScheduleInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RoleEligibilitySchedulesClient. */ +/** + * An instance of this class provides access to all the operations defined in RoleEligibilitySchedulesClient. + */ public interface RoleEligibilitySchedulesClient { /** * Get the specified role eligibility schedule for a resource scope. - * + * * @param scope The scope of the role eligibility schedule. * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified role eligibility schedule for a resource scope along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> getWithResponseAsync(String scope, String roleEligibilityScheduleName); /** * Get the specified role eligibility schedule for a resource scope. - * + * * @param scope The scope of the role eligibility schedule. * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -44,7 +46,7 @@ public interface RoleEligibilitySchedulesClient { /** * Get the specified role eligibility schedule for a resource scope. - * + * * @param scope The scope of the role eligibility schedule. * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. * @param context The context to associate with this operation. @@ -54,12 +56,12 @@ public interface RoleEligibilitySchedulesClient { * @return the specified role eligibility schedule for a resource scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String roleEligibilityScheduleName, Context context); + Response getWithResponse(String scope, String roleEligibilityScheduleName, + Context context); /** * Get the specified role eligibility schedule for a resource scope. - * + * * @param scope The scope of the role eligibility schedule. * @param roleEligibilityScheduleName The name (guid) of the role eligibility schedule to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -72,13 +74,13 @@ Response getWithResponse( /** * Gets role eligibility schedules for a resource scope. - * + * * @param scope The scope of the role eligibility schedules. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility - * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, - * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role - * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created - * for the current user. + * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, + * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for + * the current user. * @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. @@ -89,7 +91,7 @@ Response getWithResponse( /** * Gets role eligibility schedules for a resource scope. - * + * * @param scope The scope of the role eligibility schedules. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -101,7 +103,7 @@ Response getWithResponse( /** * Gets role eligibility schedules for a resource scope. - * + * * @param scope The scope of the role eligibility schedules. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -113,13 +115,13 @@ Response getWithResponse( /** * Gets role eligibility schedules for a resource scope. - * + * * @param scope The scope of the role eligibility schedules. * @param filter The filter to apply on the operation. Use $filter=atScope() to return all role eligibility - * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, - * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role - * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created - * for the current user. + * schedules at or above the scope. Use $filter=principalId eq {id} to return all role eligibility schedules at, + * above or below the scope for the specified principal. Use $filter=assignedTo('{userId}') to return all role + * eligibility schedules for the user. Use $filter=asTarget() to return all role eligibility schedules created for + * the current user. * @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-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleManagementPoliciesClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleManagementPoliciesClient.java index 79d98b8d79836..3768c931bb461 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleManagementPoliciesClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleManagementPoliciesClient.java @@ -14,25 +14,27 @@ import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RoleManagementPoliciesClient. */ +/** + * An instance of this class provides access to all the operations defined in RoleManagementPoliciesClient. + */ public interface RoleManagementPoliciesClient extends InnerSupportsDelete { /** * Get the specified role management policy for a resource scope. - * + * * @param scope The scope of the role management policy. * @param roleManagementPolicyName The name (guid) of the role management policy to get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified role management policy for a resource scope along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono> getWithResponseAsync(String scope, String roleManagementPolicyName); /** * Get the specified role management policy for a resource scope. - * + * * @param scope The scope of the role management policy. * @param roleManagementPolicyName The name (guid) of the role management policy to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -45,7 +47,7 @@ public interface RoleManagementPoliciesClient extends InnerSupportsDelete /** * Get the specified role management policy for a resource scope. - * + * * @param scope The scope of the role management policy. * @param roleManagementPolicyName The name (guid) of the role management policy to get. * @param context The context to associate with this operation. @@ -59,7 +61,7 @@ public interface RoleManagementPoliciesClient extends InnerSupportsDelete /** * Get the specified role management policy for a resource scope. - * + * * @param scope The scope of the role management policy. * @param roleManagementPolicyName The name (guid) of the role management policy to get. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -72,7 +74,7 @@ public interface RoleManagementPoliciesClient extends InnerSupportsDelete /** * Update a role management policy. - * + * * @param scope The scope of the role management policy to upsert. * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. * @param parameters Parameters for the role management policy. @@ -82,12 +84,12 @@ public interface RoleManagementPoliciesClient extends InnerSupportsDelete * @return role management policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateWithResponseAsync( - String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters); + Mono> updateWithResponseAsync(String scope, String roleManagementPolicyName, + RoleManagementPolicyInner parameters); /** * Update a role management policy. - * + * * @param scope The scope of the role management policy to upsert. * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. * @param parameters Parameters for the role management policy. @@ -97,12 +99,12 @@ Mono> updateWithResponseAsync( * @return role management policy on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync( - String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters); + Mono updateAsync(String scope, String roleManagementPolicyName, + RoleManagementPolicyInner parameters); /** * Update a role management policy. - * + * * @param scope The scope of the role management policy to upsert. * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. * @param parameters Parameters for the role management policy. @@ -113,12 +115,12 @@ Mono updateAsync( * @return role management policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters, Context context); + Response updateWithResponse(String scope, String roleManagementPolicyName, + RoleManagementPolicyInner parameters, Context context); /** * Update a role management policy. - * + * * @param scope The scope of the role management policy to upsert. * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. * @param parameters Parameters for the role management policy. @@ -128,12 +130,12 @@ Response updateWithResponse( * @return role management policy. */ @ServiceMethod(returns = ReturnType.SINGLE) - RoleManagementPolicyInner update( - String scope, String roleManagementPolicyName, RoleManagementPolicyInner parameters); + RoleManagementPolicyInner update(String scope, String roleManagementPolicyName, + RoleManagementPolicyInner parameters); /** * Delete a role management policy. - * + * * @param scope The scope of the role management policy to upsert. * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -146,7 +148,7 @@ RoleManagementPolicyInner update( /** * Delete a role management policy. - * + * * @param scope The scope of the role management policy to upsert. * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -159,7 +161,7 @@ RoleManagementPolicyInner update( /** * Delete a role management policy. - * + * * @param scope The scope of the role management policy to upsert. * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. * @param context The context to associate with this operation. @@ -173,7 +175,7 @@ RoleManagementPolicyInner update( /** * Delete a role management policy. - * + * * @param scope The scope of the role management policy to upsert. * @param roleManagementPolicyName The name (guid) of the role management policy to upsert. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -185,7 +187,7 @@ RoleManagementPolicyInner update( /** * Gets role management policies for a resource scope. - * + * * @param scope The scope of the role management policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -197,7 +199,7 @@ RoleManagementPolicyInner update( /** * Gets role management policies for a resource scope. - * + * * @param scope The scope of the role management policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -209,7 +211,7 @@ RoleManagementPolicyInner update( /** * Gets role management policies for a resource scope. - * + * * @param scope The scope of the role management policy. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleManagementPolicyAssignmentsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleManagementPolicyAssignmentsClient.java index 54d656befd5fb..92bb15becfa96 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleManagementPolicyAssignmentsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/RoleManagementPolicyAssignmentsClient.java @@ -14,45 +14,47 @@ import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in RoleManagementPolicyAssignmentsClient. */ +/** + * An instance of this class provides access to all the operations defined in RoleManagementPolicyAssignmentsClient. + */ public interface RoleManagementPolicyAssignmentsClient extends InnerSupportsDelete { /** * Get the specified role management policy assignment for a resource scope. - * + * * @param scope The scope of the role management policy. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * get. + * get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the specified role management policy assignment for a resource scope along with {@link Response} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync( - String scope, String roleManagementPolicyAssignmentName); + Mono> getWithResponseAsync(String scope, + String roleManagementPolicyAssignmentName); /** * Get the specified role management policy assignment for a resource scope. - * + * * @param scope The scope of the role management policy. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * get. + * get. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified role management policy assignment for a resource scope on successful completion of {@link - * Mono}. + * @return the specified role management policy assignment for a resource scope on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono getAsync(String scope, String roleManagementPolicyAssignmentName); /** * Get the specified role management policy assignment for a resource scope. - * + * * @param scope The scope of the role management policy. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * get. + * get. * @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. @@ -60,15 +62,15 @@ Mono> getWithResponseAsync( * @return the specified role management policy assignment for a resource scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String roleManagementPolicyAssignmentName, Context context); + Response getWithResponse(String scope, + String roleManagementPolicyAssignmentName, Context context); /** * Get the specified role management policy assignment for a resource scope. - * + * * @param scope The scope of the role management policy. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * get. + * get. * @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. @@ -79,10 +81,10 @@ Response getWithResponse( /** * Create a role management policy assignment. - * + * * @param scope The scope of the role management policy assignment to upsert. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * upsert. + * upsert. * @param parameters Parameters for the role management policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -90,15 +92,15 @@ Response getWithResponse( * @return role management policy along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createWithResponseAsync( - String scope, String roleManagementPolicyAssignmentName, RoleManagementPolicyAssignmentInner parameters); + Mono> createWithResponseAsync(String scope, + String roleManagementPolicyAssignmentName, RoleManagementPolicyAssignmentInner parameters); /** * Create a role management policy assignment. - * + * * @param scope The scope of the role management policy assignment to upsert. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * upsert. + * upsert. * @param parameters Parameters for the role management policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -106,15 +108,15 @@ Mono> createWithResponseAsync( * @return role management policy on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createAsync( - String scope, String roleManagementPolicyAssignmentName, RoleManagementPolicyAssignmentInner parameters); + Mono createAsync(String scope, String roleManagementPolicyAssignmentName, + RoleManagementPolicyAssignmentInner parameters); /** * Create a role management policy assignment. - * + * * @param scope The scope of the role management policy assignment to upsert. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * upsert. + * upsert. * @param parameters Parameters for the role management policy assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -123,18 +125,15 @@ Mono createAsync( * @return role management policy along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String scope, - String roleManagementPolicyAssignmentName, - RoleManagementPolicyAssignmentInner parameters, - Context context); + Response createWithResponse(String scope, + String roleManagementPolicyAssignmentName, RoleManagementPolicyAssignmentInner parameters, Context context); /** * Create a role management policy assignment. - * + * * @param scope The scope of the role management policy assignment to upsert. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * upsert. + * upsert. * @param parameters Parameters for the role management policy assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -142,15 +141,15 @@ Response createWithResponse( * @return role management policy. */ @ServiceMethod(returns = ReturnType.SINGLE) - RoleManagementPolicyAssignmentInner create( - String scope, String roleManagementPolicyAssignmentName, RoleManagementPolicyAssignmentInner parameters); + RoleManagementPolicyAssignmentInner create(String scope, String roleManagementPolicyAssignmentName, + RoleManagementPolicyAssignmentInner parameters); /** * Delete a role management policy assignment. - * + * * @param scope The scope of the role management policy assignment to delete. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * delete. + * delete. * @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. @@ -161,10 +160,10 @@ RoleManagementPolicyAssignmentInner create( /** * Delete a role management policy assignment. - * + * * @param scope The scope of the role management policy assignment to delete. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * delete. + * delete. * @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. @@ -175,10 +174,10 @@ RoleManagementPolicyAssignmentInner create( /** * Delete a role management policy assignment. - * + * * @param scope The scope of the role management policy assignment to delete. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * delete. + * delete. * @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. @@ -190,10 +189,10 @@ RoleManagementPolicyAssignmentInner create( /** * Delete a role management policy assignment. - * + * * @param scope The scope of the role management policy assignment to delete. * @param roleManagementPolicyAssignmentName The name of format {guid_guid} the role management policy assignment to - * delete. + * delete. * @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. @@ -203,7 +202,7 @@ RoleManagementPolicyAssignmentInner create( /** * Gets role management assignment policies for a resource scope. - * + * * @param scope The scope of the role management policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -215,27 +214,27 @@ RoleManagementPolicyAssignmentInner create( /** * Gets role management assignment policies for a resource scope. - * + * * @param scope The scope of the role management policy. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role management assignment policies for a resource scope as paginated response with {@link - * PagedIterable}. + * @return role management assignment policies for a resource scope as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForScope(String scope); /** * Gets role management assignment policies for a resource scope. - * + * * @param scope The scope of the role management policy. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return role management assignment policies for a resource scope as paginated response with {@link - * PagedIterable}. + * @return role management assignment policies for a resource scope as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listForScope(String scope, Context context); diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsClient.java index e46d1a46808bd..216bf6ffbd945 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsClient.java @@ -14,62 +14,64 @@ import com.azure.resourcemanager.authorization.fluent.models.ServicePrincipalsAddPasswordRequestBodyInner; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ServicePrincipalsClient. */ +/** + * An instance of this class provides access to all the operations defined in ServicePrincipalsClient. + */ public interface ServicePrincipalsClient { /** * Invoke action addKey. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keyCredential along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addKeyWithResponseAsync( - String servicePrincipalId, ServicePrincipalsAddKeyRequestBodyInner body); + Mono> addKeyWithResponseAsync(String servicePrincipalId, + ServicePrincipalsAddKeyRequestBodyInner body); /** * Invoke action addKey. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keyCredential on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono addKeyAsync( - String servicePrincipalId, ServicePrincipalsAddKeyRequestBodyInner body); + Mono addKeyAsync(String servicePrincipalId, + ServicePrincipalsAddKeyRequestBodyInner body); /** * Invoke action addKey. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keyCredential along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response addKeyWithResponse( - String servicePrincipalId, ServicePrincipalsAddKeyRequestBodyInner body, Context context); + Response addKeyWithResponse(String servicePrincipalId, + ServicePrincipalsAddKeyRequestBodyInner body, Context context); /** * Invoke action addKey. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return keyCredential. */ @@ -78,62 +80,62 @@ Response addKeyWithResponse( /** * Invoke action addPassword. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return passwordCredential along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addPasswordWithResponseAsync( - String servicePrincipalId, ServicePrincipalsAddPasswordRequestBodyInner body); + Mono> addPasswordWithResponseAsync(String servicePrincipalId, + ServicePrincipalsAddPasswordRequestBodyInner body); /** * Invoke action addPassword. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return passwordCredential on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono addPasswordAsync( - String servicePrincipalId, ServicePrincipalsAddPasswordRequestBodyInner body); + Mono addPasswordAsync(String servicePrincipalId, + ServicePrincipalsAddPasswordRequestBodyInner body); /** * Invoke action addPassword. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body Action parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return passwordCredential along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response addPasswordWithResponse( - String servicePrincipalId, ServicePrincipalsAddPasswordRequestBodyInner body, Context context); + Response addPasswordWithResponse(String servicePrincipalId, + ServicePrincipalsAddPasswordRequestBodyInner body, Context context); /** * Invoke action addPassword. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body Action parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return passwordCredential. */ @ServiceMethod(returns = ReturnType.SINGLE) - MicrosoftGraphPasswordCredentialInner addPassword( - String servicePrincipalId, ServicePrincipalsAddPasswordRequestBodyInner body); + MicrosoftGraphPasswordCredentialInner addPassword(String servicePrincipalId, + ServicePrincipalsAddPasswordRequestBodyInner body); } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsServicePrincipalsClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsServicePrincipalsClient.java index 527449ba3e783..f67e60537677a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsServicePrincipalsClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/ServicePrincipalsServicePrincipalsClient.java @@ -23,7 +23,7 @@ public interface ServicePrincipalsServicePrincipalsClient { /** * Get entities from servicePrincipals. - * + * * @param consistencyLevel Indicates the requested consistency level. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -35,27 +35,21 @@ public interface ServicePrincipalsServicePrincipalsClient { * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from servicePrincipals as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listServicePrincipalAsync( - String consistencyLevel, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, + PagedFlux listServicePrincipalAsync(String consistencyLevel, Integer top, + Integer skip, String search, String filter, Boolean count, + List orderby, List select, List expand); /** * Get entities from servicePrincipals. - * + * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from servicePrincipals as paginated response with {@link PagedFlux}. */ @@ -64,9 +58,9 @@ PagedFlux listServicePrincipalAsync( /** * Get entities from servicePrincipals. - * + * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from servicePrincipals as paginated response with {@link PagedIterable}. */ @@ -75,7 +69,7 @@ PagedFlux listServicePrincipalAsync( /** * Get entities from servicePrincipals. - * + * * @param consistencyLevel Indicates the requested consistency level. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -88,44 +82,37 @@ PagedFlux listServicePrincipalAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from servicePrincipals as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listServicePrincipal( - String consistencyLevel, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand, - Context context); + PagedIterable listServicePrincipal(String consistencyLevel, Integer top, + Integer skip, String search, String filter, Boolean count, + List orderby, List select, + List expand, Context context); /** * Add new entity to servicePrincipals. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return servicePrincipal along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> createServicePrincipalWithResponseAsync( - MicrosoftGraphServicePrincipalInner body); + Mono> + createServicePrincipalWithResponseAsync(MicrosoftGraphServicePrincipalInner body); /** * Add new entity to servicePrincipals. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return servicePrincipal on successful completion of {@link Mono}. */ @@ -134,26 +121,26 @@ Mono> createServicePrincipalWithRe /** * Add new entity to servicePrincipals. - * + * * @param body New entity. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return servicePrincipal along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createServicePrincipalWithResponse( - MicrosoftGraphServicePrincipalInner body, Context context); + Response + createServicePrincipalWithResponse(MicrosoftGraphServicePrincipalInner body, Context context); /** * Add new entity to servicePrincipals. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return servicePrincipal. */ @@ -162,32 +149,30 @@ Response createServicePrincipalWithResponse /** * Get entity from servicePrincipals by key. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param consistencyLevel Indicates the requested consistency level. * @param select Select properties to be returned. * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return entity from servicePrincipals by key along with {@link Response} on successful completion of {@link - * Mono}. + * @return entity from servicePrincipals by key along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getServicePrincipalWithResponseAsync( - String servicePrincipalId, - String consistencyLevel, - List select, + Mono> getServicePrincipalWithResponseAsync(String servicePrincipalId, + String consistencyLevel, List select, List expand); /** * Get entity from servicePrincipals by key. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from servicePrincipals by key on successful completion of {@link Mono}. */ @@ -196,7 +181,7 @@ Mono> getServicePrincipalWithRespo /** * Get entity from servicePrincipals by key. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param consistencyLevel Indicates the requested consistency level. * @param select Select properties to be returned. @@ -204,25 +189,22 @@ Mono> getServicePrincipalWithRespo * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from servicePrincipals by key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getServicePrincipalWithResponse( - String servicePrincipalId, - String consistencyLevel, - List select, - List expand, - Context context); + Response getServicePrincipalWithResponse(String servicePrincipalId, + String consistencyLevel, List select, + List expand, Context context); /** * Get entity from servicePrincipals by key. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from servicePrincipals by key. */ @@ -231,27 +213,27 @@ Response getServicePrincipalWithResponse( /** * Update entity in servicePrincipals. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> updateServicePrincipalWithResponseAsync( - String servicePrincipalId, MicrosoftGraphServicePrincipalInner body); + Mono> updateServicePrincipalWithResponseAsync(String servicePrincipalId, + MicrosoftGraphServicePrincipalInner body); /** * Update entity in servicePrincipals. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -260,28 +242,28 @@ Mono> updateServicePrincipalWithResponseAsync( /** * Update entity in servicePrincipals. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body New property values. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateServicePrincipalWithResponse( - String servicePrincipalId, MicrosoftGraphServicePrincipalInner body, Context context); + Response updateServicePrincipalWithResponse(String servicePrincipalId, + MicrosoftGraphServicePrincipalInner body, Context context); /** * Update entity in servicePrincipals. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -289,12 +271,12 @@ Response updateServicePrincipalWithResponse( /** * Delete entity from servicePrincipals. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param ifMatch ETag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -303,11 +285,11 @@ Response updateServicePrincipalWithResponse( /** * Delete entity from servicePrincipals. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -316,13 +298,13 @@ Response updateServicePrincipalWithResponse( /** * Delete entity from servicePrincipals. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @param ifMatch ETag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -331,11 +313,11 @@ Response updateServicePrincipalWithResponse( /** * Delete entity from servicePrincipals. - * + * * @param servicePrincipalId key: id of servicePrincipal. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/UsersUsersClient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/UsersUsersClient.java index 4275ba433f7a5..eb5705e037245 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/UsersUsersClient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/UsersUsersClient.java @@ -19,11 +19,13 @@ import java.util.List; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in UsersUsersClient. */ +/** + * An instance of this class provides access to all the operations defined in UsersUsersClient. + */ public interface UsersUsersClient { /** * Get entities from users. - * + * * @param consistencyLevel Indicates the requested consistency level. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -35,27 +37,20 @@ public interface UsersUsersClient { * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from users as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listUserAsync( - String consistencyLevel, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, + PagedFlux listUserAsync(String consistencyLevel, Integer top, Integer skip, String search, + String filter, Boolean count, List orderby, List select, List expand); /** * Get entities from users. - * + * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from users as paginated response with {@link PagedFlux}. */ @@ -64,9 +59,9 @@ PagedFlux listUserAsync( /** * Get entities from users. - * + * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from users as paginated response with {@link PagedIterable}. */ @@ -75,7 +70,7 @@ PagedFlux listUserAsync( /** * Get entities from users. - * + * * @param consistencyLevel Indicates the requested consistency level. * @param top Show only the first n items. * @param skip Skip the first n items. @@ -88,30 +83,22 @@ PagedFlux listUserAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from users as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listUser( - String consistencyLevel, - Integer top, - Integer skip, - String search, - String filter, - Boolean count, - List orderby, - List select, - List expand, - Context context); + PagedIterable listUser(String consistencyLevel, Integer top, Integer skip, String search, + String filter, Boolean count, List orderby, List select, + List expand, Context context); /** * Add new entity to users. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return user along with {@link Response} on successful completion of {@link Mono}. */ @@ -120,11 +107,11 @@ PagedIterable listUser( /** * Add new entity to users. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return user on successful completion of {@link Mono}. */ @@ -133,12 +120,12 @@ PagedIterable listUser( /** * Add new entity to users. - * + * * @param body New entity. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return user along with {@link Response}. */ @@ -147,11 +134,11 @@ PagedIterable listUser( /** * Add new entity to users. - * + * * @param body New entity. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return user. */ @@ -160,28 +147,28 @@ PagedIterable listUser( /** * Get entity from users by key. - * + * * @param userId key: id of user. * @param consistencyLevel Indicates the requested consistency level. * @param select Select properties to be returned. * @param expand Expand related entities. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from users by key along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getUserWithResponseAsync( - String userId, String consistencyLevel, List select, List expand); + Mono> getUserWithResponseAsync(String userId, String consistencyLevel, + List select, List expand); /** * Get entity from users by key. - * + * * @param userId key: id of user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from users by key on successful completion of {@link Mono}. */ @@ -190,7 +177,7 @@ Mono> getUserWithResponseAsync( /** * Get entity from users by key. - * + * * @param userId key: id of user. * @param consistencyLevel Indicates the requested consistency level. * @param select Select properties to be returned. @@ -198,25 +185,21 @@ Mono> getUserWithResponseAsync( * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from users by key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getUserWithResponse( - String userId, - String consistencyLevel, - List select, - List expand, - Context context); + Response getUserWithResponse(String userId, String consistencyLevel, + List select, List expand, Context context); /** * Get entity from users by key. - * + * * @param userId key: id of user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entity from users by key. */ @@ -225,12 +208,12 @@ Response getUserWithResponse( /** * Update entity in users. - * + * * @param userId key: id of user. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -239,12 +222,12 @@ Response getUserWithResponse( /** * Update entity in users. - * + * * @param userId key: id of user. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -253,13 +236,13 @@ Response getUserWithResponse( /** * Update entity in users. - * + * * @param userId key: id of user. * @param body New property values. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -268,12 +251,12 @@ Response getUserWithResponse( /** * Update entity in users. - * + * * @param userId key: id of user. * @param body New property values. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -281,12 +264,12 @@ Response getUserWithResponse( /** * Delete entity from users. - * + * * @param userId key: id of user. * @param ifMatch ETag. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @@ -295,11 +278,11 @@ Response getUserWithResponse( /** * Delete entity from users. - * + * * @param userId key: id of user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */ @@ -308,13 +291,13 @@ Response getUserWithResponse( /** * Delete entity from users. - * + * * @param userId key: id of user. * @param ifMatch ETag. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response}. */ @@ -323,11 +306,11 @@ Response getUserWithResponse( /** * Delete entity from users. - * + * * @param userId key: id of user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is - * rejected by server. + * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsAddKeyRequestBodyInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsAddKeyRequestBodyInner.java index 7a47c1b751f9a..c3615997928d9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsAddKeyRequestBodyInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsAddKeyRequestBodyInner.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** The ApplicationsAddKeyRequestBody model. */ +/** + * The ApplicationsAddKeyRequestBody model. + */ @Fluent -public final class ApplicationsAddKeyRequestBodyInner { +public final class ApplicationsAddKeyRequestBodyInner implements JsonSerializable { /* * keyCredential */ - @JsonProperty(value = "keyCredential") private MicrosoftGraphKeyCredentialInner keyCredential; /* * passwordCredential */ - @JsonProperty(value = "passwordCredential") private MicrosoftGraphPasswordCredentialInner passwordCredential; /* * The proof property. */ - @JsonProperty(value = "proof") private String proof; /* * Dictionary of */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of ApplicationsAddKeyRequestBodyInner class. */ + /** + * Creates an instance of ApplicationsAddKeyRequestBodyInner class. + */ public ApplicationsAddKeyRequestBodyInner() { } /** * Get the keyCredential property: keyCredential. - * + * * @return the keyCredential value. */ public MicrosoftGraphKeyCredentialInner keyCredential() { @@ -53,7 +55,7 @@ public MicrosoftGraphKeyCredentialInner keyCredential() { /** * Set the keyCredential property: keyCredential. - * + * * @param keyCredential the keyCredential value to set. * @return the ApplicationsAddKeyRequestBodyInner object itself. */ @@ -64,7 +66,7 @@ public ApplicationsAddKeyRequestBodyInner withKeyCredential(MicrosoftGraphKeyCre /** * Get the passwordCredential property: passwordCredential. - * + * * @return the passwordCredential value. */ public MicrosoftGraphPasswordCredentialInner passwordCredential() { @@ -73,19 +75,19 @@ public MicrosoftGraphPasswordCredentialInner passwordCredential() { /** * Set the passwordCredential property: passwordCredential. - * + * * @param passwordCredential the passwordCredential value to set. * @return the ApplicationsAddKeyRequestBodyInner object itself. */ - public ApplicationsAddKeyRequestBodyInner withPasswordCredential( - MicrosoftGraphPasswordCredentialInner passwordCredential) { + public ApplicationsAddKeyRequestBodyInner + withPasswordCredential(MicrosoftGraphPasswordCredentialInner passwordCredential) { this.passwordCredential = passwordCredential; return this; } /** * Get the proof property: The proof property. - * + * * @return the proof value. */ public String proof() { @@ -94,7 +96,7 @@ public String proof() { /** * Set the proof property: The proof property. - * + * * @param proof the proof value to set. * @return the ApplicationsAddKeyRequestBodyInner object itself. */ @@ -105,17 +107,16 @@ public ApplicationsAddKeyRequestBodyInner withProof(String proof) { /** * Get the additionalProperties property: Dictionary of <AnyObject>. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Dictionary of <AnyObject>. - * + * * @param additionalProperties the additionalProperties value to set. * @return the ApplicationsAddKeyRequestBodyInner object itself. */ @@ -124,17 +125,9 @@ public ApplicationsAddKeyRequestBodyInner withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -145,4 +138,60 @@ public void validate() { passwordCredential().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("keyCredential", this.keyCredential); + jsonWriter.writeJsonField("passwordCredential", this.passwordCredential); + jsonWriter.writeStringField("proof", this.proof); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationsAddKeyRequestBodyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationsAddKeyRequestBodyInner 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 ApplicationsAddKeyRequestBodyInner. + */ + public static ApplicationsAddKeyRequestBodyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationsAddKeyRequestBodyInner deserializedApplicationsAddKeyRequestBodyInner + = new ApplicationsAddKeyRequestBodyInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyCredential".equals(fieldName)) { + deserializedApplicationsAddKeyRequestBodyInner.keyCredential + = MicrosoftGraphKeyCredentialInner.fromJson(reader); + } else if ("passwordCredential".equals(fieldName)) { + deserializedApplicationsAddKeyRequestBodyInner.passwordCredential + = MicrosoftGraphPasswordCredentialInner.fromJson(reader); + } else if ("proof".equals(fieldName)) { + deserializedApplicationsAddKeyRequestBodyInner.proof = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedApplicationsAddKeyRequestBodyInner.additionalProperties = additionalProperties; + + return deserializedApplicationsAddKeyRequestBodyInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsAddPasswordRequestBodyInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsAddPasswordRequestBodyInner.java index 026f6c79d4136..d0863ba2f4c1e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsAddPasswordRequestBodyInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsAddPasswordRequestBodyInner.java @@ -5,34 +5,39 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** The ApplicationsAddPasswordRequestBody model. */ +/** + * The ApplicationsAddPasswordRequestBody model. + */ @Fluent -public final class ApplicationsAddPasswordRequestBodyInner { +public final class ApplicationsAddPasswordRequestBodyInner + implements JsonSerializable { /* * passwordCredential */ - @JsonProperty(value = "passwordCredential") private MicrosoftGraphPasswordCredentialInner passwordCredential; /* * Dictionary of */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of ApplicationsAddPasswordRequestBodyInner class. */ + /** + * Creates an instance of ApplicationsAddPasswordRequestBodyInner class. + */ public ApplicationsAddPasswordRequestBodyInner() { } /** * Get the passwordCredential property: passwordCredential. - * + * * @return the passwordCredential value. */ public MicrosoftGraphPasswordCredentialInner passwordCredential() { @@ -41,29 +46,28 @@ public MicrosoftGraphPasswordCredentialInner passwordCredential() { /** * Set the passwordCredential property: passwordCredential. - * + * * @param passwordCredential the passwordCredential value to set. * @return the ApplicationsAddPasswordRequestBodyInner object itself. */ - public ApplicationsAddPasswordRequestBodyInner withPasswordCredential( - MicrosoftGraphPasswordCredentialInner passwordCredential) { + public ApplicationsAddPasswordRequestBodyInner + withPasswordCredential(MicrosoftGraphPasswordCredentialInner passwordCredential) { this.passwordCredential = passwordCredential; return this; } /** * Get the additionalProperties property: Dictionary of <AnyObject>. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Dictionary of <AnyObject>. - * + * * @param additionalProperties the additionalProperties value to set. * @return the ApplicationsAddPasswordRequestBodyInner object itself. */ @@ -72,17 +76,9 @@ public ApplicationsAddPasswordRequestBodyInner withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -90,4 +86,53 @@ public void validate() { passwordCredential().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("passwordCredential", this.passwordCredential); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationsAddPasswordRequestBodyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationsAddPasswordRequestBodyInner 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 ApplicationsAddPasswordRequestBodyInner. + */ + public static ApplicationsAddPasswordRequestBodyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationsAddPasswordRequestBodyInner deserializedApplicationsAddPasswordRequestBodyInner + = new ApplicationsAddPasswordRequestBodyInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("passwordCredential".equals(fieldName)) { + deserializedApplicationsAddPasswordRequestBodyInner.passwordCredential + = MicrosoftGraphPasswordCredentialInner.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedApplicationsAddPasswordRequestBodyInner.additionalProperties = additionalProperties; + + return deserializedApplicationsAddPasswordRequestBodyInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsCheckMemberGroupsRequestBody.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsCheckMemberGroupsRequestBody.java index 4fbdd3b9d348d..3e823d901d52e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsCheckMemberGroupsRequestBody.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsCheckMemberGroupsRequestBody.java @@ -5,35 +5,40 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** The ApplicationsCheckMemberGroupsRequestBody model. */ +/** + * The ApplicationsCheckMemberGroupsRequestBody model. + */ @Fluent -public final class ApplicationsCheckMemberGroupsRequestBody { +public final class ApplicationsCheckMemberGroupsRequestBody + implements JsonSerializable { /* * The groupIds property. */ - @JsonProperty(value = "groupIds") private List groupIds; /* * Dictionary of */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of ApplicationsCheckMemberGroupsRequestBody class. */ + /** + * Creates an instance of ApplicationsCheckMemberGroupsRequestBody class. + */ public ApplicationsCheckMemberGroupsRequestBody() { } /** * Get the groupIds property: The groupIds property. - * + * * @return the groupIds value. */ public List groupIds() { @@ -42,7 +47,7 @@ public List groupIds() { /** * Set the groupIds property: The groupIds property. - * + * * @param groupIds the groupIds value to set. * @return the ApplicationsCheckMemberGroupsRequestBody object itself. */ @@ -53,17 +58,16 @@ public ApplicationsCheckMemberGroupsRequestBody withGroupIds(List groupI /** * Get the additionalProperties property: Dictionary of <AnyObject>. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Dictionary of <AnyObject>. - * + * * @param additionalProperties the additionalProperties value to set. * @return the ApplicationsCheckMemberGroupsRequestBody object itself. */ @@ -72,19 +76,60 @@ public ApplicationsCheckMemberGroupsRequestBody withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("groupIds", this.groupIds, (writer, element) -> writer.writeString(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationsCheckMemberGroupsRequestBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationsCheckMemberGroupsRequestBody 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 ApplicationsCheckMemberGroupsRequestBody. + */ + public static ApplicationsCheckMemberGroupsRequestBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationsCheckMemberGroupsRequestBody deserializedApplicationsCheckMemberGroupsRequestBody + = new ApplicationsCheckMemberGroupsRequestBody(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationsCheckMemberGroupsRequestBody.groupIds = groupIds; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedApplicationsCheckMemberGroupsRequestBody.additionalProperties = additionalProperties; + + return deserializedApplicationsCheckMemberGroupsRequestBody; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsCheckMemberObjectsRequestBody.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsCheckMemberObjectsRequestBody.java index 9afb1469b6d68..633158720973d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsCheckMemberObjectsRequestBody.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsCheckMemberObjectsRequestBody.java @@ -5,35 +5,40 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** The ApplicationsCheckMemberObjectsRequestBody model. */ +/** + * The ApplicationsCheckMemberObjectsRequestBody model. + */ @Fluent -public final class ApplicationsCheckMemberObjectsRequestBody { +public final class ApplicationsCheckMemberObjectsRequestBody + implements JsonSerializable { /* * The ids property. */ - @JsonProperty(value = "ids") private List ids; /* * Dictionary of */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of ApplicationsCheckMemberObjectsRequestBody class. */ + /** + * Creates an instance of ApplicationsCheckMemberObjectsRequestBody class. + */ public ApplicationsCheckMemberObjectsRequestBody() { } /** * Get the ids property: The ids property. - * + * * @return the ids value. */ public List ids() { @@ -42,7 +47,7 @@ public List ids() { /** * Set the ids property: The ids property. - * + * * @param ids the ids value to set. * @return the ApplicationsCheckMemberObjectsRequestBody object itself. */ @@ -53,39 +58,79 @@ public ApplicationsCheckMemberObjectsRequestBody withIds(List ids) { /** * Get the additionalProperties property: Dictionary of <AnyObject>. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Dictionary of <AnyObject>. - * + * * @param additionalProperties the additionalProperties value to set. * @return the ApplicationsCheckMemberObjectsRequestBody object itself. */ - public ApplicationsCheckMemberObjectsRequestBody withAdditionalProperties( - Map additionalProperties) { + public ApplicationsCheckMemberObjectsRequestBody + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ids", this.ids, (writer, element) -> writer.writeString(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationsCheckMemberObjectsRequestBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationsCheckMemberObjectsRequestBody 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 ApplicationsCheckMemberObjectsRequestBody. + */ + public static ApplicationsCheckMemberObjectsRequestBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationsCheckMemberObjectsRequestBody deserializedApplicationsCheckMemberObjectsRequestBody + = new ApplicationsCheckMemberObjectsRequestBody(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ids".equals(fieldName)) { + List ids = reader.readArray(reader1 -> reader1.getString()); + deserializedApplicationsCheckMemberObjectsRequestBody.ids = ids; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedApplicationsCheckMemberObjectsRequestBody.additionalProperties = additionalProperties; + + return deserializedApplicationsCheckMemberObjectsRequestBody; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsExpand.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsExpand.java index eaf07ab1a7d25..768bce29c4a38 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsExpand.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsExpand.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ApplicationsExpand. */ +/** + * Defines values for ApplicationsExpand. + */ public final class ApplicationsExpand extends ExpandableStringEnum { - /** Static value * for ApplicationsExpand. */ + /** + * Static value * for ApplicationsExpand. + */ public static final ApplicationsExpand ASTERISK = fromString("*"); - /** Static value appliesTo for ApplicationsExpand. */ + /** + * Static value appliesTo for ApplicationsExpand. + */ public static final ApplicationsExpand APPLIES_TO = fromString("appliesTo"); /** * Creates a new instance of ApplicationsExpand value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public ApplicationsExpand() { /** * Creates or finds a ApplicationsExpand from its string representation. - * + * * @param name a name to look for. * @return the corresponding ApplicationsExpand. */ - @JsonCreator public static ApplicationsExpand fromString(String name) { return fromString(name, ApplicationsExpand.class); } /** * Gets known ApplicationsExpand values. - * + * * @return known ApplicationsExpand values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsGetMemberGroupsRequestBody.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsGetMemberGroupsRequestBody.java index 8e1619e969512..5dab1ddd987c5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsGetMemberGroupsRequestBody.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsGetMemberGroupsRequestBody.java @@ -5,34 +5,39 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** The ApplicationsGetMemberGroupsRequestBody model. */ +/** + * The ApplicationsGetMemberGroupsRequestBody model. + */ @Fluent -public final class ApplicationsGetMemberGroupsRequestBody { +public final class ApplicationsGetMemberGroupsRequestBody + implements JsonSerializable { /* * The securityEnabledOnly property. */ - @JsonProperty(value = "securityEnabledOnly") private Boolean securityEnabledOnly; /* * Dictionary of */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of ApplicationsGetMemberGroupsRequestBody class. */ + /** + * Creates an instance of ApplicationsGetMemberGroupsRequestBody class. + */ public ApplicationsGetMemberGroupsRequestBody() { } /** * Get the securityEnabledOnly property: The securityEnabledOnly property. - * + * * @return the securityEnabledOnly value. */ public Boolean securityEnabledOnly() { @@ -41,7 +46,7 @@ public Boolean securityEnabledOnly() { /** * Set the securityEnabledOnly property: The securityEnabledOnly property. - * + * * @param securityEnabledOnly the securityEnabledOnly value to set. * @return the ApplicationsGetMemberGroupsRequestBody object itself. */ @@ -52,17 +57,16 @@ public ApplicationsGetMemberGroupsRequestBody withSecurityEnabledOnly(Boolean se /** * Get the additionalProperties property: Dictionary of <AnyObject>. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Dictionary of <AnyObject>. - * + * * @param additionalProperties the additionalProperties value to set. * @return the ApplicationsGetMemberGroupsRequestBody object itself. */ @@ -71,19 +75,60 @@ public ApplicationsGetMemberGroupsRequestBody withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("securityEnabledOnly", this.securityEnabledOnly); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationsGetMemberGroupsRequestBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationsGetMemberGroupsRequestBody 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 ApplicationsGetMemberGroupsRequestBody. + */ + public static ApplicationsGetMemberGroupsRequestBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationsGetMemberGroupsRequestBody deserializedApplicationsGetMemberGroupsRequestBody + = new ApplicationsGetMemberGroupsRequestBody(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securityEnabledOnly".equals(fieldName)) { + deserializedApplicationsGetMemberGroupsRequestBody.securityEnabledOnly + = reader.getNullable(JsonReader::getBoolean); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedApplicationsGetMemberGroupsRequestBody.additionalProperties = additionalProperties; + + return deserializedApplicationsGetMemberGroupsRequestBody; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsGetMemberObjectsRequestBody.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsGetMemberObjectsRequestBody.java index e8aae56e52d6f..7d7b50087344d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsGetMemberObjectsRequestBody.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsGetMemberObjectsRequestBody.java @@ -5,34 +5,39 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** The ApplicationsGetMemberObjectsRequestBody model. */ +/** + * The ApplicationsGetMemberObjectsRequestBody model. + */ @Fluent -public final class ApplicationsGetMemberObjectsRequestBody { +public final class ApplicationsGetMemberObjectsRequestBody + implements JsonSerializable { /* * The securityEnabledOnly property. */ - @JsonProperty(value = "securityEnabledOnly") private Boolean securityEnabledOnly; /* * Dictionary of */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of ApplicationsGetMemberObjectsRequestBody class. */ + /** + * Creates an instance of ApplicationsGetMemberObjectsRequestBody class. + */ public ApplicationsGetMemberObjectsRequestBody() { } /** * Get the securityEnabledOnly property: The securityEnabledOnly property. - * + * * @return the securityEnabledOnly value. */ public Boolean securityEnabledOnly() { @@ -41,7 +46,7 @@ public Boolean securityEnabledOnly() { /** * Set the securityEnabledOnly property: The securityEnabledOnly property. - * + * * @param securityEnabledOnly the securityEnabledOnly value to set. * @return the ApplicationsGetMemberObjectsRequestBody object itself. */ @@ -52,17 +57,16 @@ public ApplicationsGetMemberObjectsRequestBody withSecurityEnabledOnly(Boolean s /** * Get the additionalProperties property: Dictionary of <AnyObject>. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Dictionary of <AnyObject>. - * + * * @param additionalProperties the additionalProperties value to set. * @return the ApplicationsGetMemberObjectsRequestBody object itself. */ @@ -71,19 +75,60 @@ public ApplicationsGetMemberObjectsRequestBody withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("securityEnabledOnly", this.securityEnabledOnly); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationsGetMemberObjectsRequestBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationsGetMemberObjectsRequestBody 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 ApplicationsGetMemberObjectsRequestBody. + */ + public static ApplicationsGetMemberObjectsRequestBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationsGetMemberObjectsRequestBody deserializedApplicationsGetMemberObjectsRequestBody + = new ApplicationsGetMemberObjectsRequestBody(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securityEnabledOnly".equals(fieldName)) { + deserializedApplicationsGetMemberObjectsRequestBody.securityEnabledOnly + = reader.getNullable(JsonReader::getBoolean); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedApplicationsGetMemberObjectsRequestBody.additionalProperties = additionalProperties; + + return deserializedApplicationsGetMemberObjectsRequestBody; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsOrderby.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsOrderby.java index a06df7377c8d8..cb55476d77e86 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsOrderby.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsOrderby.java @@ -5,56 +5,85 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ApplicationsOrderby. */ +/** + * Defines values for ApplicationsOrderby. + */ public final class ApplicationsOrderby extends ExpandableStringEnum { - /** Static value id for ApplicationsOrderby. */ + /** + * Static value id for ApplicationsOrderby. + */ public static final ApplicationsOrderby ID = fromString("id"); - /** Static value id desc for ApplicationsOrderby. */ + /** + * Static value id desc for ApplicationsOrderby. + */ public static final ApplicationsOrderby ID_DESC = fromString("id desc"); - /** Static value deletedDateTime for ApplicationsOrderby. */ + /** + * Static value deletedDateTime for ApplicationsOrderby. + */ public static final ApplicationsOrderby DELETED_DATE_TIME = fromString("deletedDateTime"); - /** Static value deletedDateTime desc for ApplicationsOrderby. */ + /** + * Static value deletedDateTime desc for ApplicationsOrderby. + */ public static final ApplicationsOrderby DELETED_DATE_TIME_DESC = fromString("deletedDateTime desc"); - /** Static value appDisplayName for ApplicationsOrderby. */ + /** + * Static value appDisplayName for ApplicationsOrderby. + */ public static final ApplicationsOrderby APP_DISPLAY_NAME = fromString("appDisplayName"); - /** Static value appDisplayName desc for ApplicationsOrderby. */ + /** + * Static value appDisplayName desc for ApplicationsOrderby. + */ public static final ApplicationsOrderby APP_DISPLAY_NAME_DESC = fromString("appDisplayName desc"); - /** Static value dataType for ApplicationsOrderby. */ + /** + * Static value dataType for ApplicationsOrderby. + */ public static final ApplicationsOrderby DATA_TYPE = fromString("dataType"); - /** Static value dataType desc for ApplicationsOrderby. */ + /** + * Static value dataType desc for ApplicationsOrderby. + */ public static final ApplicationsOrderby DATA_TYPE_DESC = fromString("dataType desc"); - /** Static value isSyncedFromOnPremises for ApplicationsOrderby. */ + /** + * Static value isSyncedFromOnPremises for ApplicationsOrderby. + */ public static final ApplicationsOrderby IS_SYNCED_FROM_ON_PREMISES = fromString("isSyncedFromOnPremises"); - /** Static value isSyncedFromOnPremises desc for ApplicationsOrderby. */ + /** + * Static value isSyncedFromOnPremises desc for ApplicationsOrderby. + */ public static final ApplicationsOrderby IS_SYNCED_FROM_ON_PREMISES_DESC = fromString("isSyncedFromOnPremises desc"); - /** Static value name for ApplicationsOrderby. */ + /** + * Static value name for ApplicationsOrderby. + */ public static final ApplicationsOrderby NAME = fromString("name"); - /** Static value name desc for ApplicationsOrderby. */ + /** + * Static value name desc for ApplicationsOrderby. + */ public static final ApplicationsOrderby NAME_DESC = fromString("name desc"); - /** Static value targetObjects for ApplicationsOrderby. */ + /** + * Static value targetObjects for ApplicationsOrderby. + */ public static final ApplicationsOrderby TARGET_OBJECTS = fromString("targetObjects"); - /** Static value targetObjects desc for ApplicationsOrderby. */ + /** + * Static value targetObjects desc for ApplicationsOrderby. + */ public static final ApplicationsOrderby TARGET_OBJECTS_DESC = fromString("targetObjects desc"); /** * Creates a new instance of ApplicationsOrderby value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -63,18 +92,17 @@ public ApplicationsOrderby() { /** * Creates or finds a ApplicationsOrderby from its string representation. - * + * * @param name a name to look for. * @return the corresponding ApplicationsOrderby. */ - @JsonCreator public static ApplicationsOrderby fromString(String name) { return fromString(name, ApplicationsOrderby.class); } /** * Gets known ApplicationsOrderby values. - * + * * @return known ApplicationsOrderby values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsRemoveKeyRequestBody.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsRemoveKeyRequestBody.java index f8df36413ff30..04f01355cc663 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsRemoveKeyRequestBody.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsRemoveKeyRequestBody.java @@ -5,41 +5,45 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** The ApplicationsRemoveKeyRequestBody model. */ +/** + * The ApplicationsRemoveKeyRequestBody model. + */ @Fluent -public final class ApplicationsRemoveKeyRequestBody { +public final class ApplicationsRemoveKeyRequestBody implements JsonSerializable { /* * The keyId property. */ - @JsonProperty(value = "keyId") private UUID keyId; /* * The proof property. */ - @JsonProperty(value = "proof") private String proof; /* * Dictionary of */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of ApplicationsRemoveKeyRequestBody class. */ + /** + * Creates an instance of ApplicationsRemoveKeyRequestBody class. + */ public ApplicationsRemoveKeyRequestBody() { } /** * Get the keyId property: The keyId property. - * + * * @return the keyId value. */ public UUID keyId() { @@ -48,7 +52,7 @@ public UUID keyId() { /** * Set the keyId property: The keyId property. - * + * * @param keyId the keyId value to set. * @return the ApplicationsRemoveKeyRequestBody object itself. */ @@ -59,7 +63,7 @@ public ApplicationsRemoveKeyRequestBody withKeyId(UUID keyId) { /** * Get the proof property: The proof property. - * + * * @return the proof value. */ public String proof() { @@ -68,7 +72,7 @@ public String proof() { /** * Set the proof property: The proof property. - * + * * @param proof the proof value to set. * @return the ApplicationsRemoveKeyRequestBody object itself. */ @@ -79,17 +83,16 @@ public ApplicationsRemoveKeyRequestBody withProof(String proof) { /** * Get the additionalProperties property: Dictionary of <AnyObject>. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Dictionary of <AnyObject>. - * + * * @param additionalProperties the additionalProperties value to set. * @return the ApplicationsRemoveKeyRequestBody object itself. */ @@ -98,19 +101,63 @@ public ApplicationsRemoveKeyRequestBody withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyId", Objects.toString(this.keyId, null)); + jsonWriter.writeStringField("proof", this.proof); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationsRemoveKeyRequestBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationsRemoveKeyRequestBody 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 ApplicationsRemoveKeyRequestBody. + */ + public static ApplicationsRemoveKeyRequestBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationsRemoveKeyRequestBody deserializedApplicationsRemoveKeyRequestBody + = new ApplicationsRemoveKeyRequestBody(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyId".equals(fieldName)) { + deserializedApplicationsRemoveKeyRequestBody.keyId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("proof".equals(fieldName)) { + deserializedApplicationsRemoveKeyRequestBody.proof = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedApplicationsRemoveKeyRequestBody.additionalProperties = additionalProperties; + + return deserializedApplicationsRemoveKeyRequestBody; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsRemovePasswordRequestBody.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsRemovePasswordRequestBody.java index cf45ec0a49c5d..4a82a7cfd415a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsRemovePasswordRequestBody.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsRemovePasswordRequestBody.java @@ -5,35 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** The ApplicationsRemovePasswordRequestBody model. */ +/** + * The ApplicationsRemovePasswordRequestBody model. + */ @Fluent -public final class ApplicationsRemovePasswordRequestBody { +public final class ApplicationsRemovePasswordRequestBody + implements JsonSerializable { /* * The keyId property. */ - @JsonProperty(value = "keyId") private UUID keyId; /* * Dictionary of */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of ApplicationsRemovePasswordRequestBody class. */ + /** + * Creates an instance of ApplicationsRemovePasswordRequestBody class. + */ public ApplicationsRemovePasswordRequestBody() { } /** * Get the keyId property: The keyId property. - * + * * @return the keyId value. */ public UUID keyId() { @@ -42,7 +48,7 @@ public UUID keyId() { /** * Set the keyId property: The keyId property. - * + * * @param keyId the keyId value to set. * @return the ApplicationsRemovePasswordRequestBody object itself. */ @@ -53,17 +59,16 @@ public ApplicationsRemovePasswordRequestBody withKeyId(UUID keyId) { /** * Get the additionalProperties property: Dictionary of <AnyObject>. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Dictionary of <AnyObject>. - * + * * @param additionalProperties the additionalProperties value to set. * @return the ApplicationsRemovePasswordRequestBody object itself. */ @@ -72,19 +77,60 @@ public ApplicationsRemovePasswordRequestBody withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyId", Objects.toString(this.keyId, null)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationsRemovePasswordRequestBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationsRemovePasswordRequestBody 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 ApplicationsRemovePasswordRequestBody. + */ + public static ApplicationsRemovePasswordRequestBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationsRemovePasswordRequestBody deserializedApplicationsRemovePasswordRequestBody + = new ApplicationsRemovePasswordRequestBody(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyId".equals(fieldName)) { + deserializedApplicationsRemovePasswordRequestBody.keyId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedApplicationsRemovePasswordRequestBody.additionalProperties = additionalProperties; + + return deserializedApplicationsRemovePasswordRequestBody; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsSelect.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsSelect.java index 0f728ec265c54..39279942b4ab6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsSelect.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ApplicationsSelect.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ApplicationsSelect. */ +/** + * Defines values for ApplicationsSelect. + */ public final class ApplicationsSelect extends ExpandableStringEnum { - /** Static value id for ApplicationsSelect. */ + /** + * Static value id for ApplicationsSelect. + */ public static final ApplicationsSelect ID = fromString("id"); - /** Static value deletedDateTime for ApplicationsSelect. */ + /** + * Static value deletedDateTime for ApplicationsSelect. + */ public static final ApplicationsSelect DELETED_DATE_TIME = fromString("deletedDateTime"); - /** Static value appDisplayName for ApplicationsSelect. */ + /** + * Static value appDisplayName for ApplicationsSelect. + */ public static final ApplicationsSelect APP_DISPLAY_NAME = fromString("appDisplayName"); - /** Static value dataType for ApplicationsSelect. */ + /** + * Static value dataType for ApplicationsSelect. + */ public static final ApplicationsSelect DATA_TYPE = fromString("dataType"); - /** Static value isSyncedFromOnPremises for ApplicationsSelect. */ + /** + * Static value isSyncedFromOnPremises for ApplicationsSelect. + */ public static final ApplicationsSelect IS_SYNCED_FROM_ON_PREMISES = fromString("isSyncedFromOnPremises"); - /** Static value name for ApplicationsSelect. */ + /** + * Static value name for ApplicationsSelect. + */ public static final ApplicationsSelect NAME = fromString("name"); - /** Static value targetObjects for ApplicationsSelect. */ + /** + * Static value targetObjects for ApplicationsSelect. + */ public static final ApplicationsSelect TARGET_OBJECTS = fromString("targetObjects"); /** * Creates a new instance of ApplicationsSelect value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public ApplicationsSelect() { /** * Creates or finds a ApplicationsSelect from its string representation. - * + * * @param name a name to look for. * @return the corresponding ApplicationsSelect. */ - @JsonCreator public static ApplicationsSelect fromString(String name) { return fromString(name, ApplicationsSelect.class); } /** * Gets known ApplicationsSelect values. - * + * * @return known ApplicationsSelect values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorInner.java index 3dd0a3f7f9506..0aef34de6ade8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorInner.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Classic Administrators. */ +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Classic Administrators. + */ @Fluent -public final class ClassicAdministratorInner { +public final class ClassicAdministratorInner implements JsonSerializable { /* * The ID of the administrator. */ - @JsonProperty(value = "id") private String id; /* * The name of the administrator. */ - @JsonProperty(value = "name") private String name; /* * The type of the administrator. */ - @JsonProperty(value = "type") private String type; /* * Properties for the classic administrator. */ - @JsonProperty(value = "properties") private ClassicAdministratorProperties innerProperties; - /** Creates an instance of ClassicAdministratorInner class. */ + /** + * Creates an instance of ClassicAdministratorInner class. + */ public ClassicAdministratorInner() { } /** * Get the id property: The ID of the administrator. - * + * * @return the id value. */ public String id() { @@ -49,7 +53,7 @@ public String id() { /** * Set the id property: The ID of the administrator. - * + * * @param id the id value to set. * @return the ClassicAdministratorInner object itself. */ @@ -60,7 +64,7 @@ public ClassicAdministratorInner withId(String id) { /** * Get the name property: The name of the administrator. - * + * * @return the name value. */ public String name() { @@ -69,7 +73,7 @@ public String name() { /** * Set the name property: The name of the administrator. - * + * * @param name the name value to set. * @return the ClassicAdministratorInner object itself. */ @@ -80,7 +84,7 @@ public ClassicAdministratorInner withName(String name) { /** * Get the type property: The type of the administrator. - * + * * @return the type value. */ public String type() { @@ -89,7 +93,7 @@ public String type() { /** * Set the type property: The type of the administrator. - * + * * @param type the type value to set. * @return the ClassicAdministratorInner object itself. */ @@ -100,7 +104,7 @@ public ClassicAdministratorInner withType(String type) { /** * Get the innerProperties property: Properties for the classic administrator. - * + * * @return the innerProperties value. */ private ClassicAdministratorProperties innerProperties() { @@ -109,7 +113,7 @@ private ClassicAdministratorProperties innerProperties() { /** * Get the emailAddress property: The email address of the administrator. - * + * * @return the emailAddress value. */ public String emailAddress() { @@ -118,7 +122,7 @@ public String emailAddress() { /** * Set the emailAddress property: The email address of the administrator. - * + * * @param emailAddress the emailAddress value to set. * @return the ClassicAdministratorInner object itself. */ @@ -132,7 +136,7 @@ public ClassicAdministratorInner withEmailAddress(String emailAddress) { /** * Get the role property: The role of the administrator. - * + * * @return the role value. */ public String role() { @@ -141,7 +145,7 @@ public String role() { /** * Set the role property: The role of the administrator. - * + * * @param role the role value to set. * @return the ClassicAdministratorInner object itself. */ @@ -155,7 +159,7 @@ public ClassicAdministratorInner withRole(String role) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -163,4 +167,50 @@ public void validate() { innerProperties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClassicAdministratorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClassicAdministratorInner 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 ClassicAdministratorInner. + */ + public static ClassicAdministratorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClassicAdministratorInner deserializedClassicAdministratorInner = new ClassicAdministratorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedClassicAdministratorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedClassicAdministratorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedClassicAdministratorInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedClassicAdministratorInner.innerProperties + = ClassicAdministratorProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedClassicAdministratorInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorProperties.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorProperties.java index 30d4a7c03bb20..ec14c500bdeda 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/ClassicAdministratorProperties.java @@ -5,30 +5,36 @@ package com.azure.resourcemanager.authorization.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; -/** Classic Administrator properties. */ +/** + * Classic Administrator properties. + */ @Fluent -public final class ClassicAdministratorProperties { +public final class ClassicAdministratorProperties implements JsonSerializable { /* * The email address of the administrator. */ - @JsonProperty(value = "emailAddress") private String emailAddress; /* * The role of the administrator. */ - @JsonProperty(value = "role") private String role; - /** Creates an instance of ClassicAdministratorProperties class. */ + /** + * Creates an instance of ClassicAdministratorProperties class. + */ public ClassicAdministratorProperties() { } /** * Get the emailAddress property: The email address of the administrator. - * + * * @return the emailAddress value. */ public String emailAddress() { @@ -37,7 +43,7 @@ public String emailAddress() { /** * Set the emailAddress property: The email address of the administrator. - * + * * @param emailAddress the emailAddress value to set. * @return the ClassicAdministratorProperties object itself. */ @@ -48,7 +54,7 @@ public ClassicAdministratorProperties withEmailAddress(String emailAddress) { /** * Get the role property: The role of the administrator. - * + * * @return the role value. */ public String role() { @@ -57,7 +63,7 @@ public String role() { /** * Set the role property: The role of the administrator. - * + * * @param role the role value to set. * @return the ClassicAdministratorProperties object itself. */ @@ -68,9 +74,49 @@ public ClassicAdministratorProperties withRole(String role) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("emailAddress", this.emailAddress); + jsonWriter.writeStringField("role", this.role); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClassicAdministratorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClassicAdministratorProperties 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 ClassicAdministratorProperties. + */ + public static ClassicAdministratorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClassicAdministratorProperties deserializedClassicAdministratorProperties + = new ClassicAdministratorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("emailAddress".equals(fieldName)) { + deserializedClassicAdministratorProperties.emailAddress = reader.getString(); + } else if ("role".equals(fieldName)) { + deserializedClassicAdministratorProperties.role = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedClassicAdministratorProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfApplication.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfApplication.java index c6d2fe0caa953..7ccbc8dd51c15 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfApplication.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfApplication.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of application. */ +/** + * Collection of application. + */ @Fluent -public final class CollectionOfApplication { +public final class CollectionOfApplication implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of application */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfApplication class. */ + /** + * Creates an instance of CollectionOfApplication class. + */ public CollectionOfApplication() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +51,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfApplication object itself. */ @@ -58,8 +61,8 @@ public CollectionOfApplication withValue(List va } /** - * Get the odataNextLink property: The @odata.nextLink property. - * + * Get the odataNextLink property: The @odata.nextLink property. + * * @return the odataNextLink value. */ public String odataNextLink() { @@ -67,8 +70,8 @@ public String odataNextLink() { } /** - * Set the odataNextLink property: The @odata.nextLink property. - * + * Set the odataNextLink property: The @odata.nextLink property. + * * @param odataNextLink the odataNextLink value to set. * @return the CollectionOfApplication object itself. */ @@ -79,17 +82,16 @@ public CollectionOfApplication withOdataNextLink(String odataNextLink) { /** * Get the additionalProperties property: Collection of application. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of application. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfApplication object itself. */ @@ -98,17 +100,9 @@ public CollectionOfApplication withAdditionalProperties(Map addi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -116,4 +110,56 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfApplication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfApplication 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 CollectionOfApplication. + */ + public static CollectionOfApplication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfApplication deserializedCollectionOfApplication = new CollectionOfApplication(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MicrosoftGraphApplicationInner.fromJson(reader1)); + deserializedCollectionOfApplication.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfApplication.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfApplication.additionalProperties = additionalProperties; + + return deserializedCollectionOfApplication; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDirectoryObject.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDirectoryObject.java index 8ddad549819c1..e06c071dada1d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDirectoryObject.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDirectoryObject.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of directoryObject. */ +/** + * Collection of directoryObject. + */ @Fluent -public final class CollectionOfDirectoryObject { +public final class CollectionOfDirectoryObject implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of directoryObject */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfDirectoryObject class. */ + /** + * Creates an instance of CollectionOfDirectoryObject class. + */ public CollectionOfDirectoryObject() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +51,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfDirectoryObject object itself. */ @@ -58,8 +61,8 @@ public CollectionOfDirectoryObject withValue(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of directoryObject. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfDirectoryObject object itself. */ @@ -98,17 +100,9 @@ public CollectionOfDirectoryObject withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -116,4 +110,56 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfDirectoryObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfDirectoryObject 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 CollectionOfDirectoryObject. + */ + public static CollectionOfDirectoryObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfDirectoryObject deserializedCollectionOfDirectoryObject = new CollectionOfDirectoryObject(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedCollectionOfDirectoryObject.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfDirectoryObject.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfDirectoryObject.additionalProperties = additionalProperties; + + return deserializedCollectionOfDirectoryObject; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDirectoryObject0.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDirectoryObject0.java index 5c1c7444bb27c..efed62af7f7fe 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDirectoryObject0.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDirectoryObject0.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of directoryObject. */ +/** + * Collection of directoryObject. + */ @Fluent -public final class CollectionOfDirectoryObject0 { +public final class CollectionOfDirectoryObject0 implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of directoryObject */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfDirectoryObject0 class. */ + /** + * Creates an instance of CollectionOfDirectoryObject0 class. + */ public CollectionOfDirectoryObject0() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +51,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfDirectoryObject0 object itself. */ @@ -58,8 +61,8 @@ public CollectionOfDirectoryObject0 withValue(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of directoryObject. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfDirectoryObject0 object itself. */ @@ -98,17 +100,9 @@ public CollectionOfDirectoryObject0 withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -116,4 +110,56 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfDirectoryObject0 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfDirectoryObject0 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 CollectionOfDirectoryObject0. + */ + public static CollectionOfDirectoryObject0 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfDirectoryObject0 deserializedCollectionOfDirectoryObject0 = new CollectionOfDirectoryObject0(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedCollectionOfDirectoryObject0.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfDirectoryObject0.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfDirectoryObject0.additionalProperties = additionalProperties; + + return deserializedCollectionOfDirectoryObject0; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDomain.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDomain.java index cb65a6c372364..d33afd0e20ec7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDomain.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfDomain.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of domain. */ +/** + * Collection of domain. + */ @Fluent -public final class CollectionOfDomain { +public final class CollectionOfDomain implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of domain */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfDomain class. */ + /** + * Creates an instance of CollectionOfDomain class. + */ public CollectionOfDomain() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +51,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfDomain object itself. */ @@ -58,8 +61,8 @@ public CollectionOfDomain withValue(List value) { } /** - * Get the odataNextLink property: The @odata.nextLink property. - * + * Get the odataNextLink property: The @odata.nextLink property. + * * @return the odataNextLink value. */ public String odataNextLink() { @@ -67,8 +70,8 @@ public String odataNextLink() { } /** - * Set the odataNextLink property: The @odata.nextLink property. - * + * Set the odataNextLink property: The @odata.nextLink property. + * * @param odataNextLink the odataNextLink value to set. * @return the CollectionOfDomain object itself. */ @@ -79,17 +82,16 @@ public CollectionOfDomain withOdataNextLink(String odataNextLink) { /** * Get the additionalProperties property: Collection of domain. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of domain. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfDomain object itself. */ @@ -98,17 +100,9 @@ public CollectionOfDomain withAdditionalProperties(Map additiona return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -116,4 +110,56 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfDomain from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfDomain 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 CollectionOfDomain. + */ + public static CollectionOfDomain fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfDomain deserializedCollectionOfDomain = new CollectionOfDomain(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MicrosoftGraphDomainInner.fromJson(reader1)); + deserializedCollectionOfDomain.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfDomain.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfDomain.additionalProperties = additionalProperties; + + return deserializedCollectionOfDomain; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfExtensionProperty.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfExtensionProperty.java index 82c9e477ab0ff..fe12d749c583a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfExtensionProperty.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfExtensionProperty.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of extensionProperty. */ +/** + * Collection of extensionProperty. + */ @Fluent -public final class CollectionOfExtensionProperty { +public final class CollectionOfExtensionProperty implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of extensionProperty */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfExtensionProperty class. */ + /** + * Creates an instance of CollectionOfExtensionProperty class. + */ public CollectionOfExtensionProperty() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +51,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfExtensionProperty object itself. */ @@ -58,8 +61,8 @@ public CollectionOfExtensionProperty withValue(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of extensionProperty. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfExtensionProperty object itself. */ @@ -98,17 +100,9 @@ public CollectionOfExtensionProperty withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -116,4 +110,57 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfExtensionProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfExtensionProperty 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 CollectionOfExtensionProperty. + */ + public static CollectionOfExtensionProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfExtensionProperty deserializedCollectionOfExtensionProperty + = new CollectionOfExtensionProperty(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MicrosoftGraphExtensionPropertyInner.fromJson(reader1)); + deserializedCollectionOfExtensionProperty.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfExtensionProperty.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfExtensionProperty.additionalProperties = additionalProperties; + + return deserializedCollectionOfExtensionProperty; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfGroup.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfGroup.java index bf26520bbd709..4f11aa87f7785 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfGroup.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfGroup.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of group. */ +/** + * Collection of group. + */ @Fluent -public final class CollectionOfGroup { +public final class CollectionOfGroup implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of group */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfGroup class. */ + /** + * Creates an instance of CollectionOfGroup class. + */ public CollectionOfGroup() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +51,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfGroup object itself. */ @@ -58,8 +61,8 @@ public CollectionOfGroup withValue(List value) { } /** - * Get the odataNextLink property: The @odata.nextLink property. - * + * Get the odataNextLink property: The @odata.nextLink property. + * * @return the odataNextLink value. */ public String odataNextLink() { @@ -67,8 +70,8 @@ public String odataNextLink() { } /** - * Set the odataNextLink property: The @odata.nextLink property. - * + * Set the odataNextLink property: The @odata.nextLink property. + * * @param odataNextLink the odataNextLink value to set. * @return the CollectionOfGroup object itself. */ @@ -79,17 +82,16 @@ public CollectionOfGroup withOdataNextLink(String odataNextLink) { /** * Get the additionalProperties property: Collection of group. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of group. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfGroup object itself. */ @@ -98,17 +100,9 @@ public CollectionOfGroup withAdditionalProperties(Map additional return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -116,4 +110,56 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfGroup 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 CollectionOfGroup. + */ + public static CollectionOfGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfGroup deserializedCollectionOfGroup = new CollectionOfGroup(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MicrosoftGraphGroupInner.fromJson(reader1)); + deserializedCollectionOfGroup.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfGroup.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfGroup.additionalProperties = additionalProperties; + + return deserializedCollectionOfGroup; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfHomeRealmDiscoveryPolicy.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfHomeRealmDiscoveryPolicy.java index 872567a3dd7b3..7dfc4dc12e5ec 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfHomeRealmDiscoveryPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfHomeRealmDiscoveryPolicy.java @@ -5,41 +5,45 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of homeRealmDiscoveryPolicy. */ +/** + * Collection of homeRealmDiscoveryPolicy. + */ @Fluent -public final class CollectionOfHomeRealmDiscoveryPolicy { +public final class CollectionOfHomeRealmDiscoveryPolicy + implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of homeRealmDiscoveryPolicy */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfHomeRealmDiscoveryPolicy class. */ + /** + * Creates an instance of CollectionOfHomeRealmDiscoveryPolicy class. + */ public CollectionOfHomeRealmDiscoveryPolicy() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +52,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfHomeRealmDiscoveryPolicy object itself. */ @@ -58,8 +62,8 @@ public CollectionOfHomeRealmDiscoveryPolicy withValue(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of homeRealmDiscoveryPolicy. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfHomeRealmDiscoveryPolicy object itself. */ @@ -98,17 +101,9 @@ public CollectionOfHomeRealmDiscoveryPolicy withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -116,4 +111,57 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfHomeRealmDiscoveryPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfHomeRealmDiscoveryPolicy 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 CollectionOfHomeRealmDiscoveryPolicy. + */ + public static CollectionOfHomeRealmDiscoveryPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfHomeRealmDiscoveryPolicy deserializedCollectionOfHomeRealmDiscoveryPolicy + = new CollectionOfHomeRealmDiscoveryPolicy(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MicrosoftGraphHomeRealmDiscoveryPolicyInner.fromJson(reader1)); + deserializedCollectionOfHomeRealmDiscoveryPolicy.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfHomeRealmDiscoveryPolicy.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfHomeRealmDiscoveryPolicy.additionalProperties = additionalProperties; + + return deserializedCollectionOfHomeRealmDiscoveryPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfLinksOfDirectoryObject.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfLinksOfDirectoryObject.java index 2721c433f5259..ce69dd28047bf 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfLinksOfDirectoryObject.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfLinksOfDirectoryObject.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of links of directoryObject. */ +/** + * Collection of links of directoryObject. + */ @Fluent -public final class CollectionOfLinksOfDirectoryObject { +public final class CollectionOfLinksOfDirectoryObject implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of links of directoryObject */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfLinksOfDirectoryObject class. */ + /** + * Creates an instance of CollectionOfLinksOfDirectoryObject class. + */ public CollectionOfLinksOfDirectoryObject() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +51,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfLinksOfDirectoryObject object itself. */ @@ -58,8 +61,8 @@ public CollectionOfLinksOfDirectoryObject withValue(List value) { } /** - * Get the odataNextLink property: The @odata.nextLink property. - * + * Get the odataNextLink property: The @odata.nextLink property. + * * @return the odataNextLink value. */ public String odataNextLink() { @@ -67,8 +70,8 @@ public String odataNextLink() { } /** - * Set the odataNextLink property: The @odata.nextLink property. - * + * Set the odataNextLink property: The @odata.nextLink property. + * * @param odataNextLink the odataNextLink value to set. * @return the CollectionOfLinksOfDirectoryObject object itself. */ @@ -79,17 +82,16 @@ public CollectionOfLinksOfDirectoryObject withOdataNextLink(String odataNextLink /** * Get the additionalProperties property: Collection of links of directoryObject. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of links of directoryObject. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfLinksOfDirectoryObject object itself. */ @@ -98,19 +100,63 @@ public CollectionOfLinksOfDirectoryObject withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfLinksOfDirectoryObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfLinksOfDirectoryObject 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 CollectionOfLinksOfDirectoryObject. + */ + public static CollectionOfLinksOfDirectoryObject fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfLinksOfDirectoryObject deserializedCollectionOfLinksOfDirectoryObject + = new CollectionOfLinksOfDirectoryObject(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> reader1.getString()); + deserializedCollectionOfLinksOfDirectoryObject.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfLinksOfDirectoryObject.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfLinksOfDirectoryObject.additionalProperties = additionalProperties; + + return deserializedCollectionOfLinksOfDirectoryObject; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfLinksOfHomeRealmDiscoveryPolicy.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfLinksOfHomeRealmDiscoveryPolicy.java index 3e929020aa2c9..8f32b90955634 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfLinksOfHomeRealmDiscoveryPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfLinksOfHomeRealmDiscoveryPolicy.java @@ -5,41 +5,45 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of links of homeRealmDiscoveryPolicy. */ +/** + * Collection of links of homeRealmDiscoveryPolicy. + */ @Fluent -public final class CollectionOfLinksOfHomeRealmDiscoveryPolicy { +public final class CollectionOfLinksOfHomeRealmDiscoveryPolicy + implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of links of homeRealmDiscoveryPolicy */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfLinksOfHomeRealmDiscoveryPolicy class. */ + /** + * Creates an instance of CollectionOfLinksOfHomeRealmDiscoveryPolicy class. + */ public CollectionOfLinksOfHomeRealmDiscoveryPolicy() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +52,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfLinksOfHomeRealmDiscoveryPolicy object itself. */ @@ -58,8 +62,8 @@ public CollectionOfLinksOfHomeRealmDiscoveryPolicy withValue(List value) } /** - * Get the odataNextLink property: The @odata.nextLink property. - * + * Get the odataNextLink property: The @odata.nextLink property. + * * @return the odataNextLink value. */ public String odataNextLink() { @@ -67,8 +71,8 @@ public String odataNextLink() { } /** - * Set the odataNextLink property: The @odata.nextLink property. - * + * Set the odataNextLink property: The @odata.nextLink property. + * * @param odataNextLink the odataNextLink value to set. * @return the CollectionOfLinksOfHomeRealmDiscoveryPolicy object itself. */ @@ -79,39 +83,82 @@ public CollectionOfLinksOfHomeRealmDiscoveryPolicy withOdataNextLink(String odat /** * Get the additionalProperties property: Collection of links of homeRealmDiscoveryPolicy. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of links of homeRealmDiscoveryPolicy. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfLinksOfHomeRealmDiscoveryPolicy object itself. */ - public CollectionOfLinksOfHomeRealmDiscoveryPolicy withAdditionalProperties( - Map additionalProperties) { + public CollectionOfLinksOfHomeRealmDiscoveryPolicy + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfLinksOfHomeRealmDiscoveryPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfLinksOfHomeRealmDiscoveryPolicy 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 CollectionOfLinksOfHomeRealmDiscoveryPolicy. + */ + public static CollectionOfLinksOfHomeRealmDiscoveryPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfLinksOfHomeRealmDiscoveryPolicy deserializedCollectionOfLinksOfHomeRealmDiscoveryPolicy + = new CollectionOfLinksOfHomeRealmDiscoveryPolicy(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> reader1.getString()); + deserializedCollectionOfLinksOfHomeRealmDiscoveryPolicy.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfLinksOfHomeRealmDiscoveryPolicy.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfLinksOfHomeRealmDiscoveryPolicy.additionalProperties = additionalProperties; + + return deserializedCollectionOfLinksOfHomeRealmDiscoveryPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfServicePrincipal.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfServicePrincipal.java index b839cd8312066..04dfafbfe5b4b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfServicePrincipal.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfServicePrincipal.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of servicePrincipal. */ +/** + * Collection of servicePrincipal. + */ @Fluent -public final class CollectionOfServicePrincipal { +public final class CollectionOfServicePrincipal implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of servicePrincipal */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfServicePrincipal class. */ + /** + * Creates an instance of CollectionOfServicePrincipal class. + */ public CollectionOfServicePrincipal() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +51,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfServicePrincipal object itself. */ @@ -58,8 +61,8 @@ public CollectionOfServicePrincipal withValue(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of servicePrincipal. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfServicePrincipal object itself. */ @@ -98,17 +100,9 @@ public CollectionOfServicePrincipal withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -116,4 +110,56 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfServicePrincipal from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfServicePrincipal 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 CollectionOfServicePrincipal. + */ + public static CollectionOfServicePrincipal fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfServicePrincipal deserializedCollectionOfServicePrincipal = new CollectionOfServicePrincipal(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MicrosoftGraphServicePrincipalInner.fromJson(reader1)); + deserializedCollectionOfServicePrincipal.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfServicePrincipal.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfServicePrincipal.additionalProperties = additionalProperties; + + return deserializedCollectionOfServicePrincipal; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfUser.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfUser.java index b718474e06004..fc186954dcde1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfUser.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/CollectionOfUser.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** Collection of user. */ +/** + * Collection of user. + */ @Fluent -public final class CollectionOfUser { +public final class CollectionOfUser implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The @odata.nextLink property. */ - @JsonProperty(value = "@odata.nextLink") private String odataNextLink; /* * Collection of user */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of CollectionOfUser class. */ + /** + * Creates an instance of CollectionOfUser class. + */ public CollectionOfUser() { } /** * Get the value property: The value property. - * + * * @return the value value. */ public List value() { @@ -48,7 +51,7 @@ public List value() { /** * Set the value property: The value property. - * + * * @param value the value value to set. * @return the CollectionOfUser object itself. */ @@ -58,8 +61,8 @@ public CollectionOfUser withValue(List value) { } /** - * Get the odataNextLink property: The @odata.nextLink property. - * + * Get the odataNextLink property: The @odata.nextLink property. + * * @return the odataNextLink value. */ public String odataNextLink() { @@ -67,8 +70,8 @@ public String odataNextLink() { } /** - * Set the odataNextLink property: The @odata.nextLink property. - * + * Set the odataNextLink property: The @odata.nextLink property. + * * @param odataNextLink the odataNextLink value to set. * @return the CollectionOfUser object itself. */ @@ -79,17 +82,16 @@ public CollectionOfUser withOdataNextLink(String odataNextLink) { /** * Get the additionalProperties property: Collection of user. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Collection of user. - * + * * @param additionalProperties the additionalProperties value to set. * @return the CollectionOfUser object itself. */ @@ -98,17 +100,9 @@ public CollectionOfUser withAdditionalProperties(Map additionalP return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -116,4 +110,56 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("@odata.nextLink", this.odataNextLink); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CollectionOfUser from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CollectionOfUser 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 CollectionOfUser. + */ + public static CollectionOfUser fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CollectionOfUser deserializedCollectionOfUser = new CollectionOfUser(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MicrosoftGraphUserInner.fromJson(reader1)); + deserializedCollectionOfUser.value = value; + } else if ("@odata.nextLink".equals(fieldName)) { + deserializedCollectionOfUser.odataNextLink = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedCollectionOfUser.additionalProperties = additionalProperties; + + return deserializedCollectionOfUser; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DenyAssignmentInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DenyAssignmentInner.java index fe61ffbfee3a7..f4acffb0dc243 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DenyAssignmentInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DenyAssignmentInner.java @@ -5,46 +5,50 @@ package com.azure.resourcemanager.authorization.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.authorization.models.DenyAssignmentPermission; import com.azure.resourcemanager.authorization.models.Principal; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; -/** Deny Assignment. */ +/** + * Deny Assignment. + */ @Fluent -public final class DenyAssignmentInner { +public final class DenyAssignmentInner implements JsonSerializable { /* * The deny assignment ID. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The deny assignment name. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The deny assignment type. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * Deny assignment properties. */ - @JsonProperty(value = "properties") private DenyAssignmentProperties innerProperties; - /** Creates an instance of DenyAssignmentInner class. */ + /** + * Creates an instance of DenyAssignmentInner class. + */ public DenyAssignmentInner() { } /** * Get the id property: The deny assignment ID. - * + * * @return the id value. */ public String id() { @@ -53,7 +57,7 @@ public String id() { /** * Get the name property: The deny assignment name. - * + * * @return the name value. */ public String name() { @@ -62,7 +66,7 @@ public String name() { /** * Get the type property: The deny assignment type. - * + * * @return the type value. */ public String type() { @@ -71,7 +75,7 @@ public String type() { /** * Get the innerProperties property: Deny assignment properties. - * + * * @return the innerProperties value. */ private DenyAssignmentProperties innerProperties() { @@ -80,7 +84,7 @@ private DenyAssignmentProperties innerProperties() { /** * Get the denyAssignmentName property: The display name of the deny assignment. - * + * * @return the denyAssignmentName value. */ public String denyAssignmentName() { @@ -89,7 +93,7 @@ public String denyAssignmentName() { /** * Set the denyAssignmentName property: The display name of the deny assignment. - * + * * @param denyAssignmentName the denyAssignmentName value to set. * @return the DenyAssignmentInner object itself. */ @@ -103,7 +107,7 @@ public DenyAssignmentInner withDenyAssignmentName(String denyAssignmentName) { /** * Get the description property: The description of the deny assignment. - * + * * @return the description value. */ public String description() { @@ -112,7 +116,7 @@ public String description() { /** * Set the description property: The description of the deny assignment. - * + * * @param description the description value to set. * @return the DenyAssignmentInner object itself. */ @@ -126,7 +130,7 @@ public DenyAssignmentInner withDescription(String description) { /** * Get the permissions property: An array of permissions that are denied by the deny assignment. - * + * * @return the permissions value. */ public List permissions() { @@ -135,7 +139,7 @@ public List permissions() { /** * Set the permissions property: An array of permissions that are denied by the deny assignment. - * + * * @param permissions the permissions value to set. * @return the DenyAssignmentInner object itself. */ @@ -149,7 +153,7 @@ public DenyAssignmentInner withPermissions(List permis /** * Get the scope property: The deny assignment scope. - * + * * @return the scope value. */ public String scope() { @@ -158,7 +162,7 @@ public String scope() { /** * Set the scope property: The deny assignment scope. - * + * * @param scope the scope value to set. * @return the DenyAssignmentInner object itself. */ @@ -173,7 +177,7 @@ public DenyAssignmentInner withScope(String scope) { /** * Get the doNotApplyToChildScopes property: Determines if the deny assignment applies to child scopes. Default * value is false. - * + * * @return the doNotApplyToChildScopes value. */ public Boolean doNotApplyToChildScopes() { @@ -183,7 +187,7 @@ public Boolean doNotApplyToChildScopes() { /** * Set the doNotApplyToChildScopes property: Determines if the deny assignment applies to child scopes. Default * value is false. - * + * * @param doNotApplyToChildScopes the doNotApplyToChildScopes value to set. * @return the DenyAssignmentInner object itself. */ @@ -197,7 +201,7 @@ public DenyAssignmentInner withDoNotApplyToChildScopes(Boolean doNotApplyToChild /** * Get the principals property: Array of principals to which the deny assignment applies. - * + * * @return the principals value. */ public List principals() { @@ -206,7 +210,7 @@ public List principals() { /** * Set the principals property: Array of principals to which the deny assignment applies. - * + * * @param principals the principals value to set. * @return the DenyAssignmentInner object itself. */ @@ -220,7 +224,7 @@ public DenyAssignmentInner withPrincipals(List principals) { /** * Get the excludePrincipals property: Array of principals to which the deny assignment does not apply. - * + * * @return the excludePrincipals value. */ public List excludePrincipals() { @@ -229,7 +233,7 @@ public List excludePrincipals() { /** * Set the excludePrincipals property: Array of principals to which the deny assignment does not apply. - * + * * @param excludePrincipals the excludePrincipals value to set. * @return the DenyAssignmentInner object itself. */ @@ -244,7 +248,7 @@ public DenyAssignmentInner withExcludePrincipals(List excludePrincipa /** * Get the isSystemProtected property: Specifies whether this deny assignment was created by Azure and cannot be * edited or deleted. - * + * * @return the isSystemProtected value. */ public Boolean isSystemProtected() { @@ -254,7 +258,7 @@ public Boolean isSystemProtected() { /** * Set the isSystemProtected property: Specifies whether this deny assignment was created by Azure and cannot be * edited or deleted. - * + * * @param isSystemProtected the isSystemProtected value to set. * @return the DenyAssignmentInner object itself. */ @@ -268,9 +272,9 @@ public DenyAssignmentInner withIsSystemProtected(Boolean isSystemProtected) { /** * Get the condition property: The conditions on the deny assignment. This limits the resources it can be assigned - * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] * StringEqualsIgnoreCase 'foo_storage_container'. - * + * * @return the condition value. */ public String condition() { @@ -279,9 +283,9 @@ public String condition() { /** * Set the condition property: The conditions on the deny assignment. This limits the resources it can be assigned - * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] * StringEqualsIgnoreCase 'foo_storage_container'. - * + * * @param condition the condition value to set. * @return the DenyAssignmentInner object itself. */ @@ -295,7 +299,7 @@ public DenyAssignmentInner withCondition(String condition) { /** * Get the conditionVersion property: Version of the condition. - * + * * @return the conditionVersion value. */ public String conditionVersion() { @@ -304,7 +308,7 @@ public String conditionVersion() { /** * Set the conditionVersion property: Version of the condition. - * + * * @param conditionVersion the conditionVersion value to set. * @return the DenyAssignmentInner object itself. */ @@ -318,7 +322,7 @@ public DenyAssignmentInner withConditionVersion(String conditionVersion) { /** * Get the createdOn property: Time it was created. - * + * * @return the createdOn value. */ public OffsetDateTime createdOn() { @@ -327,7 +331,7 @@ public OffsetDateTime createdOn() { /** * Get the updatedOn property: Time it was updated. - * + * * @return the updatedOn value. */ public OffsetDateTime updatedOn() { @@ -336,7 +340,7 @@ public OffsetDateTime updatedOn() { /** * Get the createdBy property: Id of the user who created the assignment. - * + * * @return the createdBy value. */ public String createdBy() { @@ -345,7 +349,7 @@ public String createdBy() { /** * Get the updatedBy property: Id of the user who updated the assignment. - * + * * @return the updatedBy value. */ public String updatedBy() { @@ -354,7 +358,7 @@ public String updatedBy() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -362,4 +366,46 @@ 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 DenyAssignmentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DenyAssignmentInner 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 DenyAssignmentInner. + */ + public static DenyAssignmentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DenyAssignmentInner deserializedDenyAssignmentInner = new DenyAssignmentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDenyAssignmentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDenyAssignmentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDenyAssignmentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDenyAssignmentInner.innerProperties = DenyAssignmentProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDenyAssignmentInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DenyAssignmentProperties.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DenyAssignmentProperties.java index 5f043c7251a00..9aa133cb5ac39 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DenyAssignmentProperties.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/DenyAssignmentProperties.java @@ -5,108 +5,103 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.authorization.models.DenyAssignmentPermission; import com.azure.resourcemanager.authorization.models.Principal; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.time.OffsetDateTime; import java.util.List; -/** Deny assignment properties. */ +/** + * Deny assignment properties. + */ @Fluent -public final class DenyAssignmentProperties { +public final class DenyAssignmentProperties implements JsonSerializable { /* * The display name of the deny assignment. */ - @JsonProperty(value = "denyAssignmentName") private String denyAssignmentName; /* * The description of the deny assignment. */ - @JsonProperty(value = "description") private String description; /* * An array of permissions that are denied by the deny assignment. */ - @JsonProperty(value = "permissions") private List permissions; /* * The deny assignment scope. */ - @JsonProperty(value = "scope") private String scope; /* * Determines if the deny assignment applies to child scopes. Default value is false. */ - @JsonProperty(value = "doNotApplyToChildScopes") private Boolean doNotApplyToChildScopes; /* * Array of principals to which the deny assignment applies. */ - @JsonProperty(value = "principals") private List principals; /* * Array of principals to which the deny assignment does not apply. */ - @JsonProperty(value = "excludePrincipals") private List excludePrincipals; /* * Specifies whether this deny assignment was created by Azure and cannot be edited or deleted. */ - @JsonProperty(value = "isSystemProtected") private Boolean isSystemProtected; /* - * The conditions on the deny assignment. This limits the resources it can be assigned to. e.g.: - * @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase + * The conditions on the deny assignment. This limits the resources it can be assigned to. + * e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase * 'foo_storage_container' */ - @JsonProperty(value = "condition") private String condition; /* * Version of the condition. */ - @JsonProperty(value = "conditionVersion") private String conditionVersion; /* * Time it was created */ - @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime createdOn; /* * Time it was updated */ - @JsonProperty(value = "updatedOn", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime updatedOn; /* * Id of the user who created the assignment */ - @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) private String createdBy; /* * Id of the user who updated the assignment */ - @JsonProperty(value = "updatedBy", access = JsonProperty.Access.WRITE_ONLY) private String updatedBy; - /** Creates an instance of DenyAssignmentProperties class. */ + /** + * Creates an instance of DenyAssignmentProperties class. + */ public DenyAssignmentProperties() { } /** * Get the denyAssignmentName property: The display name of the deny assignment. - * + * * @return the denyAssignmentName value. */ public String denyAssignmentName() { @@ -115,7 +110,7 @@ public String denyAssignmentName() { /** * Set the denyAssignmentName property: The display name of the deny assignment. - * + * * @param denyAssignmentName the denyAssignmentName value to set. * @return the DenyAssignmentProperties object itself. */ @@ -126,7 +121,7 @@ public DenyAssignmentProperties withDenyAssignmentName(String denyAssignmentName /** * Get the description property: The description of the deny assignment. - * + * * @return the description value. */ public String description() { @@ -135,7 +130,7 @@ public String description() { /** * Set the description property: The description of the deny assignment. - * + * * @param description the description value to set. * @return the DenyAssignmentProperties object itself. */ @@ -146,7 +141,7 @@ public DenyAssignmentProperties withDescription(String description) { /** * Get the permissions property: An array of permissions that are denied by the deny assignment. - * + * * @return the permissions value. */ public List permissions() { @@ -155,7 +150,7 @@ public List permissions() { /** * Set the permissions property: An array of permissions that are denied by the deny assignment. - * + * * @param permissions the permissions value to set. * @return the DenyAssignmentProperties object itself. */ @@ -166,7 +161,7 @@ public DenyAssignmentProperties withPermissions(List p /** * Get the scope property: The deny assignment scope. - * + * * @return the scope value. */ public String scope() { @@ -175,7 +170,7 @@ public String scope() { /** * Set the scope property: The deny assignment scope. - * + * * @param scope the scope value to set. * @return the DenyAssignmentProperties object itself. */ @@ -187,7 +182,7 @@ public DenyAssignmentProperties withScope(String scope) { /** * Get the doNotApplyToChildScopes property: Determines if the deny assignment applies to child scopes. Default * value is false. - * + * * @return the doNotApplyToChildScopes value. */ public Boolean doNotApplyToChildScopes() { @@ -197,7 +192,7 @@ public Boolean doNotApplyToChildScopes() { /** * Set the doNotApplyToChildScopes property: Determines if the deny assignment applies to child scopes. Default * value is false. - * + * * @param doNotApplyToChildScopes the doNotApplyToChildScopes value to set. * @return the DenyAssignmentProperties object itself. */ @@ -208,7 +203,7 @@ public DenyAssignmentProperties withDoNotApplyToChildScopes(Boolean doNotApplyTo /** * Get the principals property: Array of principals to which the deny assignment applies. - * + * * @return the principals value. */ public List principals() { @@ -217,7 +212,7 @@ public List principals() { /** * Set the principals property: Array of principals to which the deny assignment applies. - * + * * @param principals the principals value to set. * @return the DenyAssignmentProperties object itself. */ @@ -228,7 +223,7 @@ public DenyAssignmentProperties withPrincipals(List principals) { /** * Get the excludePrincipals property: Array of principals to which the deny assignment does not apply. - * + * * @return the excludePrincipals value. */ public List excludePrincipals() { @@ -237,7 +232,7 @@ public List excludePrincipals() { /** * Set the excludePrincipals property: Array of principals to which the deny assignment does not apply. - * + * * @param excludePrincipals the excludePrincipals value to set. * @return the DenyAssignmentProperties object itself. */ @@ -249,7 +244,7 @@ public DenyAssignmentProperties withExcludePrincipals(List excludePri /** * Get the isSystemProtected property: Specifies whether this deny assignment was created by Azure and cannot be * edited or deleted. - * + * * @return the isSystemProtected value. */ public Boolean isSystemProtected() { @@ -259,7 +254,7 @@ public Boolean isSystemProtected() { /** * Set the isSystemProtected property: Specifies whether this deny assignment was created by Azure and cannot be * edited or deleted. - * + * * @param isSystemProtected the isSystemProtected value to set. * @return the DenyAssignmentProperties object itself. */ @@ -270,9 +265,9 @@ public DenyAssignmentProperties withIsSystemProtected(Boolean isSystemProtected) /** * Get the condition property: The conditions on the deny assignment. This limits the resources it can be assigned - * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] * StringEqualsIgnoreCase 'foo_storage_container'. - * + * * @return the condition value. */ public String condition() { @@ -281,9 +276,9 @@ public String condition() { /** * Set the condition property: The conditions on the deny assignment. This limits the resources it can be assigned - * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] + * to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] * StringEqualsIgnoreCase 'foo_storage_container'. - * + * * @param condition the condition value to set. * @return the DenyAssignmentProperties object itself. */ @@ -294,7 +289,7 @@ public DenyAssignmentProperties withCondition(String condition) { /** * Get the conditionVersion property: Version of the condition. - * + * * @return the conditionVersion value. */ public String conditionVersion() { @@ -303,7 +298,7 @@ public String conditionVersion() { /** * Set the conditionVersion property: Version of the condition. - * + * * @param conditionVersion the conditionVersion value to set. * @return the DenyAssignmentProperties object itself. */ @@ -314,7 +309,7 @@ public DenyAssignmentProperties withConditionVersion(String conditionVersion) { /** * Get the createdOn property: Time it was created. - * + * * @return the createdOn value. */ public OffsetDateTime createdOn() { @@ -323,7 +318,7 @@ public OffsetDateTime createdOn() { /** * Get the updatedOn property: Time it was updated. - * + * * @return the updatedOn value. */ public OffsetDateTime updatedOn() { @@ -332,7 +327,7 @@ public OffsetDateTime updatedOn() { /** * Get the createdBy property: Id of the user who created the assignment. - * + * * @return the createdBy value. */ public String createdBy() { @@ -341,7 +336,7 @@ public String createdBy() { /** * Get the updatedBy property: Id of the user who updated the assignment. - * + * * @return the updatedBy value. */ public String updatedBy() { @@ -350,7 +345,7 @@ public String updatedBy() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -364,4 +359,83 @@ public void validate() { excludePrincipals().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("denyAssignmentName", this.denyAssignmentName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("permissions", this.permissions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeBooleanField("doNotApplyToChildScopes", this.doNotApplyToChildScopes); + jsonWriter.writeArrayField("principals", this.principals, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("excludePrincipals", this.excludePrincipals, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("isSystemProtected", this.isSystemProtected); + jsonWriter.writeStringField("condition", this.condition); + jsonWriter.writeStringField("conditionVersion", this.conditionVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DenyAssignmentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DenyAssignmentProperties 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 DenyAssignmentProperties. + */ + public static DenyAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DenyAssignmentProperties deserializedDenyAssignmentProperties = new DenyAssignmentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("denyAssignmentName".equals(fieldName)) { + deserializedDenyAssignmentProperties.denyAssignmentName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDenyAssignmentProperties.description = reader.getString(); + } else if ("permissions".equals(fieldName)) { + List permissions + = reader.readArray(reader1 -> DenyAssignmentPermission.fromJson(reader1)); + deserializedDenyAssignmentProperties.permissions = permissions; + } else if ("scope".equals(fieldName)) { + deserializedDenyAssignmentProperties.scope = reader.getString(); + } else if ("doNotApplyToChildScopes".equals(fieldName)) { + deserializedDenyAssignmentProperties.doNotApplyToChildScopes + = reader.getNullable(JsonReader::getBoolean); + } else if ("principals".equals(fieldName)) { + List principals = reader.readArray(reader1 -> Principal.fromJson(reader1)); + deserializedDenyAssignmentProperties.principals = principals; + } else if ("excludePrincipals".equals(fieldName)) { + List excludePrincipals = reader.readArray(reader1 -> Principal.fromJson(reader1)); + deserializedDenyAssignmentProperties.excludePrincipals = excludePrincipals; + } else if ("isSystemProtected".equals(fieldName)) { + deserializedDenyAssignmentProperties.isSystemProtected = reader.getNullable(JsonReader::getBoolean); + } else if ("condition".equals(fieldName)) { + deserializedDenyAssignmentProperties.condition = reader.getString(); + } else if ("conditionVersion".equals(fieldName)) { + deserializedDenyAssignmentProperties.conditionVersion = reader.getString(); + } else if ("createdOn".equals(fieldName)) { + deserializedDenyAssignmentProperties.createdOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("updatedOn".equals(fieldName)) { + deserializedDenyAssignmentProperties.updatedOn = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedDenyAssignmentProperties.createdBy = reader.getString(); + } else if ("updatedBy".equals(fieldName)) { + deserializedDenyAssignmentProperties.updatedBy = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDenyAssignmentProperties; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/EligibleChildResourceInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/EligibleChildResourceInner.java index a04c06761d8b3..02b1fdb78f109 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/EligibleChildResourceInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/EligibleChildResourceInner.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Eligible child resource. */ +/** + * Eligible child resource. + */ @Immutable -public final class EligibleChildResourceInner { +public final class EligibleChildResourceInner implements JsonSerializable { /* * The resource scope Id. */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The resource name. */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * The resource type. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; - /** Creates an instance of EligibleChildResourceInner class. */ + /** + * Creates an instance of EligibleChildResourceInner class. + */ public EligibleChildResourceInner() { } /** * Get the id property: The resource scope Id. - * + * * @return the id value. */ public String id() { @@ -43,7 +48,7 @@ public String id() { /** * Get the name property: The resource name. - * + * * @return the name value. */ public String name() { @@ -52,7 +57,7 @@ public String name() { /** * Get the type property: The resource type. - * + * * @return the type value. */ public String type() { @@ -61,9 +66,48 @@ public String type() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EligibleChildResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EligibleChildResourceInner 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 EligibleChildResourceInner. + */ + public static EligibleChildResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EligibleChildResourceInner deserializedEligibleChildResourceInner = new EligibleChildResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedEligibleChildResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedEligibleChildResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedEligibleChildResourceInner.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedEligibleChildResourceInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get1ItemsItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get1ItemsItem.java index 8a73669814eea..6bec2c4e6acb4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get1ItemsItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get1ItemsItem.java @@ -5,69 +5,106 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Get1ItemsItem. */ +/** + * Defines values for Get1ItemsItem. + */ public final class Get1ItemsItem extends ExpandableStringEnum { - /** Static value id for Get1ItemsItem. */ + /** + * Static value id for Get1ItemsItem. + */ public static final Get1ItemsItem ID = fromString("id"); - /** Static value deletedDateTime for Get1ItemsItem. */ + /** + * Static value deletedDateTime for Get1ItemsItem. + */ public static final Get1ItemsItem DELETED_DATE_TIME = fromString("deletedDateTime"); - /** Static value authenticationType for Get1ItemsItem. */ + /** + * Static value authenticationType for Get1ItemsItem. + */ public static final Get1ItemsItem AUTHENTICATION_TYPE = fromString("authenticationType"); - /** Static value availabilityStatus for Get1ItemsItem. */ + /** + * Static value availabilityStatus for Get1ItemsItem. + */ public static final Get1ItemsItem AVAILABILITY_STATUS = fromString("availabilityStatus"); - /** Static value isAdminManaged for Get1ItemsItem. */ + /** + * Static value isAdminManaged for Get1ItemsItem. + */ public static final Get1ItemsItem IS_ADMIN_MANAGED = fromString("isAdminManaged"); - /** Static value isDefault for Get1ItemsItem. */ + /** + * Static value isDefault for Get1ItemsItem. + */ public static final Get1ItemsItem IS_DEFAULT = fromString("isDefault"); - /** Static value isInitial for Get1ItemsItem. */ + /** + * Static value isInitial for Get1ItemsItem. + */ public static final Get1ItemsItem IS_INITIAL = fromString("isInitial"); - /** Static value isRoot for Get1ItemsItem. */ + /** + * Static value isRoot for Get1ItemsItem. + */ public static final Get1ItemsItem IS_ROOT = fromString("isRoot"); - /** Static value isVerified for Get1ItemsItem. */ + /** + * Static value isVerified for Get1ItemsItem. + */ public static final Get1ItemsItem IS_VERIFIED = fromString("isVerified"); - /** Static value manufacturer for Get1ItemsItem. */ + /** + * Static value manufacturer for Get1ItemsItem. + */ public static final Get1ItemsItem MANUFACTURER = fromString("manufacturer"); - /** Static value model for Get1ItemsItem. */ + /** + * Static value model for Get1ItemsItem. + */ public static final Get1ItemsItem MODEL = fromString("model"); - /** Static value passwordNotificationWindowInDays for Get1ItemsItem. */ - public static final Get1ItemsItem PASSWORD_NOTIFICATION_WINDOW_IN_DAYS = - fromString("passwordNotificationWindowInDays"); + /** + * Static value passwordNotificationWindowInDays for Get1ItemsItem. + */ + public static final Get1ItemsItem PASSWORD_NOTIFICATION_WINDOW_IN_DAYS + = fromString("passwordNotificationWindowInDays"); - /** Static value passwordValidityPeriodInDays for Get1ItemsItem. */ + /** + * Static value passwordValidityPeriodInDays for Get1ItemsItem. + */ public static final Get1ItemsItem PASSWORD_VALIDITY_PERIOD_IN_DAYS = fromString("passwordValidityPeriodInDays"); - /** Static value state for Get1ItemsItem. */ + /** + * Static value state for Get1ItemsItem. + */ public static final Get1ItemsItem STATE = fromString("state"); - /** Static value supportedServices for Get1ItemsItem. */ + /** + * Static value supportedServices for Get1ItemsItem. + */ public static final Get1ItemsItem SUPPORTED_SERVICES = fromString("supportedServices"); - /** Static value domainNameReferences for Get1ItemsItem. */ + /** + * Static value domainNameReferences for Get1ItemsItem. + */ public static final Get1ItemsItem DOMAIN_NAME_REFERENCES = fromString("domainNameReferences"); - /** Static value serviceConfigurationRecords for Get1ItemsItem. */ + /** + * Static value serviceConfigurationRecords for Get1ItemsItem. + */ public static final Get1ItemsItem SERVICE_CONFIGURATION_RECORDS = fromString("serviceConfigurationRecords"); - /** Static value verificationDnsRecords for Get1ItemsItem. */ + /** + * Static value verificationDnsRecords for Get1ItemsItem. + */ public static final Get1ItemsItem VERIFICATION_DNS_RECORDS = fromString("verificationDnsRecords"); /** * Creates a new instance of Get1ItemsItem value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -76,18 +113,17 @@ public Get1ItemsItem() { /** * Creates or finds a Get1ItemsItem from its string representation. - * + * * @param name a name to look for. * @return the corresponding Get1ItemsItem. */ - @JsonCreator public static Get1ItemsItem fromString(String name) { return fromString(name, Get1ItemsItem.class); } /** * Gets known Get1ItemsItem values. - * + * * @return known Get1ItemsItem values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get2ItemsItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get2ItemsItem.java index 393761c3ea534..ea6835bc9fb47 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get2ItemsItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get2ItemsItem.java @@ -5,566 +5,933 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Get2ItemsItem. */ +/** + * Defines values for Get2ItemsItem. + */ public final class Get2ItemsItem extends ExpandableStringEnum { - /** Static value id for Get2ItemsItem. */ + /** + * Static value id for Get2ItemsItem. + */ public static final Get2ItemsItem ID = fromString("id"); - /** Static value deletedDateTime for Get2ItemsItem. */ + /** + * Static value deletedDateTime for Get2ItemsItem. + */ public static final Get2ItemsItem DELETED_DATE_TIME = fromString("deletedDateTime"); - /** Static value addIns for Get2ItemsItem. */ + /** + * Static value addIns for Get2ItemsItem. + */ public static final Get2ItemsItem ADD_INS = fromString("addIns"); - /** Static value api for Get2ItemsItem. */ + /** + * Static value api for Get2ItemsItem. + */ public static final Get2ItemsItem API = fromString("api"); - /** Static value appId for Get2ItemsItem. */ + /** + * Static value appId for Get2ItemsItem. + */ public static final Get2ItemsItem APP_ID = fromString("appId"); - /** Static value applicationTemplateId for Get2ItemsItem. */ + /** + * Static value applicationTemplateId for Get2ItemsItem. + */ public static final Get2ItemsItem APPLICATION_TEMPLATE_ID = fromString("applicationTemplateId"); - /** Static value appRoles for Get2ItemsItem. */ + /** + * Static value appRoles for Get2ItemsItem. + */ public static final Get2ItemsItem APP_ROLES = fromString("appRoles"); - /** Static value createdDateTime for Get2ItemsItem. */ + /** + * Static value createdDateTime for Get2ItemsItem. + */ public static final Get2ItemsItem CREATED_DATE_TIME = fromString("createdDateTime"); - /** Static value description for Get2ItemsItem. */ + /** + * Static value description for Get2ItemsItem. + */ public static final Get2ItemsItem DESCRIPTION = fromString("description"); - /** Static value displayName for Get2ItemsItem. */ + /** + * Static value displayName for Get2ItemsItem. + */ public static final Get2ItemsItem DISPLAY_NAME = fromString("displayName"); - /** Static value groupMembershipClaims for Get2ItemsItem. */ + /** + * Static value groupMembershipClaims for Get2ItemsItem. + */ public static final Get2ItemsItem GROUP_MEMBERSHIP_CLAIMS = fromString("groupMembershipClaims"); - /** Static value identifierUris for Get2ItemsItem. */ + /** + * Static value identifierUris for Get2ItemsItem. + */ public static final Get2ItemsItem IDENTIFIER_URIS = fromString("identifierUris"); - /** Static value info for Get2ItemsItem. */ + /** + * Static value info for Get2ItemsItem. + */ public static final Get2ItemsItem INFO = fromString("info"); - /** Static value isDeviceOnlyAuthSupported for Get2ItemsItem. */ + /** + * Static value isDeviceOnlyAuthSupported for Get2ItemsItem. + */ public static final Get2ItemsItem IS_DEVICE_ONLY_AUTH_SUPPORTED = fromString("isDeviceOnlyAuthSupported"); - /** Static value isFallbackPublicClient for Get2ItemsItem. */ + /** + * Static value isFallbackPublicClient for Get2ItemsItem. + */ public static final Get2ItemsItem IS_FALLBACK_PUBLIC_CLIENT = fromString("isFallbackPublicClient"); - /** Static value keyCredentials for Get2ItemsItem. */ + /** + * Static value keyCredentials for Get2ItemsItem. + */ public static final Get2ItemsItem KEY_CREDENTIALS = fromString("keyCredentials"); - /** Static value logo for Get2ItemsItem. */ + /** + * Static value logo for Get2ItemsItem. + */ public static final Get2ItemsItem LOGO = fromString("logo"); - /** Static value notes for Get2ItemsItem. */ + /** + * Static value notes for Get2ItemsItem. + */ public static final Get2ItemsItem NOTES = fromString("notes"); - /** Static value oauth2RequirePostResponse for Get2ItemsItem. */ + /** + * Static value oauth2RequirePostResponse for Get2ItemsItem. + */ public static final Get2ItemsItem OAUTH2REQUIRE_POST_RESPONSE = fromString("oauth2RequirePostResponse"); - /** Static value optionalClaims for Get2ItemsItem. */ + /** + * Static value optionalClaims for Get2ItemsItem. + */ public static final Get2ItemsItem OPTIONAL_CLAIMS = fromString("optionalClaims"); - /** Static value parentalControlSettings for Get2ItemsItem. */ + /** + * Static value parentalControlSettings for Get2ItemsItem. + */ public static final Get2ItemsItem PARENTAL_CONTROL_SETTINGS = fromString("parentalControlSettings"); - /** Static value passwordCredentials for Get2ItemsItem. */ + /** + * Static value passwordCredentials for Get2ItemsItem. + */ public static final Get2ItemsItem PASSWORD_CREDENTIALS = fromString("passwordCredentials"); - /** Static value publicClient for Get2ItemsItem. */ + /** + * Static value publicClient for Get2ItemsItem. + */ public static final Get2ItemsItem PUBLIC_CLIENT = fromString("publicClient"); - /** Static value publisherDomain for Get2ItemsItem. */ + /** + * Static value publisherDomain for Get2ItemsItem. + */ public static final Get2ItemsItem PUBLISHER_DOMAIN = fromString("publisherDomain"); - /** Static value requiredResourceAccess for Get2ItemsItem. */ + /** + * Static value requiredResourceAccess for Get2ItemsItem. + */ public static final Get2ItemsItem REQUIRED_RESOURCE_ACCESS = fromString("requiredResourceAccess"); - /** Static value signInAudience for Get2ItemsItem. */ + /** + * Static value signInAudience for Get2ItemsItem. + */ public static final Get2ItemsItem SIGN_IN_AUDIENCE = fromString("signInAudience"); - /** Static value tags for Get2ItemsItem. */ + /** + * Static value tags for Get2ItemsItem. + */ public static final Get2ItemsItem TAGS = fromString("tags"); - /** Static value tokenEncryptionKeyId for Get2ItemsItem. */ + /** + * Static value tokenEncryptionKeyId for Get2ItemsItem. + */ public static final Get2ItemsItem TOKEN_ENCRYPTION_KEY_ID = fromString("tokenEncryptionKeyId"); - /** Static value web for Get2ItemsItem. */ + /** + * Static value web for Get2ItemsItem. + */ public static final Get2ItemsItem WEB = fromString("web"); - /** Static value createdOnBehalfOf for Get2ItemsItem. */ + /** + * Static value createdOnBehalfOf for Get2ItemsItem. + */ public static final Get2ItemsItem CREATED_ON_BEHALF_OF = fromString("createdOnBehalfOf"); - /** Static value extensionProperties for Get2ItemsItem. */ + /** + * Static value extensionProperties for Get2ItemsItem. + */ public static final Get2ItemsItem EXTENSION_PROPERTIES = fromString("extensionProperties"); - /** Static value homeRealmDiscoveryPolicies for Get2ItemsItem. */ + /** + * Static value homeRealmDiscoveryPolicies for Get2ItemsItem. + */ public static final Get2ItemsItem HOME_REALM_DISCOVERY_POLICIES = fromString("homeRealmDiscoveryPolicies"); - /** Static value owners for Get2ItemsItem. */ + /** + * Static value owners for Get2ItemsItem. + */ public static final Get2ItemsItem OWNERS = fromString("owners"); - /** Static value tokenIssuancePolicies for Get2ItemsItem. */ + /** + * Static value tokenIssuancePolicies for Get2ItemsItem. + */ public static final Get2ItemsItem TOKEN_ISSUANCE_POLICIES = fromString("tokenIssuancePolicies"); - /** Static value tokenLifetimePolicies for Get2ItemsItem. */ + /** + * Static value tokenLifetimePolicies for Get2ItemsItem. + */ public static final Get2ItemsItem TOKEN_LIFETIME_POLICIES = fromString("tokenLifetimePolicies"); - /** Static value assignedLabels for Get2ItemsItem. */ + /** + * Static value assignedLabels for Get2ItemsItem. + */ public static final Get2ItemsItem ASSIGNED_LABELS = fromString("assignedLabels"); - /** Static value assignedLicenses for Get2ItemsItem. */ + /** + * Static value assignedLicenses for Get2ItemsItem. + */ public static final Get2ItemsItem ASSIGNED_LICENSES = fromString("assignedLicenses"); - /** Static value classification for Get2ItemsItem. */ + /** + * Static value classification for Get2ItemsItem. + */ public static final Get2ItemsItem CLASSIFICATION = fromString("classification"); - /** Static value expirationDateTime for Get2ItemsItem. */ + /** + * Static value expirationDateTime for Get2ItemsItem. + */ public static final Get2ItemsItem EXPIRATION_DATE_TIME = fromString("expirationDateTime"); - /** Static value groupTypes for Get2ItemsItem. */ + /** + * Static value groupTypes for Get2ItemsItem. + */ public static final Get2ItemsItem GROUP_TYPES = fromString("groupTypes"); - /** Static value hasMembersWithLicenseErrors for Get2ItemsItem. */ + /** + * Static value hasMembersWithLicenseErrors for Get2ItemsItem. + */ public static final Get2ItemsItem HAS_MEMBERS_WITH_LICENSE_ERRORS = fromString("hasMembersWithLicenseErrors"); - /** Static value licenseProcessingState for Get2ItemsItem. */ + /** + * Static value licenseProcessingState for Get2ItemsItem. + */ public static final Get2ItemsItem LICENSE_PROCESSING_STATE = fromString("licenseProcessingState"); - /** Static value mail for Get2ItemsItem. */ + /** + * Static value mail for Get2ItemsItem. + */ public static final Get2ItemsItem MAIL = fromString("mail"); - /** Static value mailEnabled for Get2ItemsItem. */ + /** + * Static value mailEnabled for Get2ItemsItem. + */ public static final Get2ItemsItem MAIL_ENABLED = fromString("mailEnabled"); - /** Static value mailNickname for Get2ItemsItem. */ + /** + * Static value mailNickname for Get2ItemsItem. + */ public static final Get2ItemsItem MAIL_NICKNAME = fromString("mailNickname"); - /** Static value membershipRule for Get2ItemsItem. */ + /** + * Static value membershipRule for Get2ItemsItem. + */ public static final Get2ItemsItem MEMBERSHIP_RULE = fromString("membershipRule"); - /** Static value membershipRuleProcessingState for Get2ItemsItem. */ + /** + * Static value membershipRuleProcessingState for Get2ItemsItem. + */ public static final Get2ItemsItem MEMBERSHIP_RULE_PROCESSING_STATE = fromString("membershipRuleProcessingState"); - /** Static value onPremisesDomainName for Get2ItemsItem. */ + /** + * Static value onPremisesDomainName for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_DOMAIN_NAME = fromString("onPremisesDomainName"); - /** Static value onPremisesLastSyncDateTime for Get2ItemsItem. */ + /** + * Static value onPremisesLastSyncDateTime for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_LAST_SYNC_DATE_TIME = fromString("onPremisesLastSyncDateTime"); - /** Static value onPremisesNetBiosName for Get2ItemsItem. */ + /** + * Static value onPremisesNetBiosName for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_NET_BIOS_NAME = fromString("onPremisesNetBiosName"); - /** Static value onPremisesProvisioningErrors for Get2ItemsItem. */ + /** + * Static value onPremisesProvisioningErrors for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_PROVISIONING_ERRORS = fromString("onPremisesProvisioningErrors"); - /** Static value onPremisesSamAccountName for Get2ItemsItem. */ + /** + * Static value onPremisesSamAccountName for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_SAM_ACCOUNT_NAME = fromString("onPremisesSamAccountName"); - /** Static value onPremisesSecurityIdentifier for Get2ItemsItem. */ + /** + * Static value onPremisesSecurityIdentifier for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_SECURITY_IDENTIFIER = fromString("onPremisesSecurityIdentifier"); - /** Static value onPremisesSyncEnabled for Get2ItemsItem. */ + /** + * Static value onPremisesSyncEnabled for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_SYNC_ENABLED = fromString("onPremisesSyncEnabled"); - /** Static value preferredDataLocation for Get2ItemsItem. */ + /** + * Static value preferredDataLocation for Get2ItemsItem. + */ public static final Get2ItemsItem PREFERRED_DATA_LOCATION = fromString("preferredDataLocation"); - /** Static value preferredLanguage for Get2ItemsItem. */ + /** + * Static value preferredLanguage for Get2ItemsItem. + */ public static final Get2ItemsItem PREFERRED_LANGUAGE = fromString("preferredLanguage"); - /** Static value proxyAddresses for Get2ItemsItem. */ + /** + * Static value proxyAddresses for Get2ItemsItem. + */ public static final Get2ItemsItem PROXY_ADDRESSES = fromString("proxyAddresses"); - /** Static value renewedDateTime for Get2ItemsItem. */ + /** + * Static value renewedDateTime for Get2ItemsItem. + */ public static final Get2ItemsItem RENEWED_DATE_TIME = fromString("renewedDateTime"); - /** Static value securityEnabled for Get2ItemsItem. */ + /** + * Static value securityEnabled for Get2ItemsItem. + */ public static final Get2ItemsItem SECURITY_ENABLED = fromString("securityEnabled"); - /** Static value securityIdentifier for Get2ItemsItem. */ + /** + * Static value securityIdentifier for Get2ItemsItem. + */ public static final Get2ItemsItem SECURITY_IDENTIFIER = fromString("securityIdentifier"); - /** Static value theme for Get2ItemsItem. */ + /** + * Static value theme for Get2ItemsItem. + */ public static final Get2ItemsItem THEME = fromString("theme"); - /** Static value visibility for Get2ItemsItem. */ + /** + * Static value visibility for Get2ItemsItem. + */ public static final Get2ItemsItem VISIBILITY = fromString("visibility"); - /** Static value allowExternalSenders for Get2ItemsItem. */ + /** + * Static value allowExternalSenders for Get2ItemsItem. + */ public static final Get2ItemsItem ALLOW_EXTERNAL_SENDERS = fromString("allowExternalSenders"); - /** Static value autoSubscribeNewMembers for Get2ItemsItem. */ + /** + * Static value autoSubscribeNewMembers for Get2ItemsItem. + */ public static final Get2ItemsItem AUTO_SUBSCRIBE_NEW_MEMBERS = fromString("autoSubscribeNewMembers"); - /** Static value hideFromAddressLists for Get2ItemsItem. */ + /** + * Static value hideFromAddressLists for Get2ItemsItem. + */ public static final Get2ItemsItem HIDE_FROM_ADDRESS_LISTS = fromString("hideFromAddressLists"); - /** Static value hideFromOutlookClients for Get2ItemsItem. */ + /** + * Static value hideFromOutlookClients for Get2ItemsItem. + */ public static final Get2ItemsItem HIDE_FROM_OUTLOOK_CLIENTS = fromString("hideFromOutlookClients"); - /** Static value isSubscribedByMail for Get2ItemsItem. */ + /** + * Static value isSubscribedByMail for Get2ItemsItem. + */ public static final Get2ItemsItem IS_SUBSCRIBED_BY_MAIL = fromString("isSubscribedByMail"); - /** Static value unseenCount for Get2ItemsItem. */ + /** + * Static value unseenCount for Get2ItemsItem. + */ public static final Get2ItemsItem UNSEEN_COUNT = fromString("unseenCount"); - /** Static value isArchived for Get2ItemsItem. */ + /** + * Static value isArchived for Get2ItemsItem. + */ public static final Get2ItemsItem IS_ARCHIVED = fromString("isArchived"); - /** Static value appRoleAssignments for Get2ItemsItem. */ + /** + * Static value appRoleAssignments for Get2ItemsItem. + */ public static final Get2ItemsItem APP_ROLE_ASSIGNMENTS = fromString("appRoleAssignments"); - /** Static value memberOf for Get2ItemsItem. */ + /** + * Static value memberOf for Get2ItemsItem. + */ public static final Get2ItemsItem MEMBER_OF = fromString("memberOf"); - /** Static value members for Get2ItemsItem. */ + /** + * Static value members for Get2ItemsItem. + */ public static final Get2ItemsItem MEMBERS = fromString("members"); - /** Static value membersWithLicenseErrors for Get2ItemsItem. */ + /** + * Static value membersWithLicenseErrors for Get2ItemsItem. + */ public static final Get2ItemsItem MEMBERS_WITH_LICENSE_ERRORS = fromString("membersWithLicenseErrors"); - /** Static value permissionGrants for Get2ItemsItem. */ + /** + * Static value permissionGrants for Get2ItemsItem. + */ public static final Get2ItemsItem PERMISSION_GRANTS = fromString("permissionGrants"); - /** Static value settings for Get2ItemsItem. */ + /** + * Static value settings for Get2ItemsItem. + */ public static final Get2ItemsItem SETTINGS = fromString("settings"); - /** Static value transitiveMemberOf for Get2ItemsItem. */ + /** + * Static value transitiveMemberOf for Get2ItemsItem. + */ public static final Get2ItemsItem TRANSITIVE_MEMBER_OF = fromString("transitiveMemberOf"); - /** Static value transitiveMembers for Get2ItemsItem. */ + /** + * Static value transitiveMembers for Get2ItemsItem. + */ public static final Get2ItemsItem TRANSITIVE_MEMBERS = fromString("transitiveMembers"); - /** Static value acceptedSenders for Get2ItemsItem. */ + /** + * Static value acceptedSenders for Get2ItemsItem. + */ public static final Get2ItemsItem ACCEPTED_SENDERS = fromString("acceptedSenders"); - /** Static value calendar for Get2ItemsItem. */ + /** + * Static value calendar for Get2ItemsItem. + */ public static final Get2ItemsItem CALENDAR = fromString("calendar"); - /** Static value calendarView for Get2ItemsItem. */ + /** + * Static value calendarView for Get2ItemsItem. + */ public static final Get2ItemsItem CALENDAR_VIEW = fromString("calendarView"); - /** Static value conversations for Get2ItemsItem. */ + /** + * Static value conversations for Get2ItemsItem. + */ public static final Get2ItemsItem CONVERSATIONS = fromString("conversations"); - /** Static value events for Get2ItemsItem. */ + /** + * Static value events for Get2ItemsItem. + */ public static final Get2ItemsItem EVENTS = fromString("events"); - /** Static value photo for Get2ItemsItem. */ + /** + * Static value photo for Get2ItemsItem. + */ public static final Get2ItemsItem PHOTO = fromString("photo"); - /** Static value photos for Get2ItemsItem. */ + /** + * Static value photos for Get2ItemsItem. + */ public static final Get2ItemsItem PHOTOS = fromString("photos"); - /** Static value rejectedSenders for Get2ItemsItem. */ + /** + * Static value rejectedSenders for Get2ItemsItem. + */ public static final Get2ItemsItem REJECTED_SENDERS = fromString("rejectedSenders"); - /** Static value threads for Get2ItemsItem. */ + /** + * Static value threads for Get2ItemsItem. + */ public static final Get2ItemsItem THREADS = fromString("threads"); - /** Static value drive for Get2ItemsItem. */ + /** + * Static value drive for Get2ItemsItem. + */ public static final Get2ItemsItem DRIVE = fromString("drive"); - /** Static value drives for Get2ItemsItem. */ + /** + * Static value drives for Get2ItemsItem. + */ public static final Get2ItemsItem DRIVES = fromString("drives"); - /** Static value sites for Get2ItemsItem. */ + /** + * Static value sites for Get2ItemsItem. + */ public static final Get2ItemsItem SITES = fromString("sites"); - /** Static value extensions for Get2ItemsItem. */ + /** + * Static value extensions for Get2ItemsItem. + */ public static final Get2ItemsItem EXTENSIONS = fromString("extensions"); - /** Static value groupLifecyclePolicies for Get2ItemsItem. */ + /** + * Static value groupLifecyclePolicies for Get2ItemsItem. + */ public static final Get2ItemsItem GROUP_LIFECYCLE_POLICIES = fromString("groupLifecyclePolicies"); - /** Static value planner for Get2ItemsItem. */ + /** + * Static value planner for Get2ItemsItem. + */ public static final Get2ItemsItem PLANNER = fromString("planner"); - /** Static value onenote for Get2ItemsItem. */ + /** + * Static value onenote for Get2ItemsItem. + */ public static final Get2ItemsItem ONENOTE = fromString("onenote"); - /** Static value team for Get2ItemsItem. */ + /** + * Static value team for Get2ItemsItem. + */ public static final Get2ItemsItem TEAM = fromString("team"); - /** Static value accountEnabled for Get2ItemsItem. */ + /** + * Static value accountEnabled for Get2ItemsItem. + */ public static final Get2ItemsItem ACCOUNT_ENABLED = fromString("accountEnabled"); - /** Static value ageGroup for Get2ItemsItem. */ + /** + * Static value ageGroup for Get2ItemsItem. + */ public static final Get2ItemsItem AGE_GROUP = fromString("ageGroup"); - /** Static value assignedPlans for Get2ItemsItem. */ + /** + * Static value assignedPlans for Get2ItemsItem. + */ public static final Get2ItemsItem ASSIGNED_PLANS = fromString("assignedPlans"); - /** Static value businessPhones for Get2ItemsItem. */ + /** + * Static value businessPhones for Get2ItemsItem. + */ public static final Get2ItemsItem BUSINESS_PHONES = fromString("businessPhones"); - /** Static value city for Get2ItemsItem. */ + /** + * Static value city for Get2ItemsItem. + */ public static final Get2ItemsItem CITY = fromString("city"); - /** Static value companyName for Get2ItemsItem. */ + /** + * Static value companyName for Get2ItemsItem. + */ public static final Get2ItemsItem COMPANY_NAME = fromString("companyName"); - /** Static value consentProvidedForMinor for Get2ItemsItem. */ + /** + * Static value consentProvidedForMinor for Get2ItemsItem. + */ public static final Get2ItemsItem CONSENT_PROVIDED_FOR_MINOR = fromString("consentProvidedForMinor"); - /** Static value country for Get2ItemsItem. */ + /** + * Static value country for Get2ItemsItem. + */ public static final Get2ItemsItem COUNTRY = fromString("country"); - /** Static value creationType for Get2ItemsItem. */ + /** + * Static value creationType for Get2ItemsItem. + */ public static final Get2ItemsItem CREATION_TYPE = fromString("creationType"); - /** Static value department for Get2ItemsItem. */ + /** + * Static value department for Get2ItemsItem. + */ public static final Get2ItemsItem DEPARTMENT = fromString("department"); - /** Static value employeeHireDate for Get2ItemsItem. */ + /** + * Static value employeeHireDate for Get2ItemsItem. + */ public static final Get2ItemsItem EMPLOYEE_HIRE_DATE = fromString("employeeHireDate"); - /** Static value employeeId for Get2ItemsItem. */ + /** + * Static value employeeId for Get2ItemsItem. + */ public static final Get2ItemsItem EMPLOYEE_ID = fromString("employeeId"); - /** Static value employeeOrgData for Get2ItemsItem. */ + /** + * Static value employeeOrgData for Get2ItemsItem. + */ public static final Get2ItemsItem EMPLOYEE_ORG_DATA = fromString("employeeOrgData"); - /** Static value employeeType for Get2ItemsItem. */ + /** + * Static value employeeType for Get2ItemsItem. + */ public static final Get2ItemsItem EMPLOYEE_TYPE = fromString("employeeType"); - /** Static value externalUserState for Get2ItemsItem. */ + /** + * Static value externalUserState for Get2ItemsItem. + */ public static final Get2ItemsItem EXTERNAL_USER_STATE = fromString("externalUserState"); - /** Static value externalUserStateChangeDateTime for Get2ItemsItem. */ - public static final Get2ItemsItem EXTERNAL_USER_STATE_CHANGE_DATE_TIME = - fromString("externalUserStateChangeDateTime"); + /** + * Static value externalUserStateChangeDateTime for Get2ItemsItem. + */ + public static final Get2ItemsItem EXTERNAL_USER_STATE_CHANGE_DATE_TIME + = fromString("externalUserStateChangeDateTime"); - /** Static value faxNumber for Get2ItemsItem. */ + /** + * Static value faxNumber for Get2ItemsItem. + */ public static final Get2ItemsItem FAX_NUMBER = fromString("faxNumber"); - /** Static value givenName for Get2ItemsItem. */ + /** + * Static value givenName for Get2ItemsItem. + */ public static final Get2ItemsItem GIVEN_NAME = fromString("givenName"); - /** Static value identities for Get2ItemsItem. */ + /** + * Static value identities for Get2ItemsItem. + */ public static final Get2ItemsItem IDENTITIES = fromString("identities"); - /** Static value imAddresses for Get2ItemsItem. */ + /** + * Static value imAddresses for Get2ItemsItem. + */ public static final Get2ItemsItem IM_ADDRESSES = fromString("imAddresses"); - /** Static value isResourceAccount for Get2ItemsItem. */ + /** + * Static value isResourceAccount for Get2ItemsItem. + */ public static final Get2ItemsItem IS_RESOURCE_ACCOUNT = fromString("isResourceAccount"); - /** Static value jobTitle for Get2ItemsItem. */ + /** + * Static value jobTitle for Get2ItemsItem. + */ public static final Get2ItemsItem JOB_TITLE = fromString("jobTitle"); - /** Static value lastPasswordChangeDateTime for Get2ItemsItem. */ + /** + * Static value lastPasswordChangeDateTime for Get2ItemsItem. + */ public static final Get2ItemsItem LAST_PASSWORD_CHANGE_DATE_TIME = fromString("lastPasswordChangeDateTime"); - /** Static value legalAgeGroupClassification for Get2ItemsItem. */ + /** + * Static value legalAgeGroupClassification for Get2ItemsItem. + */ public static final Get2ItemsItem LEGAL_AGE_GROUP_CLASSIFICATION = fromString("legalAgeGroupClassification"); - /** Static value licenseAssignmentStates for Get2ItemsItem. */ + /** + * Static value licenseAssignmentStates for Get2ItemsItem. + */ public static final Get2ItemsItem LICENSE_ASSIGNMENT_STATES = fromString("licenseAssignmentStates"); - /** Static value mobilePhone for Get2ItemsItem. */ + /** + * Static value mobilePhone for Get2ItemsItem. + */ public static final Get2ItemsItem MOBILE_PHONE = fromString("mobilePhone"); - /** Static value officeLocation for Get2ItemsItem. */ + /** + * Static value officeLocation for Get2ItemsItem. + */ public static final Get2ItemsItem OFFICE_LOCATION = fromString("officeLocation"); - /** Static value onPremisesDistinguishedName for Get2ItemsItem. */ + /** + * Static value onPremisesDistinguishedName for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_DISTINGUISHED_NAME = fromString("onPremisesDistinguishedName"); - /** Static value onPremisesExtensionAttributes for Get2ItemsItem. */ + /** + * Static value onPremisesExtensionAttributes for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_EXTENSION_ATTRIBUTES = fromString("onPremisesExtensionAttributes"); - /** Static value onPremisesImmutableId for Get2ItemsItem. */ + /** + * Static value onPremisesImmutableId for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_IMMUTABLE_ID = fromString("onPremisesImmutableId"); - /** Static value onPremisesUserPrincipalName for Get2ItemsItem. */ + /** + * Static value onPremisesUserPrincipalName for Get2ItemsItem. + */ public static final Get2ItemsItem ON_PREMISES_USER_PRINCIPAL_NAME = fromString("onPremisesUserPrincipalName"); - /** Static value otherMails for Get2ItemsItem. */ + /** + * Static value otherMails for Get2ItemsItem. + */ public static final Get2ItemsItem OTHER_MAILS = fromString("otherMails"); - /** Static value passwordPolicies for Get2ItemsItem. */ + /** + * Static value passwordPolicies for Get2ItemsItem. + */ public static final Get2ItemsItem PASSWORD_POLICIES = fromString("passwordPolicies"); - /** Static value passwordProfile for Get2ItemsItem. */ + /** + * Static value passwordProfile for Get2ItemsItem. + */ public static final Get2ItemsItem PASSWORD_PROFILE = fromString("passwordProfile"); - /** Static value postalCode for Get2ItemsItem. */ + /** + * Static value postalCode for Get2ItemsItem. + */ public static final Get2ItemsItem POSTAL_CODE = fromString("postalCode"); - /** Static value provisionedPlans for Get2ItemsItem. */ + /** + * Static value provisionedPlans for Get2ItemsItem. + */ public static final Get2ItemsItem PROVISIONED_PLANS = fromString("provisionedPlans"); - /** Static value showInAddressList for Get2ItemsItem. */ + /** + * Static value showInAddressList for Get2ItemsItem. + */ public static final Get2ItemsItem SHOW_IN_ADDRESS_LIST = fromString("showInAddressList"); - /** Static value signInSessionsValidFromDateTime for Get2ItemsItem. */ - public static final Get2ItemsItem SIGN_IN_SESSIONS_VALID_FROM_DATE_TIME = - fromString("signInSessionsValidFromDateTime"); + /** + * Static value signInSessionsValidFromDateTime for Get2ItemsItem. + */ + public static final Get2ItemsItem SIGN_IN_SESSIONS_VALID_FROM_DATE_TIME + = fromString("signInSessionsValidFromDateTime"); - /** Static value state for Get2ItemsItem. */ + /** + * Static value state for Get2ItemsItem. + */ public static final Get2ItemsItem STATE = fromString("state"); - /** Static value streetAddress for Get2ItemsItem. */ + /** + * Static value streetAddress for Get2ItemsItem. + */ public static final Get2ItemsItem STREET_ADDRESS = fromString("streetAddress"); - /** Static value surname for Get2ItemsItem. */ + /** + * Static value surname for Get2ItemsItem. + */ public static final Get2ItemsItem SURNAME = fromString("surname"); - /** Static value usageLocation for Get2ItemsItem. */ + /** + * Static value usageLocation for Get2ItemsItem. + */ public static final Get2ItemsItem USAGE_LOCATION = fromString("usageLocation"); - /** Static value userPrincipalName for Get2ItemsItem. */ + /** + * Static value userPrincipalName for Get2ItemsItem. + */ public static final Get2ItemsItem USER_PRINCIPAL_NAME = fromString("userPrincipalName"); - /** Static value userType for Get2ItemsItem. */ + /** + * Static value userType for Get2ItemsItem. + */ public static final Get2ItemsItem USER_TYPE = fromString("userType"); - /** Static value mailboxSettings for Get2ItemsItem. */ + /** + * Static value mailboxSettings for Get2ItemsItem. + */ public static final Get2ItemsItem MAILBOX_SETTINGS = fromString("mailboxSettings"); - /** Static value deviceEnrollmentLimit for Get2ItemsItem. */ + /** + * Static value deviceEnrollmentLimit for Get2ItemsItem. + */ public static final Get2ItemsItem DEVICE_ENROLLMENT_LIMIT = fromString("deviceEnrollmentLimit"); - /** Static value aboutMe for Get2ItemsItem. */ + /** + * Static value aboutMe for Get2ItemsItem. + */ public static final Get2ItemsItem ABOUT_ME = fromString("aboutMe"); - /** Static value birthday for Get2ItemsItem. */ + /** + * Static value birthday for Get2ItemsItem. + */ public static final Get2ItemsItem BIRTHDAY = fromString("birthday"); - /** Static value hireDate for Get2ItemsItem. */ + /** + * Static value hireDate for Get2ItemsItem. + */ public static final Get2ItemsItem HIRE_DATE = fromString("hireDate"); - /** Static value interests for Get2ItemsItem. */ + /** + * Static value interests for Get2ItemsItem. + */ public static final Get2ItemsItem INTERESTS = fromString("interests"); - /** Static value mySite for Get2ItemsItem. */ + /** + * Static value mySite for Get2ItemsItem. + */ public static final Get2ItemsItem MY_SITE = fromString("mySite"); - /** Static value pastProjects for Get2ItemsItem. */ + /** + * Static value pastProjects for Get2ItemsItem. + */ public static final Get2ItemsItem PAST_PROJECTS = fromString("pastProjects"); - /** Static value preferredName for Get2ItemsItem. */ + /** + * Static value preferredName for Get2ItemsItem. + */ public static final Get2ItemsItem PREFERRED_NAME = fromString("preferredName"); - /** Static value responsibilities for Get2ItemsItem. */ + /** + * Static value responsibilities for Get2ItemsItem. + */ public static final Get2ItemsItem RESPONSIBILITIES = fromString("responsibilities"); - /** Static value schools for Get2ItemsItem. */ + /** + * Static value schools for Get2ItemsItem. + */ public static final Get2ItemsItem SCHOOLS = fromString("schools"); - /** Static value skills for Get2ItemsItem. */ + /** + * Static value skills for Get2ItemsItem. + */ public static final Get2ItemsItem SKILLS = fromString("skills"); - /** Static value createdObjects for Get2ItemsItem. */ + /** + * Static value createdObjects for Get2ItemsItem. + */ public static final Get2ItemsItem CREATED_OBJECTS = fromString("createdObjects"); - /** Static value directReports for Get2ItemsItem. */ + /** + * Static value directReports for Get2ItemsItem. + */ public static final Get2ItemsItem DIRECT_REPORTS = fromString("directReports"); - /** Static value licenseDetails for Get2ItemsItem. */ + /** + * Static value licenseDetails for Get2ItemsItem. + */ public static final Get2ItemsItem LICENSE_DETAILS = fromString("licenseDetails"); - /** Static value manager for Get2ItemsItem. */ + /** + * Static value manager for Get2ItemsItem. + */ public static final Get2ItemsItem MANAGER = fromString("manager"); - /** Static value oauth2PermissionGrants for Get2ItemsItem. */ + /** + * Static value oauth2PermissionGrants for Get2ItemsItem. + */ public static final Get2ItemsItem OAUTH2PERMISSION_GRANTS = fromString("oauth2PermissionGrants"); - /** Static value ownedDevices for Get2ItemsItem. */ + /** + * Static value ownedDevices for Get2ItemsItem. + */ public static final Get2ItemsItem OWNED_DEVICES = fromString("ownedDevices"); - /** Static value ownedObjects for Get2ItemsItem. */ + /** + * Static value ownedObjects for Get2ItemsItem. + */ public static final Get2ItemsItem OWNED_OBJECTS = fromString("ownedObjects"); - /** Static value registeredDevices for Get2ItemsItem. */ + /** + * Static value registeredDevices for Get2ItemsItem. + */ public static final Get2ItemsItem REGISTERED_DEVICES = fromString("registeredDevices"); - /** Static value scopedRoleMemberOf for Get2ItemsItem. */ + /** + * Static value scopedRoleMemberOf for Get2ItemsItem. + */ public static final Get2ItemsItem SCOPED_ROLE_MEMBER_OF = fromString("scopedRoleMemberOf"); - /** Static value calendarGroups for Get2ItemsItem. */ + /** + * Static value calendarGroups for Get2ItemsItem. + */ public static final Get2ItemsItem CALENDAR_GROUPS = fromString("calendarGroups"); - /** Static value calendars for Get2ItemsItem. */ + /** + * Static value calendars for Get2ItemsItem. + */ public static final Get2ItemsItem CALENDARS = fromString("calendars"); - /** Static value contactFolders for Get2ItemsItem. */ + /** + * Static value contactFolders for Get2ItemsItem. + */ public static final Get2ItemsItem CONTACT_FOLDERS = fromString("contactFolders"); - /** Static value contacts for Get2ItemsItem. */ + /** + * Static value contacts for Get2ItemsItem. + */ public static final Get2ItemsItem CONTACTS = fromString("contacts"); - /** Static value inferenceClassification for Get2ItemsItem. */ + /** + * Static value inferenceClassification for Get2ItemsItem. + */ public static final Get2ItemsItem INFERENCE_CLASSIFICATION = fromString("inferenceClassification"); - /** Static value mailFolders for Get2ItemsItem. */ + /** + * Static value mailFolders for Get2ItemsItem. + */ public static final Get2ItemsItem MAIL_FOLDERS = fromString("mailFolders"); - /** Static value messages for Get2ItemsItem. */ + /** + * Static value messages for Get2ItemsItem. + */ public static final Get2ItemsItem MESSAGES = fromString("messages"); - /** Static value outlook for Get2ItemsItem. */ + /** + * Static value outlook for Get2ItemsItem. + */ public static final Get2ItemsItem OUTLOOK = fromString("outlook"); - /** Static value people for Get2ItemsItem. */ + /** + * Static value people for Get2ItemsItem. + */ public static final Get2ItemsItem PEOPLE = fromString("people"); - /** Static value followedSites for Get2ItemsItem. */ + /** + * Static value followedSites for Get2ItemsItem. + */ public static final Get2ItemsItem FOLLOWED_SITES = fromString("followedSites"); - /** Static value managedDevices for Get2ItemsItem. */ + /** + * Static value managedDevices for Get2ItemsItem. + */ public static final Get2ItemsItem MANAGED_DEVICES = fromString("managedDevices"); - /** Static value managedAppRegistrations for Get2ItemsItem. */ + /** + * Static value managedAppRegistrations for Get2ItemsItem. + */ public static final Get2ItemsItem MANAGED_APP_REGISTRATIONS = fromString("managedAppRegistrations"); - /** Static value deviceManagementTroubleshootingEvents for Get2ItemsItem. */ - public static final Get2ItemsItem DEVICE_MANAGEMENT_TROUBLESHOOTING_EVENTS = - fromString("deviceManagementTroubleshootingEvents"); + /** + * Static value deviceManagementTroubleshootingEvents for Get2ItemsItem. + */ + public static final Get2ItemsItem DEVICE_MANAGEMENT_TROUBLESHOOTING_EVENTS + = fromString("deviceManagementTroubleshootingEvents"); - /** Static value insights for Get2ItemsItem. */ + /** + * Static value insights for Get2ItemsItem. + */ public static final Get2ItemsItem INSIGHTS = fromString("insights"); - /** Static value activities for Get2ItemsItem. */ + /** + * Static value activities for Get2ItemsItem. + */ public static final Get2ItemsItem ACTIVITIES = fromString("activities"); - /** Static value onlineMeetings for Get2ItemsItem. */ + /** + * Static value onlineMeetings for Get2ItemsItem. + */ public static final Get2ItemsItem ONLINE_MEETINGS = fromString("onlineMeetings"); - /** Static value presence for Get2ItemsItem. */ + /** + * Static value presence for Get2ItemsItem. + */ public static final Get2ItemsItem PRESENCE = fromString("presence"); - /** Static value joinedTeams for Get2ItemsItem. */ + /** + * Static value joinedTeams for Get2ItemsItem. + */ public static final Get2ItemsItem JOINED_TEAMS = fromString("joinedTeams"); - /** Static value teamwork for Get2ItemsItem. */ + /** + * Static value teamwork for Get2ItemsItem. + */ public static final Get2ItemsItem TEAMWORK = fromString("teamwork"); - /** Static value todo for Get2ItemsItem. */ + /** + * Static value todo for Get2ItemsItem. + */ public static final Get2ItemsItem TODO = fromString("todo"); - /** Static value * for Get2ItemsItem. */ + /** + * Static value * for Get2ItemsItem. + */ public static final Get2ItemsItem ASTERISK = fromString("*"); - /** Static value domainNameReferences for Get2ItemsItem. */ + /** + * Static value domainNameReferences for Get2ItemsItem. + */ public static final Get2ItemsItem DOMAIN_NAME_REFERENCES = fromString("domainNameReferences"); - /** Static value serviceConfigurationRecords for Get2ItemsItem. */ + /** + * Static value serviceConfigurationRecords for Get2ItemsItem. + */ public static final Get2ItemsItem SERVICE_CONFIGURATION_RECORDS = fromString("serviceConfigurationRecords"); - /** Static value verificationDnsRecords for Get2ItemsItem. */ + /** + * Static value verificationDnsRecords for Get2ItemsItem. + */ public static final Get2ItemsItem VERIFICATION_DNS_RECORDS = fromString("verificationDnsRecords"); /** * Creates a new instance of Get2ItemsItem value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -573,18 +940,17 @@ public Get2ItemsItem() { /** * Creates or finds a Get2ItemsItem from its string representation. - * + * * @param name a name to look for. * @return the corresponding Get2ItemsItem. */ - @JsonCreator public static Get2ItemsItem fromString(String name) { return fromString(name, Get2ItemsItem.class); } /** * Gets known Get2ItemsItem values. - * + * * @return known Get2ItemsItem values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get3ItemsItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get3ItemsItem.java index 23dbe798d12dd..1dbb338801c3f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get3ItemsItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get3ItemsItem.java @@ -5,198 +5,321 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Get3ItemsItem. */ +/** + * Defines values for Get3ItemsItem. + */ public final class Get3ItemsItem extends ExpandableStringEnum { - /** Static value * for Get3ItemsItem. */ + /** + * Static value * for Get3ItemsItem. + */ public static final Get3ItemsItem ASTERISK = fromString("*"); - /** Static value createdOnBehalfOf for Get3ItemsItem. */ + /** + * Static value createdOnBehalfOf for Get3ItemsItem. + */ public static final Get3ItemsItem CREATED_ON_BEHALF_OF = fromString("createdOnBehalfOf"); - /** Static value extensionProperties for Get3ItemsItem. */ + /** + * Static value extensionProperties for Get3ItemsItem. + */ public static final Get3ItemsItem EXTENSION_PROPERTIES = fromString("extensionProperties"); - /** Static value homeRealmDiscoveryPolicies for Get3ItemsItem. */ + /** + * Static value homeRealmDiscoveryPolicies for Get3ItemsItem. + */ public static final Get3ItemsItem HOME_REALM_DISCOVERY_POLICIES = fromString("homeRealmDiscoveryPolicies"); - /** Static value owners for Get3ItemsItem. */ + /** + * Static value owners for Get3ItemsItem. + */ public static final Get3ItemsItem OWNERS = fromString("owners"); - /** Static value tokenIssuancePolicies for Get3ItemsItem. */ + /** + * Static value tokenIssuancePolicies for Get3ItemsItem. + */ public static final Get3ItemsItem TOKEN_ISSUANCE_POLICIES = fromString("tokenIssuancePolicies"); - /** Static value tokenLifetimePolicies for Get3ItemsItem. */ + /** + * Static value tokenLifetimePolicies for Get3ItemsItem. + */ public static final Get3ItemsItem TOKEN_LIFETIME_POLICIES = fromString("tokenLifetimePolicies"); - /** Static value appRoleAssignments for Get3ItemsItem. */ + /** + * Static value appRoleAssignments for Get3ItemsItem. + */ public static final Get3ItemsItem APP_ROLE_ASSIGNMENTS = fromString("appRoleAssignments"); - /** Static value memberOf for Get3ItemsItem. */ + /** + * Static value memberOf for Get3ItemsItem. + */ public static final Get3ItemsItem MEMBER_OF = fromString("memberOf"); - /** Static value members for Get3ItemsItem. */ + /** + * Static value members for Get3ItemsItem. + */ public static final Get3ItemsItem MEMBERS = fromString("members"); - /** Static value membersWithLicenseErrors for Get3ItemsItem. */ + /** + * Static value membersWithLicenseErrors for Get3ItemsItem. + */ public static final Get3ItemsItem MEMBERS_WITH_LICENSE_ERRORS = fromString("membersWithLicenseErrors"); - /** Static value permissionGrants for Get3ItemsItem. */ + /** + * Static value permissionGrants for Get3ItemsItem. + */ public static final Get3ItemsItem PERMISSION_GRANTS = fromString("permissionGrants"); - /** Static value settings for Get3ItemsItem. */ + /** + * Static value settings for Get3ItemsItem. + */ public static final Get3ItemsItem SETTINGS = fromString("settings"); - /** Static value transitiveMemberOf for Get3ItemsItem. */ + /** + * Static value transitiveMemberOf for Get3ItemsItem. + */ public static final Get3ItemsItem TRANSITIVE_MEMBER_OF = fromString("transitiveMemberOf"); - /** Static value transitiveMembers for Get3ItemsItem. */ + /** + * Static value transitiveMembers for Get3ItemsItem. + */ public static final Get3ItemsItem TRANSITIVE_MEMBERS = fromString("transitiveMembers"); - /** Static value acceptedSenders for Get3ItemsItem. */ + /** + * Static value acceptedSenders for Get3ItemsItem. + */ public static final Get3ItemsItem ACCEPTED_SENDERS = fromString("acceptedSenders"); - /** Static value calendar for Get3ItemsItem. */ + /** + * Static value calendar for Get3ItemsItem. + */ public static final Get3ItemsItem CALENDAR = fromString("calendar"); - /** Static value calendarView for Get3ItemsItem. */ + /** + * Static value calendarView for Get3ItemsItem. + */ public static final Get3ItemsItem CALENDAR_VIEW = fromString("calendarView"); - /** Static value conversations for Get3ItemsItem. */ + /** + * Static value conversations for Get3ItemsItem. + */ public static final Get3ItemsItem CONVERSATIONS = fromString("conversations"); - /** Static value events for Get3ItemsItem. */ + /** + * Static value events for Get3ItemsItem. + */ public static final Get3ItemsItem EVENTS = fromString("events"); - /** Static value photo for Get3ItemsItem. */ + /** + * Static value photo for Get3ItemsItem. + */ public static final Get3ItemsItem PHOTO = fromString("photo"); - /** Static value photos for Get3ItemsItem. */ + /** + * Static value photos for Get3ItemsItem. + */ public static final Get3ItemsItem PHOTOS = fromString("photos"); - /** Static value rejectedSenders for Get3ItemsItem. */ + /** + * Static value rejectedSenders for Get3ItemsItem. + */ public static final Get3ItemsItem REJECTED_SENDERS = fromString("rejectedSenders"); - /** Static value threads for Get3ItemsItem. */ + /** + * Static value threads for Get3ItemsItem. + */ public static final Get3ItemsItem THREADS = fromString("threads"); - /** Static value drive for Get3ItemsItem. */ + /** + * Static value drive for Get3ItemsItem. + */ public static final Get3ItemsItem DRIVE = fromString("drive"); - /** Static value drives for Get3ItemsItem. */ + /** + * Static value drives for Get3ItemsItem. + */ public static final Get3ItemsItem DRIVES = fromString("drives"); - /** Static value sites for Get3ItemsItem. */ + /** + * Static value sites for Get3ItemsItem. + */ public static final Get3ItemsItem SITES = fromString("sites"); - /** Static value extensions for Get3ItemsItem. */ + /** + * Static value extensions for Get3ItemsItem. + */ public static final Get3ItemsItem EXTENSIONS = fromString("extensions"); - /** Static value groupLifecyclePolicies for Get3ItemsItem. */ + /** + * Static value groupLifecyclePolicies for Get3ItemsItem. + */ public static final Get3ItemsItem GROUP_LIFECYCLE_POLICIES = fromString("groupLifecyclePolicies"); - /** Static value planner for Get3ItemsItem. */ + /** + * Static value planner for Get3ItemsItem. + */ public static final Get3ItemsItem PLANNER = fromString("planner"); - /** Static value onenote for Get3ItemsItem. */ + /** + * Static value onenote for Get3ItemsItem. + */ public static final Get3ItemsItem ONENOTE = fromString("onenote"); - /** Static value team for Get3ItemsItem. */ + /** + * Static value team for Get3ItemsItem. + */ public static final Get3ItemsItem TEAM = fromString("team"); - /** Static value createdObjects for Get3ItemsItem. */ + /** + * Static value createdObjects for Get3ItemsItem. + */ public static final Get3ItemsItem CREATED_OBJECTS = fromString("createdObjects"); - /** Static value directReports for Get3ItemsItem. */ + /** + * Static value directReports for Get3ItemsItem. + */ public static final Get3ItemsItem DIRECT_REPORTS = fromString("directReports"); - /** Static value licenseDetails for Get3ItemsItem. */ + /** + * Static value licenseDetails for Get3ItemsItem. + */ public static final Get3ItemsItem LICENSE_DETAILS = fromString("licenseDetails"); - /** Static value manager for Get3ItemsItem. */ + /** + * Static value manager for Get3ItemsItem. + */ public static final Get3ItemsItem MANAGER = fromString("manager"); - /** Static value oauth2PermissionGrants for Get3ItemsItem. */ + /** + * Static value oauth2PermissionGrants for Get3ItemsItem. + */ public static final Get3ItemsItem OAUTH2PERMISSION_GRANTS = fromString("oauth2PermissionGrants"); - /** Static value ownedDevices for Get3ItemsItem. */ + /** + * Static value ownedDevices for Get3ItemsItem. + */ public static final Get3ItemsItem OWNED_DEVICES = fromString("ownedDevices"); - /** Static value ownedObjects for Get3ItemsItem. */ + /** + * Static value ownedObjects for Get3ItemsItem. + */ public static final Get3ItemsItem OWNED_OBJECTS = fromString("ownedObjects"); - /** Static value registeredDevices for Get3ItemsItem. */ + /** + * Static value registeredDevices for Get3ItemsItem. + */ public static final Get3ItemsItem REGISTERED_DEVICES = fromString("registeredDevices"); - /** Static value scopedRoleMemberOf for Get3ItemsItem. */ + /** + * Static value scopedRoleMemberOf for Get3ItemsItem. + */ public static final Get3ItemsItem SCOPED_ROLE_MEMBER_OF = fromString("scopedRoleMemberOf"); - /** Static value calendarGroups for Get3ItemsItem. */ + /** + * Static value calendarGroups for Get3ItemsItem. + */ public static final Get3ItemsItem CALENDAR_GROUPS = fromString("calendarGroups"); - /** Static value calendars for Get3ItemsItem. */ + /** + * Static value calendars for Get3ItemsItem. + */ public static final Get3ItemsItem CALENDARS = fromString("calendars"); - /** Static value contactFolders for Get3ItemsItem. */ + /** + * Static value contactFolders for Get3ItemsItem. + */ public static final Get3ItemsItem CONTACT_FOLDERS = fromString("contactFolders"); - /** Static value contacts for Get3ItemsItem. */ + /** + * Static value contacts for Get3ItemsItem. + */ public static final Get3ItemsItem CONTACTS = fromString("contacts"); - /** Static value inferenceClassification for Get3ItemsItem. */ + /** + * Static value inferenceClassification for Get3ItemsItem. + */ public static final Get3ItemsItem INFERENCE_CLASSIFICATION = fromString("inferenceClassification"); - /** Static value mailFolders for Get3ItemsItem. */ + /** + * Static value mailFolders for Get3ItemsItem. + */ public static final Get3ItemsItem MAIL_FOLDERS = fromString("mailFolders"); - /** Static value messages for Get3ItemsItem. */ + /** + * Static value messages for Get3ItemsItem. + */ public static final Get3ItemsItem MESSAGES = fromString("messages"); - /** Static value outlook for Get3ItemsItem. */ + /** + * Static value outlook for Get3ItemsItem. + */ public static final Get3ItemsItem OUTLOOK = fromString("outlook"); - /** Static value people for Get3ItemsItem. */ + /** + * Static value people for Get3ItemsItem. + */ public static final Get3ItemsItem PEOPLE = fromString("people"); - /** Static value followedSites for Get3ItemsItem. */ + /** + * Static value followedSites for Get3ItemsItem. + */ public static final Get3ItemsItem FOLLOWED_SITES = fromString("followedSites"); - /** Static value managedDevices for Get3ItemsItem. */ + /** + * Static value managedDevices for Get3ItemsItem. + */ public static final Get3ItemsItem MANAGED_DEVICES = fromString("managedDevices"); - /** Static value managedAppRegistrations for Get3ItemsItem. */ + /** + * Static value managedAppRegistrations for Get3ItemsItem. + */ public static final Get3ItemsItem MANAGED_APP_REGISTRATIONS = fromString("managedAppRegistrations"); - /** Static value deviceManagementTroubleshootingEvents for Get3ItemsItem. */ - public static final Get3ItemsItem DEVICE_MANAGEMENT_TROUBLESHOOTING_EVENTS = - fromString("deviceManagementTroubleshootingEvents"); + /** + * Static value deviceManagementTroubleshootingEvents for Get3ItemsItem. + */ + public static final Get3ItemsItem DEVICE_MANAGEMENT_TROUBLESHOOTING_EVENTS + = fromString("deviceManagementTroubleshootingEvents"); - /** Static value insights for Get3ItemsItem. */ + /** + * Static value insights for Get3ItemsItem. + */ public static final Get3ItemsItem INSIGHTS = fromString("insights"); - /** Static value activities for Get3ItemsItem. */ + /** + * Static value activities for Get3ItemsItem. + */ public static final Get3ItemsItem ACTIVITIES = fromString("activities"); - /** Static value onlineMeetings for Get3ItemsItem. */ + /** + * Static value onlineMeetings for Get3ItemsItem. + */ public static final Get3ItemsItem ONLINE_MEETINGS = fromString("onlineMeetings"); - /** Static value presence for Get3ItemsItem. */ + /** + * Static value presence for Get3ItemsItem. + */ public static final Get3ItemsItem PRESENCE = fromString("presence"); - /** Static value joinedTeams for Get3ItemsItem. */ + /** + * Static value joinedTeams for Get3ItemsItem. + */ public static final Get3ItemsItem JOINED_TEAMS = fromString("joinedTeams"); - /** Static value teamwork for Get3ItemsItem. */ + /** + * Static value teamwork for Get3ItemsItem. + */ public static final Get3ItemsItem TEAMWORK = fromString("teamwork"); - /** Static value todo for Get3ItemsItem. */ + /** + * Static value todo for Get3ItemsItem. + */ public static final Get3ItemsItem TODO = fromString("todo"); /** * Creates a new instance of Get3ItemsItem value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -205,18 +328,17 @@ public Get3ItemsItem() { /** * Creates or finds a Get3ItemsItem from its string representation. - * + * * @param name a name to look for. * @return the corresponding Get3ItemsItem. */ - @JsonCreator public static Get3ItemsItem fromString(String name) { return fromString(name, Get3ItemsItem.class); } /** * Gets known Get3ItemsItem values. - * + * * @return known Get3ItemsItem values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get5ItemsItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get5ItemsItem.java index 5cb4ff019e85f..4619991cc238e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get5ItemsItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get5ItemsItem.java @@ -5,101 +5,158 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Get5ItemsItem. */ +/** + * Defines values for Get5ItemsItem. + */ public final class Get5ItemsItem extends ExpandableStringEnum { - /** Static value id for Get5ItemsItem. */ + /** + * Static value id for Get5ItemsItem. + */ public static final Get5ItemsItem ID = fromString("id"); - /** Static value id desc for Get5ItemsItem. */ + /** + * Static value id desc for Get5ItemsItem. + */ public static final Get5ItemsItem ID_DESC = fromString("id desc"); - /** Static value authenticationType for Get5ItemsItem. */ + /** + * Static value authenticationType for Get5ItemsItem. + */ public static final Get5ItemsItem AUTHENTICATION_TYPE = fromString("authenticationType"); - /** Static value authenticationType desc for Get5ItemsItem. */ + /** + * Static value authenticationType desc for Get5ItemsItem. + */ public static final Get5ItemsItem AUTHENTICATION_TYPE_DESC = fromString("authenticationType desc"); - /** Static value availabilityStatus for Get5ItemsItem. */ + /** + * Static value availabilityStatus for Get5ItemsItem. + */ public static final Get5ItemsItem AVAILABILITY_STATUS = fromString("availabilityStatus"); - /** Static value availabilityStatus desc for Get5ItemsItem. */ + /** + * Static value availabilityStatus desc for Get5ItemsItem. + */ public static final Get5ItemsItem AVAILABILITY_STATUS_DESC = fromString("availabilityStatus desc"); - /** Static value isAdminManaged for Get5ItemsItem. */ + /** + * Static value isAdminManaged for Get5ItemsItem. + */ public static final Get5ItemsItem IS_ADMIN_MANAGED = fromString("isAdminManaged"); - /** Static value isAdminManaged desc for Get5ItemsItem. */ + /** + * Static value isAdminManaged desc for Get5ItemsItem. + */ public static final Get5ItemsItem IS_ADMIN_MANAGED_DESC = fromString("isAdminManaged desc"); - /** Static value isDefault for Get5ItemsItem. */ + /** + * Static value isDefault for Get5ItemsItem. + */ public static final Get5ItemsItem IS_DEFAULT = fromString("isDefault"); - /** Static value isDefault desc for Get5ItemsItem. */ + /** + * Static value isDefault desc for Get5ItemsItem. + */ public static final Get5ItemsItem IS_DEFAULT_DESC = fromString("isDefault desc"); - /** Static value isInitial for Get5ItemsItem. */ + /** + * Static value isInitial for Get5ItemsItem. + */ public static final Get5ItemsItem IS_INITIAL = fromString("isInitial"); - /** Static value isInitial desc for Get5ItemsItem. */ + /** + * Static value isInitial desc for Get5ItemsItem. + */ public static final Get5ItemsItem IS_INITIAL_DESC = fromString("isInitial desc"); - /** Static value isRoot for Get5ItemsItem. */ + /** + * Static value isRoot for Get5ItemsItem. + */ public static final Get5ItemsItem IS_ROOT = fromString("isRoot"); - /** Static value isRoot desc for Get5ItemsItem. */ + /** + * Static value isRoot desc for Get5ItemsItem. + */ public static final Get5ItemsItem IS_ROOT_DESC = fromString("isRoot desc"); - /** Static value isVerified for Get5ItemsItem. */ + /** + * Static value isVerified for Get5ItemsItem. + */ public static final Get5ItemsItem IS_VERIFIED = fromString("isVerified"); - /** Static value isVerified desc for Get5ItemsItem. */ + /** + * Static value isVerified desc for Get5ItemsItem. + */ public static final Get5ItemsItem IS_VERIFIED_DESC = fromString("isVerified desc"); - /** Static value manufacturer for Get5ItemsItem. */ + /** + * Static value manufacturer for Get5ItemsItem. + */ public static final Get5ItemsItem MANUFACTURER = fromString("manufacturer"); - /** Static value manufacturer desc for Get5ItemsItem. */ + /** + * Static value manufacturer desc for Get5ItemsItem. + */ public static final Get5ItemsItem MANUFACTURER_DESC = fromString("manufacturer desc"); - /** Static value model for Get5ItemsItem. */ + /** + * Static value model for Get5ItemsItem. + */ public static final Get5ItemsItem MODEL = fromString("model"); - /** Static value model desc for Get5ItemsItem. */ + /** + * Static value model desc for Get5ItemsItem. + */ public static final Get5ItemsItem MODEL_DESC = fromString("model desc"); - /** Static value passwordNotificationWindowInDays for Get5ItemsItem. */ - public static final Get5ItemsItem PASSWORD_NOTIFICATION_WINDOW_IN_DAYS = - fromString("passwordNotificationWindowInDays"); + /** + * Static value passwordNotificationWindowInDays for Get5ItemsItem. + */ + public static final Get5ItemsItem PASSWORD_NOTIFICATION_WINDOW_IN_DAYS + = fromString("passwordNotificationWindowInDays"); - /** Static value passwordNotificationWindowInDays desc for Get5ItemsItem. */ - public static final Get5ItemsItem PASSWORD_NOTIFICATION_WINDOW_IN_DAYS_DESC = - fromString("passwordNotificationWindowInDays desc"); + /** + * Static value passwordNotificationWindowInDays desc for Get5ItemsItem. + */ + public static final Get5ItemsItem PASSWORD_NOTIFICATION_WINDOW_IN_DAYS_DESC + = fromString("passwordNotificationWindowInDays desc"); - /** Static value passwordValidityPeriodInDays for Get5ItemsItem. */ + /** + * Static value passwordValidityPeriodInDays for Get5ItemsItem. + */ public static final Get5ItemsItem PASSWORD_VALIDITY_PERIOD_IN_DAYS = fromString("passwordValidityPeriodInDays"); - /** Static value passwordValidityPeriodInDays desc for Get5ItemsItem. */ - public static final Get5ItemsItem PASSWORD_VALIDITY_PERIOD_IN_DAYS_DESC = - fromString("passwordValidityPeriodInDays desc"); + /** + * Static value passwordValidityPeriodInDays desc for Get5ItemsItem. + */ + public static final Get5ItemsItem PASSWORD_VALIDITY_PERIOD_IN_DAYS_DESC + = fromString("passwordValidityPeriodInDays desc"); - /** Static value state for Get5ItemsItem. */ + /** + * Static value state for Get5ItemsItem. + */ public static final Get5ItemsItem STATE = fromString("state"); - /** Static value state desc for Get5ItemsItem. */ + /** + * Static value state desc for Get5ItemsItem. + */ public static final Get5ItemsItem STATE_DESC = fromString("state desc"); - /** Static value supportedServices for Get5ItemsItem. */ + /** + * Static value supportedServices for Get5ItemsItem. + */ public static final Get5ItemsItem SUPPORTED_SERVICES = fromString("supportedServices"); - /** Static value supportedServices desc for Get5ItemsItem. */ + /** + * Static value supportedServices desc for Get5ItemsItem. + */ public static final Get5ItemsItem SUPPORTED_SERVICES_DESC = fromString("supportedServices desc"); /** * Creates a new instance of Get5ItemsItem value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -108,18 +165,17 @@ public Get5ItemsItem() { /** * Creates or finds a Get5ItemsItem from its string representation. - * + * * @param name a name to look for. * @return the corresponding Get5ItemsItem. */ - @JsonCreator public static Get5ItemsItem fromString(String name) { return fromString(name, Get5ItemsItem.class); } /** * Gets known Get5ItemsItem values. - * + * * @return known Get5ItemsItem values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get6ItemsItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get6ItemsItem.java index b097312d141f0..09bc87b098d3c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get6ItemsItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get6ItemsItem.java @@ -5,788 +5,1295 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Get6ItemsItem. */ +/** + * Defines values for Get6ItemsItem. + */ public final class Get6ItemsItem extends ExpandableStringEnum { - /** Static value id for Get6ItemsItem. */ + /** + * Static value id for Get6ItemsItem. + */ public static final Get6ItemsItem ID = fromString("id"); - /** Static value id desc for Get6ItemsItem. */ + /** + * Static value id desc for Get6ItemsItem. + */ public static final Get6ItemsItem ID_DESC = fromString("id desc"); - /** Static value deletedDateTime for Get6ItemsItem. */ + /** + * Static value deletedDateTime for Get6ItemsItem. + */ public static final Get6ItemsItem DELETED_DATE_TIME = fromString("deletedDateTime"); - /** Static value deletedDateTime desc for Get6ItemsItem. */ + /** + * Static value deletedDateTime desc for Get6ItemsItem. + */ public static final Get6ItemsItem DELETED_DATE_TIME_DESC = fromString("deletedDateTime desc"); - /** Static value addIns for Get6ItemsItem. */ + /** + * Static value addIns for Get6ItemsItem. + */ public static final Get6ItemsItem ADD_INS = fromString("addIns"); - /** Static value addIns desc for Get6ItemsItem. */ + /** + * Static value addIns desc for Get6ItemsItem. + */ public static final Get6ItemsItem ADD_INS_DESC = fromString("addIns desc"); - /** Static value api for Get6ItemsItem. */ + /** + * Static value api for Get6ItemsItem. + */ public static final Get6ItemsItem API = fromString("api"); - /** Static value api desc for Get6ItemsItem. */ + /** + * Static value api desc for Get6ItemsItem. + */ public static final Get6ItemsItem API_DESC = fromString("api desc"); - /** Static value appId for Get6ItemsItem. */ + /** + * Static value appId for Get6ItemsItem. + */ public static final Get6ItemsItem APP_ID = fromString("appId"); - /** Static value appId desc for Get6ItemsItem. */ + /** + * Static value appId desc for Get6ItemsItem. + */ public static final Get6ItemsItem APP_ID_DESC = fromString("appId desc"); - /** Static value applicationTemplateId for Get6ItemsItem. */ + /** + * Static value applicationTemplateId for Get6ItemsItem. + */ public static final Get6ItemsItem APPLICATION_TEMPLATE_ID = fromString("applicationTemplateId"); - /** Static value applicationTemplateId desc for Get6ItemsItem. */ + /** + * Static value applicationTemplateId desc for Get6ItemsItem. + */ public static final Get6ItemsItem APPLICATION_TEMPLATE_ID_DESC = fromString("applicationTemplateId desc"); - /** Static value appRoles for Get6ItemsItem. */ + /** + * Static value appRoles for Get6ItemsItem. + */ public static final Get6ItemsItem APP_ROLES = fromString("appRoles"); - /** Static value appRoles desc for Get6ItemsItem. */ + /** + * Static value appRoles desc for Get6ItemsItem. + */ public static final Get6ItemsItem APP_ROLES_DESC = fromString("appRoles desc"); - /** Static value createdDateTime for Get6ItemsItem. */ + /** + * Static value createdDateTime for Get6ItemsItem. + */ public static final Get6ItemsItem CREATED_DATE_TIME = fromString("createdDateTime"); - /** Static value createdDateTime desc for Get6ItemsItem. */ + /** + * Static value createdDateTime desc for Get6ItemsItem. + */ public static final Get6ItemsItem CREATED_DATE_TIME_DESC = fromString("createdDateTime desc"); - /** Static value description for Get6ItemsItem. */ + /** + * Static value description for Get6ItemsItem. + */ public static final Get6ItemsItem DESCRIPTION = fromString("description"); - /** Static value description desc for Get6ItemsItem. */ + /** + * Static value description desc for Get6ItemsItem. + */ public static final Get6ItemsItem DESCRIPTION_DESC = fromString("description desc"); - /** Static value displayName for Get6ItemsItem. */ + /** + * Static value displayName for Get6ItemsItem. + */ public static final Get6ItemsItem DISPLAY_NAME = fromString("displayName"); - /** Static value displayName desc for Get6ItemsItem. */ + /** + * Static value displayName desc for Get6ItemsItem. + */ public static final Get6ItemsItem DISPLAY_NAME_DESC = fromString("displayName desc"); - /** Static value groupMembershipClaims for Get6ItemsItem. */ + /** + * Static value groupMembershipClaims for Get6ItemsItem. + */ public static final Get6ItemsItem GROUP_MEMBERSHIP_CLAIMS = fromString("groupMembershipClaims"); - /** Static value groupMembershipClaims desc for Get6ItemsItem. */ + /** + * Static value groupMembershipClaims desc for Get6ItemsItem. + */ public static final Get6ItemsItem GROUP_MEMBERSHIP_CLAIMS_DESC = fromString("groupMembershipClaims desc"); - /** Static value identifierUris for Get6ItemsItem. */ + /** + * Static value identifierUris for Get6ItemsItem. + */ public static final Get6ItemsItem IDENTIFIER_URIS = fromString("identifierUris"); - /** Static value identifierUris desc for Get6ItemsItem. */ + /** + * Static value identifierUris desc for Get6ItemsItem. + */ public static final Get6ItemsItem IDENTIFIER_URIS_DESC = fromString("identifierUris desc"); - /** Static value info for Get6ItemsItem. */ + /** + * Static value info for Get6ItemsItem. + */ public static final Get6ItemsItem INFO = fromString("info"); - /** Static value info desc for Get6ItemsItem. */ + /** + * Static value info desc for Get6ItemsItem. + */ public static final Get6ItemsItem INFO_DESC = fromString("info desc"); - /** Static value isDeviceOnlyAuthSupported for Get6ItemsItem. */ + /** + * Static value isDeviceOnlyAuthSupported for Get6ItemsItem. + */ public static final Get6ItemsItem IS_DEVICE_ONLY_AUTH_SUPPORTED = fromString("isDeviceOnlyAuthSupported"); - /** Static value isDeviceOnlyAuthSupported desc for Get6ItemsItem. */ + /** + * Static value isDeviceOnlyAuthSupported desc for Get6ItemsItem. + */ public static final Get6ItemsItem IS_DEVICE_ONLY_AUTH_SUPPORTED_DESC = fromString("isDeviceOnlyAuthSupported desc"); - /** Static value isFallbackPublicClient for Get6ItemsItem. */ + /** + * Static value isFallbackPublicClient for Get6ItemsItem. + */ public static final Get6ItemsItem IS_FALLBACK_PUBLIC_CLIENT = fromString("isFallbackPublicClient"); - /** Static value isFallbackPublicClient desc for Get6ItemsItem. */ + /** + * Static value isFallbackPublicClient desc for Get6ItemsItem. + */ public static final Get6ItemsItem IS_FALLBACK_PUBLIC_CLIENT_DESC = fromString("isFallbackPublicClient desc"); - /** Static value keyCredentials for Get6ItemsItem. */ + /** + * Static value keyCredentials for Get6ItemsItem. + */ public static final Get6ItemsItem KEY_CREDENTIALS = fromString("keyCredentials"); - /** Static value keyCredentials desc for Get6ItemsItem. */ + /** + * Static value keyCredentials desc for Get6ItemsItem. + */ public static final Get6ItemsItem KEY_CREDENTIALS_DESC = fromString("keyCredentials desc"); - /** Static value logo for Get6ItemsItem. */ + /** + * Static value logo for Get6ItemsItem. + */ public static final Get6ItemsItem LOGO = fromString("logo"); - /** Static value logo desc for Get6ItemsItem. */ + /** + * Static value logo desc for Get6ItemsItem. + */ public static final Get6ItemsItem LOGO_DESC = fromString("logo desc"); - /** Static value notes for Get6ItemsItem. */ + /** + * Static value notes for Get6ItemsItem. + */ public static final Get6ItemsItem NOTES = fromString("notes"); - /** Static value notes desc for Get6ItemsItem. */ + /** + * Static value notes desc for Get6ItemsItem. + */ public static final Get6ItemsItem NOTES_DESC = fromString("notes desc"); - /** Static value oauth2RequirePostResponse for Get6ItemsItem. */ + /** + * Static value oauth2RequirePostResponse for Get6ItemsItem. + */ public static final Get6ItemsItem OAUTH2REQUIRE_POST_RESPONSE = fromString("oauth2RequirePostResponse"); - /** Static value oauth2RequirePostResponse desc for Get6ItemsItem. */ + /** + * Static value oauth2RequirePostResponse desc for Get6ItemsItem. + */ public static final Get6ItemsItem OAUTH2REQUIRE_POST_RESPONSE_DESC = fromString("oauth2RequirePostResponse desc"); - /** Static value optionalClaims for Get6ItemsItem. */ + /** + * Static value optionalClaims for Get6ItemsItem. + */ public static final Get6ItemsItem OPTIONAL_CLAIMS = fromString("optionalClaims"); - /** Static value optionalClaims desc for Get6ItemsItem. */ + /** + * Static value optionalClaims desc for Get6ItemsItem. + */ public static final Get6ItemsItem OPTIONAL_CLAIMS_DESC = fromString("optionalClaims desc"); - /** Static value parentalControlSettings for Get6ItemsItem. */ + /** + * Static value parentalControlSettings for Get6ItemsItem. + */ public static final Get6ItemsItem PARENTAL_CONTROL_SETTINGS = fromString("parentalControlSettings"); - /** Static value parentalControlSettings desc for Get6ItemsItem. */ + /** + * Static value parentalControlSettings desc for Get6ItemsItem. + */ public static final Get6ItemsItem PARENTAL_CONTROL_SETTINGS_DESC = fromString("parentalControlSettings desc"); - /** Static value passwordCredentials for Get6ItemsItem. */ + /** + * Static value passwordCredentials for Get6ItemsItem. + */ public static final Get6ItemsItem PASSWORD_CREDENTIALS = fromString("passwordCredentials"); - /** Static value passwordCredentials desc for Get6ItemsItem. */ + /** + * Static value passwordCredentials desc for Get6ItemsItem. + */ public static final Get6ItemsItem PASSWORD_CREDENTIALS_DESC = fromString("passwordCredentials desc"); - /** Static value publicClient for Get6ItemsItem. */ + /** + * Static value publicClient for Get6ItemsItem. + */ public static final Get6ItemsItem PUBLIC_CLIENT = fromString("publicClient"); - /** Static value publicClient desc for Get6ItemsItem. */ + /** + * Static value publicClient desc for Get6ItemsItem. + */ public static final Get6ItemsItem PUBLIC_CLIENT_DESC = fromString("publicClient desc"); - /** Static value publisherDomain for Get6ItemsItem. */ + /** + * Static value publisherDomain for Get6ItemsItem. + */ public static final Get6ItemsItem PUBLISHER_DOMAIN = fromString("publisherDomain"); - /** Static value publisherDomain desc for Get6ItemsItem. */ + /** + * Static value publisherDomain desc for Get6ItemsItem. + */ public static final Get6ItemsItem PUBLISHER_DOMAIN_DESC = fromString("publisherDomain desc"); - /** Static value requiredResourceAccess for Get6ItemsItem. */ + /** + * Static value requiredResourceAccess for Get6ItemsItem. + */ public static final Get6ItemsItem REQUIRED_RESOURCE_ACCESS = fromString("requiredResourceAccess"); - /** Static value requiredResourceAccess desc for Get6ItemsItem. */ + /** + * Static value requiredResourceAccess desc for Get6ItemsItem. + */ public static final Get6ItemsItem REQUIRED_RESOURCE_ACCESS_DESC = fromString("requiredResourceAccess desc"); - /** Static value signInAudience for Get6ItemsItem. */ + /** + * Static value signInAudience for Get6ItemsItem. + */ public static final Get6ItemsItem SIGN_IN_AUDIENCE = fromString("signInAudience"); - /** Static value signInAudience desc for Get6ItemsItem. */ + /** + * Static value signInAudience desc for Get6ItemsItem. + */ public static final Get6ItemsItem SIGN_IN_AUDIENCE_DESC = fromString("signInAudience desc"); - /** Static value tags for Get6ItemsItem. */ + /** + * Static value tags for Get6ItemsItem. + */ public static final Get6ItemsItem TAGS = fromString("tags"); - /** Static value tags desc for Get6ItemsItem. */ + /** + * Static value tags desc for Get6ItemsItem. + */ public static final Get6ItemsItem TAGS_DESC = fromString("tags desc"); - /** Static value tokenEncryptionKeyId for Get6ItemsItem. */ + /** + * Static value tokenEncryptionKeyId for Get6ItemsItem. + */ public static final Get6ItemsItem TOKEN_ENCRYPTION_KEY_ID = fromString("tokenEncryptionKeyId"); - /** Static value tokenEncryptionKeyId desc for Get6ItemsItem. */ + /** + * Static value tokenEncryptionKeyId desc for Get6ItemsItem. + */ public static final Get6ItemsItem TOKEN_ENCRYPTION_KEY_ID_DESC = fromString("tokenEncryptionKeyId desc"); - /** Static value web for Get6ItemsItem. */ + /** + * Static value web for Get6ItemsItem. + */ public static final Get6ItemsItem WEB = fromString("web"); - /** Static value web desc for Get6ItemsItem. */ + /** + * Static value web desc for Get6ItemsItem. + */ public static final Get6ItemsItem WEB_DESC = fromString("web desc"); - /** Static value assignedLabels for Get6ItemsItem. */ + /** + * Static value assignedLabels for Get6ItemsItem. + */ public static final Get6ItemsItem ASSIGNED_LABELS = fromString("assignedLabels"); - /** Static value assignedLabels desc for Get6ItemsItem. */ + /** + * Static value assignedLabels desc for Get6ItemsItem. + */ public static final Get6ItemsItem ASSIGNED_LABELS_DESC = fromString("assignedLabels desc"); - /** Static value assignedLicenses for Get6ItemsItem. */ + /** + * Static value assignedLicenses for Get6ItemsItem. + */ public static final Get6ItemsItem ASSIGNED_LICENSES = fromString("assignedLicenses"); - /** Static value assignedLicenses desc for Get6ItemsItem. */ + /** + * Static value assignedLicenses desc for Get6ItemsItem. + */ public static final Get6ItemsItem ASSIGNED_LICENSES_DESC = fromString("assignedLicenses desc"); - /** Static value classification for Get6ItemsItem. */ + /** + * Static value classification for Get6ItemsItem. + */ public static final Get6ItemsItem CLASSIFICATION = fromString("classification"); - /** Static value classification desc for Get6ItemsItem. */ + /** + * Static value classification desc for Get6ItemsItem. + */ public static final Get6ItemsItem CLASSIFICATION_DESC = fromString("classification desc"); - /** Static value expirationDateTime for Get6ItemsItem. */ + /** + * Static value expirationDateTime for Get6ItemsItem. + */ public static final Get6ItemsItem EXPIRATION_DATE_TIME = fromString("expirationDateTime"); - /** Static value expirationDateTime desc for Get6ItemsItem. */ + /** + * Static value expirationDateTime desc for Get6ItemsItem. + */ public static final Get6ItemsItem EXPIRATION_DATE_TIME_DESC = fromString("expirationDateTime desc"); - /** Static value groupTypes for Get6ItemsItem. */ + /** + * Static value groupTypes for Get6ItemsItem. + */ public static final Get6ItemsItem GROUP_TYPES = fromString("groupTypes"); - /** Static value groupTypes desc for Get6ItemsItem. */ + /** + * Static value groupTypes desc for Get6ItemsItem. + */ public static final Get6ItemsItem GROUP_TYPES_DESC = fromString("groupTypes desc"); - /** Static value hasMembersWithLicenseErrors for Get6ItemsItem. */ + /** + * Static value hasMembersWithLicenseErrors for Get6ItemsItem. + */ public static final Get6ItemsItem HAS_MEMBERS_WITH_LICENSE_ERRORS = fromString("hasMembersWithLicenseErrors"); - /** Static value hasMembersWithLicenseErrors desc for Get6ItemsItem. */ - public static final Get6ItemsItem HAS_MEMBERS_WITH_LICENSE_ERRORS_DESC = - fromString("hasMembersWithLicenseErrors desc"); + /** + * Static value hasMembersWithLicenseErrors desc for Get6ItemsItem. + */ + public static final Get6ItemsItem HAS_MEMBERS_WITH_LICENSE_ERRORS_DESC + = fromString("hasMembersWithLicenseErrors desc"); - /** Static value licenseProcessingState for Get6ItemsItem. */ + /** + * Static value licenseProcessingState for Get6ItemsItem. + */ public static final Get6ItemsItem LICENSE_PROCESSING_STATE = fromString("licenseProcessingState"); - /** Static value licenseProcessingState desc for Get6ItemsItem. */ + /** + * Static value licenseProcessingState desc for Get6ItemsItem. + */ public static final Get6ItemsItem LICENSE_PROCESSING_STATE_DESC = fromString("licenseProcessingState desc"); - /** Static value mail for Get6ItemsItem. */ + /** + * Static value mail for Get6ItemsItem. + */ public static final Get6ItemsItem MAIL = fromString("mail"); - /** Static value mail desc for Get6ItemsItem. */ + /** + * Static value mail desc for Get6ItemsItem. + */ public static final Get6ItemsItem MAIL_DESC = fromString("mail desc"); - /** Static value mailEnabled for Get6ItemsItem. */ + /** + * Static value mailEnabled for Get6ItemsItem. + */ public static final Get6ItemsItem MAIL_ENABLED = fromString("mailEnabled"); - /** Static value mailEnabled desc for Get6ItemsItem. */ + /** + * Static value mailEnabled desc for Get6ItemsItem. + */ public static final Get6ItemsItem MAIL_ENABLED_DESC = fromString("mailEnabled desc"); - /** Static value mailNickname for Get6ItemsItem. */ + /** + * Static value mailNickname for Get6ItemsItem. + */ public static final Get6ItemsItem MAIL_NICKNAME = fromString("mailNickname"); - /** Static value mailNickname desc for Get6ItemsItem. */ + /** + * Static value mailNickname desc for Get6ItemsItem. + */ public static final Get6ItemsItem MAIL_NICKNAME_DESC = fromString("mailNickname desc"); - /** Static value membershipRule for Get6ItemsItem. */ + /** + * Static value membershipRule for Get6ItemsItem. + */ public static final Get6ItemsItem MEMBERSHIP_RULE = fromString("membershipRule"); - /** Static value membershipRule desc for Get6ItemsItem. */ + /** + * Static value membershipRule desc for Get6ItemsItem. + */ public static final Get6ItemsItem MEMBERSHIP_RULE_DESC = fromString("membershipRule desc"); - /** Static value membershipRuleProcessingState for Get6ItemsItem. */ + /** + * Static value membershipRuleProcessingState for Get6ItemsItem. + */ public static final Get6ItemsItem MEMBERSHIP_RULE_PROCESSING_STATE = fromString("membershipRuleProcessingState"); - /** Static value membershipRuleProcessingState desc for Get6ItemsItem. */ - public static final Get6ItemsItem MEMBERSHIP_RULE_PROCESSING_STATE_DESC = - fromString("membershipRuleProcessingState desc"); + /** + * Static value membershipRuleProcessingState desc for Get6ItemsItem. + */ + public static final Get6ItemsItem MEMBERSHIP_RULE_PROCESSING_STATE_DESC + = fromString("membershipRuleProcessingState desc"); - /** Static value onPremisesDomainName for Get6ItemsItem. */ + /** + * Static value onPremisesDomainName for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_DOMAIN_NAME = fromString("onPremisesDomainName"); - /** Static value onPremisesDomainName desc for Get6ItemsItem. */ + /** + * Static value onPremisesDomainName desc for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_DOMAIN_NAME_DESC = fromString("onPremisesDomainName desc"); - /** Static value onPremisesLastSyncDateTime for Get6ItemsItem. */ + /** + * Static value onPremisesLastSyncDateTime for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_LAST_SYNC_DATE_TIME = fromString("onPremisesLastSyncDateTime"); - /** Static value onPremisesLastSyncDateTime desc for Get6ItemsItem. */ - public static final Get6ItemsItem ON_PREMISES_LAST_SYNC_DATE_TIME_DESC = - fromString("onPremisesLastSyncDateTime desc"); + /** + * Static value onPremisesLastSyncDateTime desc for Get6ItemsItem. + */ + public static final Get6ItemsItem ON_PREMISES_LAST_SYNC_DATE_TIME_DESC + = fromString("onPremisesLastSyncDateTime desc"); - /** Static value onPremisesNetBiosName for Get6ItemsItem. */ + /** + * Static value onPremisesNetBiosName for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_NET_BIOS_NAME = fromString("onPremisesNetBiosName"); - /** Static value onPremisesNetBiosName desc for Get6ItemsItem. */ + /** + * Static value onPremisesNetBiosName desc for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_NET_BIOS_NAME_DESC = fromString("onPremisesNetBiosName desc"); - /** Static value onPremisesProvisioningErrors for Get6ItemsItem. */ + /** + * Static value onPremisesProvisioningErrors for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_PROVISIONING_ERRORS = fromString("onPremisesProvisioningErrors"); - /** Static value onPremisesProvisioningErrors desc for Get6ItemsItem. */ - public static final Get6ItemsItem ON_PREMISES_PROVISIONING_ERRORS_DESC = - fromString("onPremisesProvisioningErrors desc"); + /** + * Static value onPremisesProvisioningErrors desc for Get6ItemsItem. + */ + public static final Get6ItemsItem ON_PREMISES_PROVISIONING_ERRORS_DESC + = fromString("onPremisesProvisioningErrors desc"); - /** Static value onPremisesSamAccountName for Get6ItemsItem. */ + /** + * Static value onPremisesSamAccountName for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_SAM_ACCOUNT_NAME = fromString("onPremisesSamAccountName"); - /** Static value onPremisesSamAccountName desc for Get6ItemsItem. */ + /** + * Static value onPremisesSamAccountName desc for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_SAM_ACCOUNT_NAME_DESC = fromString("onPremisesSamAccountName desc"); - /** Static value onPremisesSecurityIdentifier for Get6ItemsItem. */ + /** + * Static value onPremisesSecurityIdentifier for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_SECURITY_IDENTIFIER = fromString("onPremisesSecurityIdentifier"); - /** Static value onPremisesSecurityIdentifier desc for Get6ItemsItem. */ - public static final Get6ItemsItem ON_PREMISES_SECURITY_IDENTIFIER_DESC = - fromString("onPremisesSecurityIdentifier desc"); + /** + * Static value onPremisesSecurityIdentifier desc for Get6ItemsItem. + */ + public static final Get6ItemsItem ON_PREMISES_SECURITY_IDENTIFIER_DESC + = fromString("onPremisesSecurityIdentifier desc"); - /** Static value onPremisesSyncEnabled for Get6ItemsItem. */ + /** + * Static value onPremisesSyncEnabled for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_SYNC_ENABLED = fromString("onPremisesSyncEnabled"); - /** Static value onPremisesSyncEnabled desc for Get6ItemsItem. */ + /** + * Static value onPremisesSyncEnabled desc for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_SYNC_ENABLED_DESC = fromString("onPremisesSyncEnabled desc"); - /** Static value preferredDataLocation for Get6ItemsItem. */ + /** + * Static value preferredDataLocation for Get6ItemsItem. + */ public static final Get6ItemsItem PREFERRED_DATA_LOCATION = fromString("preferredDataLocation"); - /** Static value preferredDataLocation desc for Get6ItemsItem. */ + /** + * Static value preferredDataLocation desc for Get6ItemsItem. + */ public static final Get6ItemsItem PREFERRED_DATA_LOCATION_DESC = fromString("preferredDataLocation desc"); - /** Static value preferredLanguage for Get6ItemsItem. */ + /** + * Static value preferredLanguage for Get6ItemsItem. + */ public static final Get6ItemsItem PREFERRED_LANGUAGE = fromString("preferredLanguage"); - /** Static value preferredLanguage desc for Get6ItemsItem. */ + /** + * Static value preferredLanguage desc for Get6ItemsItem. + */ public static final Get6ItemsItem PREFERRED_LANGUAGE_DESC = fromString("preferredLanguage desc"); - /** Static value proxyAddresses for Get6ItemsItem. */ + /** + * Static value proxyAddresses for Get6ItemsItem. + */ public static final Get6ItemsItem PROXY_ADDRESSES = fromString("proxyAddresses"); - /** Static value proxyAddresses desc for Get6ItemsItem. */ + /** + * Static value proxyAddresses desc for Get6ItemsItem. + */ public static final Get6ItemsItem PROXY_ADDRESSES_DESC = fromString("proxyAddresses desc"); - /** Static value renewedDateTime for Get6ItemsItem. */ + /** + * Static value renewedDateTime for Get6ItemsItem. + */ public static final Get6ItemsItem RENEWED_DATE_TIME = fromString("renewedDateTime"); - /** Static value renewedDateTime desc for Get6ItemsItem. */ + /** + * Static value renewedDateTime desc for Get6ItemsItem. + */ public static final Get6ItemsItem RENEWED_DATE_TIME_DESC = fromString("renewedDateTime desc"); - /** Static value securityEnabled for Get6ItemsItem. */ + /** + * Static value securityEnabled for Get6ItemsItem. + */ public static final Get6ItemsItem SECURITY_ENABLED = fromString("securityEnabled"); - /** Static value securityEnabled desc for Get6ItemsItem. */ + /** + * Static value securityEnabled desc for Get6ItemsItem. + */ public static final Get6ItemsItem SECURITY_ENABLED_DESC = fromString("securityEnabled desc"); - /** Static value securityIdentifier for Get6ItemsItem. */ + /** + * Static value securityIdentifier for Get6ItemsItem. + */ public static final Get6ItemsItem SECURITY_IDENTIFIER = fromString("securityIdentifier"); - /** Static value securityIdentifier desc for Get6ItemsItem. */ + /** + * Static value securityIdentifier desc for Get6ItemsItem. + */ public static final Get6ItemsItem SECURITY_IDENTIFIER_DESC = fromString("securityIdentifier desc"); - /** Static value theme for Get6ItemsItem. */ + /** + * Static value theme for Get6ItemsItem. + */ public static final Get6ItemsItem THEME = fromString("theme"); - /** Static value theme desc for Get6ItemsItem. */ + /** + * Static value theme desc for Get6ItemsItem. + */ public static final Get6ItemsItem THEME_DESC = fromString("theme desc"); - /** Static value visibility for Get6ItemsItem. */ + /** + * Static value visibility for Get6ItemsItem. + */ public static final Get6ItemsItem VISIBILITY = fromString("visibility"); - /** Static value visibility desc for Get6ItemsItem. */ + /** + * Static value visibility desc for Get6ItemsItem. + */ public static final Get6ItemsItem VISIBILITY_DESC = fromString("visibility desc"); - /** Static value allowExternalSenders for Get6ItemsItem. */ + /** + * Static value allowExternalSenders for Get6ItemsItem. + */ public static final Get6ItemsItem ALLOW_EXTERNAL_SENDERS = fromString("allowExternalSenders"); - /** Static value allowExternalSenders desc for Get6ItemsItem. */ + /** + * Static value allowExternalSenders desc for Get6ItemsItem. + */ public static final Get6ItemsItem ALLOW_EXTERNAL_SENDERS_DESC = fromString("allowExternalSenders desc"); - /** Static value autoSubscribeNewMembers for Get6ItemsItem. */ + /** + * Static value autoSubscribeNewMembers for Get6ItemsItem. + */ public static final Get6ItemsItem AUTO_SUBSCRIBE_NEW_MEMBERS = fromString("autoSubscribeNewMembers"); - /** Static value autoSubscribeNewMembers desc for Get6ItemsItem. */ + /** + * Static value autoSubscribeNewMembers desc for Get6ItemsItem. + */ public static final Get6ItemsItem AUTO_SUBSCRIBE_NEW_MEMBERS_DESC = fromString("autoSubscribeNewMembers desc"); - /** Static value hideFromAddressLists for Get6ItemsItem. */ + /** + * Static value hideFromAddressLists for Get6ItemsItem. + */ public static final Get6ItemsItem HIDE_FROM_ADDRESS_LISTS = fromString("hideFromAddressLists"); - /** Static value hideFromAddressLists desc for Get6ItemsItem. */ + /** + * Static value hideFromAddressLists desc for Get6ItemsItem. + */ public static final Get6ItemsItem HIDE_FROM_ADDRESS_LISTS_DESC = fromString("hideFromAddressLists desc"); - /** Static value hideFromOutlookClients for Get6ItemsItem. */ + /** + * Static value hideFromOutlookClients for Get6ItemsItem. + */ public static final Get6ItemsItem HIDE_FROM_OUTLOOK_CLIENTS = fromString("hideFromOutlookClients"); - /** Static value hideFromOutlookClients desc for Get6ItemsItem. */ + /** + * Static value hideFromOutlookClients desc for Get6ItemsItem. + */ public static final Get6ItemsItem HIDE_FROM_OUTLOOK_CLIENTS_DESC = fromString("hideFromOutlookClients desc"); - /** Static value isSubscribedByMail for Get6ItemsItem. */ + /** + * Static value isSubscribedByMail for Get6ItemsItem. + */ public static final Get6ItemsItem IS_SUBSCRIBED_BY_MAIL = fromString("isSubscribedByMail"); - /** Static value isSubscribedByMail desc for Get6ItemsItem. */ + /** + * Static value isSubscribedByMail desc for Get6ItemsItem. + */ public static final Get6ItemsItem IS_SUBSCRIBED_BY_MAIL_DESC = fromString("isSubscribedByMail desc"); - /** Static value unseenCount for Get6ItemsItem. */ + /** + * Static value unseenCount for Get6ItemsItem. + */ public static final Get6ItemsItem UNSEEN_COUNT = fromString("unseenCount"); - /** Static value unseenCount desc for Get6ItemsItem. */ + /** + * Static value unseenCount desc for Get6ItemsItem. + */ public static final Get6ItemsItem UNSEEN_COUNT_DESC = fromString("unseenCount desc"); - /** Static value isArchived for Get6ItemsItem. */ + /** + * Static value isArchived for Get6ItemsItem. + */ public static final Get6ItemsItem IS_ARCHIVED = fromString("isArchived"); - /** Static value isArchived desc for Get6ItemsItem. */ + /** + * Static value isArchived desc for Get6ItemsItem. + */ public static final Get6ItemsItem IS_ARCHIVED_DESC = fromString("isArchived desc"); - /** Static value accountEnabled for Get6ItemsItem. */ + /** + * Static value accountEnabled for Get6ItemsItem. + */ public static final Get6ItemsItem ACCOUNT_ENABLED = fromString("accountEnabled"); - /** Static value accountEnabled desc for Get6ItemsItem. */ + /** + * Static value accountEnabled desc for Get6ItemsItem. + */ public static final Get6ItemsItem ACCOUNT_ENABLED_DESC = fromString("accountEnabled desc"); - /** Static value ageGroup for Get6ItemsItem. */ + /** + * Static value ageGroup for Get6ItemsItem. + */ public static final Get6ItemsItem AGE_GROUP = fromString("ageGroup"); - /** Static value ageGroup desc for Get6ItemsItem. */ + /** + * Static value ageGroup desc for Get6ItemsItem. + */ public static final Get6ItemsItem AGE_GROUP_DESC = fromString("ageGroup desc"); - /** Static value assignedPlans for Get6ItemsItem. */ + /** + * Static value assignedPlans for Get6ItemsItem. + */ public static final Get6ItemsItem ASSIGNED_PLANS = fromString("assignedPlans"); - /** Static value assignedPlans desc for Get6ItemsItem. */ + /** + * Static value assignedPlans desc for Get6ItemsItem. + */ public static final Get6ItemsItem ASSIGNED_PLANS_DESC = fromString("assignedPlans desc"); - /** Static value businessPhones for Get6ItemsItem. */ + /** + * Static value businessPhones for Get6ItemsItem. + */ public static final Get6ItemsItem BUSINESS_PHONES = fromString("businessPhones"); - /** Static value businessPhones desc for Get6ItemsItem. */ + /** + * Static value businessPhones desc for Get6ItemsItem. + */ public static final Get6ItemsItem BUSINESS_PHONES_DESC = fromString("businessPhones desc"); - /** Static value city for Get6ItemsItem. */ + /** + * Static value city for Get6ItemsItem. + */ public static final Get6ItemsItem CITY = fromString("city"); - /** Static value city desc for Get6ItemsItem. */ + /** + * Static value city desc for Get6ItemsItem. + */ public static final Get6ItemsItem CITY_DESC = fromString("city desc"); - /** Static value companyName for Get6ItemsItem. */ + /** + * Static value companyName for Get6ItemsItem. + */ public static final Get6ItemsItem COMPANY_NAME = fromString("companyName"); - /** Static value companyName desc for Get6ItemsItem. */ + /** + * Static value companyName desc for Get6ItemsItem. + */ public static final Get6ItemsItem COMPANY_NAME_DESC = fromString("companyName desc"); - /** Static value consentProvidedForMinor for Get6ItemsItem. */ + /** + * Static value consentProvidedForMinor for Get6ItemsItem. + */ public static final Get6ItemsItem CONSENT_PROVIDED_FOR_MINOR = fromString("consentProvidedForMinor"); - /** Static value consentProvidedForMinor desc for Get6ItemsItem. */ + /** + * Static value consentProvidedForMinor desc for Get6ItemsItem. + */ public static final Get6ItemsItem CONSENT_PROVIDED_FOR_MINOR_DESC = fromString("consentProvidedForMinor desc"); - /** Static value country for Get6ItemsItem. */ + /** + * Static value country for Get6ItemsItem. + */ public static final Get6ItemsItem COUNTRY = fromString("country"); - /** Static value country desc for Get6ItemsItem. */ + /** + * Static value country desc for Get6ItemsItem. + */ public static final Get6ItemsItem COUNTRY_DESC = fromString("country desc"); - /** Static value creationType for Get6ItemsItem. */ + /** + * Static value creationType for Get6ItemsItem. + */ public static final Get6ItemsItem CREATION_TYPE = fromString("creationType"); - /** Static value creationType desc for Get6ItemsItem. */ + /** + * Static value creationType desc for Get6ItemsItem. + */ public static final Get6ItemsItem CREATION_TYPE_DESC = fromString("creationType desc"); - /** Static value department for Get6ItemsItem. */ + /** + * Static value department for Get6ItemsItem. + */ public static final Get6ItemsItem DEPARTMENT = fromString("department"); - /** Static value department desc for Get6ItemsItem. */ + /** + * Static value department desc for Get6ItemsItem. + */ public static final Get6ItemsItem DEPARTMENT_DESC = fromString("department desc"); - /** Static value employeeHireDate for Get6ItemsItem. */ + /** + * Static value employeeHireDate for Get6ItemsItem. + */ public static final Get6ItemsItem EMPLOYEE_HIRE_DATE = fromString("employeeHireDate"); - /** Static value employeeHireDate desc for Get6ItemsItem. */ + /** + * Static value employeeHireDate desc for Get6ItemsItem. + */ public static final Get6ItemsItem EMPLOYEE_HIRE_DATE_DESC = fromString("employeeHireDate desc"); - /** Static value employeeId for Get6ItemsItem. */ + /** + * Static value employeeId for Get6ItemsItem. + */ public static final Get6ItemsItem EMPLOYEE_ID = fromString("employeeId"); - /** Static value employeeId desc for Get6ItemsItem. */ + /** + * Static value employeeId desc for Get6ItemsItem. + */ public static final Get6ItemsItem EMPLOYEE_ID_DESC = fromString("employeeId desc"); - /** Static value employeeOrgData for Get6ItemsItem. */ + /** + * Static value employeeOrgData for Get6ItemsItem. + */ public static final Get6ItemsItem EMPLOYEE_ORG_DATA = fromString("employeeOrgData"); - /** Static value employeeOrgData desc for Get6ItemsItem. */ + /** + * Static value employeeOrgData desc for Get6ItemsItem. + */ public static final Get6ItemsItem EMPLOYEE_ORG_DATA_DESC = fromString("employeeOrgData desc"); - /** Static value employeeType for Get6ItemsItem. */ + /** + * Static value employeeType for Get6ItemsItem. + */ public static final Get6ItemsItem EMPLOYEE_TYPE = fromString("employeeType"); - /** Static value employeeType desc for Get6ItemsItem. */ + /** + * Static value employeeType desc for Get6ItemsItem. + */ public static final Get6ItemsItem EMPLOYEE_TYPE_DESC = fromString("employeeType desc"); - /** Static value externalUserState for Get6ItemsItem. */ + /** + * Static value externalUserState for Get6ItemsItem. + */ public static final Get6ItemsItem EXTERNAL_USER_STATE = fromString("externalUserState"); - /** Static value externalUserState desc for Get6ItemsItem. */ + /** + * Static value externalUserState desc for Get6ItemsItem. + */ public static final Get6ItemsItem EXTERNAL_USER_STATE_DESC = fromString("externalUserState desc"); - /** Static value externalUserStateChangeDateTime for Get6ItemsItem. */ - public static final Get6ItemsItem EXTERNAL_USER_STATE_CHANGE_DATE_TIME = - fromString("externalUserStateChangeDateTime"); + /** + * Static value externalUserStateChangeDateTime for Get6ItemsItem. + */ + public static final Get6ItemsItem EXTERNAL_USER_STATE_CHANGE_DATE_TIME + = fromString("externalUserStateChangeDateTime"); - /** Static value externalUserStateChangeDateTime desc for Get6ItemsItem. */ - public static final Get6ItemsItem EXTERNAL_USER_STATE_CHANGE_DATE_TIME_DESC = - fromString("externalUserStateChangeDateTime desc"); + /** + * Static value externalUserStateChangeDateTime desc for Get6ItemsItem. + */ + public static final Get6ItemsItem EXTERNAL_USER_STATE_CHANGE_DATE_TIME_DESC + = fromString("externalUserStateChangeDateTime desc"); - /** Static value faxNumber for Get6ItemsItem. */ + /** + * Static value faxNumber for Get6ItemsItem. + */ public static final Get6ItemsItem FAX_NUMBER = fromString("faxNumber"); - /** Static value faxNumber desc for Get6ItemsItem. */ + /** + * Static value faxNumber desc for Get6ItemsItem. + */ public static final Get6ItemsItem FAX_NUMBER_DESC = fromString("faxNumber desc"); - /** Static value givenName for Get6ItemsItem. */ + /** + * Static value givenName for Get6ItemsItem. + */ public static final Get6ItemsItem GIVEN_NAME = fromString("givenName"); - /** Static value givenName desc for Get6ItemsItem. */ + /** + * Static value givenName desc for Get6ItemsItem. + */ public static final Get6ItemsItem GIVEN_NAME_DESC = fromString("givenName desc"); - /** Static value identities for Get6ItemsItem. */ + /** + * Static value identities for Get6ItemsItem. + */ public static final Get6ItemsItem IDENTITIES = fromString("identities"); - /** Static value identities desc for Get6ItemsItem. */ + /** + * Static value identities desc for Get6ItemsItem. + */ public static final Get6ItemsItem IDENTITIES_DESC = fromString("identities desc"); - /** Static value imAddresses for Get6ItemsItem. */ + /** + * Static value imAddresses for Get6ItemsItem. + */ public static final Get6ItemsItem IM_ADDRESSES = fromString("imAddresses"); - /** Static value imAddresses desc for Get6ItemsItem. */ + /** + * Static value imAddresses desc for Get6ItemsItem. + */ public static final Get6ItemsItem IM_ADDRESSES_DESC = fromString("imAddresses desc"); - /** Static value isResourceAccount for Get6ItemsItem. */ + /** + * Static value isResourceAccount for Get6ItemsItem. + */ public static final Get6ItemsItem IS_RESOURCE_ACCOUNT = fromString("isResourceAccount"); - /** Static value isResourceAccount desc for Get6ItemsItem. */ + /** + * Static value isResourceAccount desc for Get6ItemsItem. + */ public static final Get6ItemsItem IS_RESOURCE_ACCOUNT_DESC = fromString("isResourceAccount desc"); - /** Static value jobTitle for Get6ItemsItem. */ + /** + * Static value jobTitle for Get6ItemsItem. + */ public static final Get6ItemsItem JOB_TITLE = fromString("jobTitle"); - /** Static value jobTitle desc for Get6ItemsItem. */ + /** + * Static value jobTitle desc for Get6ItemsItem. + */ public static final Get6ItemsItem JOB_TITLE_DESC = fromString("jobTitle desc"); - /** Static value lastPasswordChangeDateTime for Get6ItemsItem. */ + /** + * Static value lastPasswordChangeDateTime for Get6ItemsItem. + */ public static final Get6ItemsItem LAST_PASSWORD_CHANGE_DATE_TIME = fromString("lastPasswordChangeDateTime"); - /** Static value lastPasswordChangeDateTime desc for Get6ItemsItem. */ - public static final Get6ItemsItem LAST_PASSWORD_CHANGE_DATE_TIME_DESC = - fromString("lastPasswordChangeDateTime desc"); + /** + * Static value lastPasswordChangeDateTime desc for Get6ItemsItem. + */ + public static final Get6ItemsItem LAST_PASSWORD_CHANGE_DATE_TIME_DESC + = fromString("lastPasswordChangeDateTime desc"); - /** Static value legalAgeGroupClassification for Get6ItemsItem. */ + /** + * Static value legalAgeGroupClassification for Get6ItemsItem. + */ public static final Get6ItemsItem LEGAL_AGE_GROUP_CLASSIFICATION = fromString("legalAgeGroupClassification"); - /** Static value legalAgeGroupClassification desc for Get6ItemsItem. */ - public static final Get6ItemsItem LEGAL_AGE_GROUP_CLASSIFICATION_DESC = - fromString("legalAgeGroupClassification desc"); + /** + * Static value legalAgeGroupClassification desc for Get6ItemsItem. + */ + public static final Get6ItemsItem LEGAL_AGE_GROUP_CLASSIFICATION_DESC + = fromString("legalAgeGroupClassification desc"); - /** Static value licenseAssignmentStates for Get6ItemsItem. */ + /** + * Static value licenseAssignmentStates for Get6ItemsItem. + */ public static final Get6ItemsItem LICENSE_ASSIGNMENT_STATES = fromString("licenseAssignmentStates"); - /** Static value licenseAssignmentStates desc for Get6ItemsItem. */ + /** + * Static value licenseAssignmentStates desc for Get6ItemsItem. + */ public static final Get6ItemsItem LICENSE_ASSIGNMENT_STATES_DESC = fromString("licenseAssignmentStates desc"); - /** Static value mobilePhone for Get6ItemsItem. */ + /** + * Static value mobilePhone for Get6ItemsItem. + */ public static final Get6ItemsItem MOBILE_PHONE = fromString("mobilePhone"); - /** Static value mobilePhone desc for Get6ItemsItem. */ + /** + * Static value mobilePhone desc for Get6ItemsItem. + */ public static final Get6ItemsItem MOBILE_PHONE_DESC = fromString("mobilePhone desc"); - /** Static value officeLocation for Get6ItemsItem. */ + /** + * Static value officeLocation for Get6ItemsItem. + */ public static final Get6ItemsItem OFFICE_LOCATION = fromString("officeLocation"); - /** Static value officeLocation desc for Get6ItemsItem. */ + /** + * Static value officeLocation desc for Get6ItemsItem. + */ public static final Get6ItemsItem OFFICE_LOCATION_DESC = fromString("officeLocation desc"); - /** Static value onPremisesDistinguishedName for Get6ItemsItem. */ + /** + * Static value onPremisesDistinguishedName for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_DISTINGUISHED_NAME = fromString("onPremisesDistinguishedName"); - /** Static value onPremisesDistinguishedName desc for Get6ItemsItem. */ - public static final Get6ItemsItem ON_PREMISES_DISTINGUISHED_NAME_DESC = - fromString("onPremisesDistinguishedName desc"); + /** + * Static value onPremisesDistinguishedName desc for Get6ItemsItem. + */ + public static final Get6ItemsItem ON_PREMISES_DISTINGUISHED_NAME_DESC + = fromString("onPremisesDistinguishedName desc"); - /** Static value onPremisesExtensionAttributes for Get6ItemsItem. */ + /** + * Static value onPremisesExtensionAttributes for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_EXTENSION_ATTRIBUTES = fromString("onPremisesExtensionAttributes"); - /** Static value onPremisesExtensionAttributes desc for Get6ItemsItem. */ - public static final Get6ItemsItem ON_PREMISES_EXTENSION_ATTRIBUTES_DESC = - fromString("onPremisesExtensionAttributes desc"); + /** + * Static value onPremisesExtensionAttributes desc for Get6ItemsItem. + */ + public static final Get6ItemsItem ON_PREMISES_EXTENSION_ATTRIBUTES_DESC + = fromString("onPremisesExtensionAttributes desc"); - /** Static value onPremisesImmutableId for Get6ItemsItem. */ + /** + * Static value onPremisesImmutableId for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_IMMUTABLE_ID = fromString("onPremisesImmutableId"); - /** Static value onPremisesImmutableId desc for Get6ItemsItem. */ + /** + * Static value onPremisesImmutableId desc for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_IMMUTABLE_ID_DESC = fromString("onPremisesImmutableId desc"); - /** Static value onPremisesUserPrincipalName for Get6ItemsItem. */ + /** + * Static value onPremisesUserPrincipalName for Get6ItemsItem. + */ public static final Get6ItemsItem ON_PREMISES_USER_PRINCIPAL_NAME = fromString("onPremisesUserPrincipalName"); - /** Static value onPremisesUserPrincipalName desc for Get6ItemsItem. */ - public static final Get6ItemsItem ON_PREMISES_USER_PRINCIPAL_NAME_DESC = - fromString("onPremisesUserPrincipalName desc"); + /** + * Static value onPremisesUserPrincipalName desc for Get6ItemsItem. + */ + public static final Get6ItemsItem ON_PREMISES_USER_PRINCIPAL_NAME_DESC + = fromString("onPremisesUserPrincipalName desc"); - /** Static value otherMails for Get6ItemsItem. */ + /** + * Static value otherMails for Get6ItemsItem. + */ public static final Get6ItemsItem OTHER_MAILS = fromString("otherMails"); - /** Static value otherMails desc for Get6ItemsItem. */ + /** + * Static value otherMails desc for Get6ItemsItem. + */ public static final Get6ItemsItem OTHER_MAILS_DESC = fromString("otherMails desc"); - /** Static value passwordPolicies for Get6ItemsItem. */ + /** + * Static value passwordPolicies for Get6ItemsItem. + */ public static final Get6ItemsItem PASSWORD_POLICIES = fromString("passwordPolicies"); - /** Static value passwordPolicies desc for Get6ItemsItem. */ + /** + * Static value passwordPolicies desc for Get6ItemsItem. + */ public static final Get6ItemsItem PASSWORD_POLICIES_DESC = fromString("passwordPolicies desc"); - /** Static value passwordProfile for Get6ItemsItem. */ + /** + * Static value passwordProfile for Get6ItemsItem. + */ public static final Get6ItemsItem PASSWORD_PROFILE = fromString("passwordProfile"); - /** Static value passwordProfile desc for Get6ItemsItem. */ + /** + * Static value passwordProfile desc for Get6ItemsItem. + */ public static final Get6ItemsItem PASSWORD_PROFILE_DESC = fromString("passwordProfile desc"); - /** Static value postalCode for Get6ItemsItem. */ + /** + * Static value postalCode for Get6ItemsItem. + */ public static final Get6ItemsItem POSTAL_CODE = fromString("postalCode"); - /** Static value postalCode desc for Get6ItemsItem. */ + /** + * Static value postalCode desc for Get6ItemsItem. + */ public static final Get6ItemsItem POSTAL_CODE_DESC = fromString("postalCode desc"); - /** Static value provisionedPlans for Get6ItemsItem. */ + /** + * Static value provisionedPlans for Get6ItemsItem. + */ public static final Get6ItemsItem PROVISIONED_PLANS = fromString("provisionedPlans"); - /** Static value provisionedPlans desc for Get6ItemsItem. */ + /** + * Static value provisionedPlans desc for Get6ItemsItem. + */ public static final Get6ItemsItem PROVISIONED_PLANS_DESC = fromString("provisionedPlans desc"); - /** Static value showInAddressList for Get6ItemsItem. */ + /** + * Static value showInAddressList for Get6ItemsItem. + */ public static final Get6ItemsItem SHOW_IN_ADDRESS_LIST = fromString("showInAddressList"); - /** Static value showInAddressList desc for Get6ItemsItem. */ + /** + * Static value showInAddressList desc for Get6ItemsItem. + */ public static final Get6ItemsItem SHOW_IN_ADDRESS_LIST_DESC = fromString("showInAddressList desc"); - /** Static value signInSessionsValidFromDateTime for Get6ItemsItem. */ - public static final Get6ItemsItem SIGN_IN_SESSIONS_VALID_FROM_DATE_TIME = - fromString("signInSessionsValidFromDateTime"); + /** + * Static value signInSessionsValidFromDateTime for Get6ItemsItem. + */ + public static final Get6ItemsItem SIGN_IN_SESSIONS_VALID_FROM_DATE_TIME + = fromString("signInSessionsValidFromDateTime"); - /** Static value signInSessionsValidFromDateTime desc for Get6ItemsItem. */ - public static final Get6ItemsItem SIGN_IN_SESSIONS_VALID_FROM_DATE_TIME_DESC = - fromString("signInSessionsValidFromDateTime desc"); + /** + * Static value signInSessionsValidFromDateTime desc for Get6ItemsItem. + */ + public static final Get6ItemsItem SIGN_IN_SESSIONS_VALID_FROM_DATE_TIME_DESC + = fromString("signInSessionsValidFromDateTime desc"); - /** Static value state for Get6ItemsItem. */ + /** + * Static value state for Get6ItemsItem. + */ public static final Get6ItemsItem STATE = fromString("state"); - /** Static value state desc for Get6ItemsItem. */ + /** + * Static value state desc for Get6ItemsItem. + */ public static final Get6ItemsItem STATE_DESC = fromString("state desc"); - /** Static value streetAddress for Get6ItemsItem. */ + /** + * Static value streetAddress for Get6ItemsItem. + */ public static final Get6ItemsItem STREET_ADDRESS = fromString("streetAddress"); - /** Static value streetAddress desc for Get6ItemsItem. */ + /** + * Static value streetAddress desc for Get6ItemsItem. + */ public static final Get6ItemsItem STREET_ADDRESS_DESC = fromString("streetAddress desc"); - /** Static value surname for Get6ItemsItem. */ + /** + * Static value surname for Get6ItemsItem. + */ public static final Get6ItemsItem SURNAME = fromString("surname"); - /** Static value surname desc for Get6ItemsItem. */ + /** + * Static value surname desc for Get6ItemsItem. + */ public static final Get6ItemsItem SURNAME_DESC = fromString("surname desc"); - /** Static value usageLocation for Get6ItemsItem. */ + /** + * Static value usageLocation for Get6ItemsItem. + */ public static final Get6ItemsItem USAGE_LOCATION = fromString("usageLocation"); - /** Static value usageLocation desc for Get6ItemsItem. */ + /** + * Static value usageLocation desc for Get6ItemsItem. + */ public static final Get6ItemsItem USAGE_LOCATION_DESC = fromString("usageLocation desc"); - /** Static value userPrincipalName for Get6ItemsItem. */ + /** + * Static value userPrincipalName for Get6ItemsItem. + */ public static final Get6ItemsItem USER_PRINCIPAL_NAME = fromString("userPrincipalName"); - /** Static value userPrincipalName desc for Get6ItemsItem. */ + /** + * Static value userPrincipalName desc for Get6ItemsItem. + */ public static final Get6ItemsItem USER_PRINCIPAL_NAME_DESC = fromString("userPrincipalName desc"); - /** Static value userType for Get6ItemsItem. */ + /** + * Static value userType for Get6ItemsItem. + */ public static final Get6ItemsItem USER_TYPE = fromString("userType"); - /** Static value userType desc for Get6ItemsItem. */ + /** + * Static value userType desc for Get6ItemsItem. + */ public static final Get6ItemsItem USER_TYPE_DESC = fromString("userType desc"); - /** Static value mailboxSettings for Get6ItemsItem. */ + /** + * Static value mailboxSettings for Get6ItemsItem. + */ public static final Get6ItemsItem MAILBOX_SETTINGS = fromString("mailboxSettings"); - /** Static value mailboxSettings desc for Get6ItemsItem. */ + /** + * Static value mailboxSettings desc for Get6ItemsItem. + */ public static final Get6ItemsItem MAILBOX_SETTINGS_DESC = fromString("mailboxSettings desc"); - /** Static value deviceEnrollmentLimit for Get6ItemsItem. */ + /** + * Static value deviceEnrollmentLimit for Get6ItemsItem. + */ public static final Get6ItemsItem DEVICE_ENROLLMENT_LIMIT = fromString("deviceEnrollmentLimit"); - /** Static value deviceEnrollmentLimit desc for Get6ItemsItem. */ + /** + * Static value deviceEnrollmentLimit desc for Get6ItemsItem. + */ public static final Get6ItemsItem DEVICE_ENROLLMENT_LIMIT_DESC = fromString("deviceEnrollmentLimit desc"); - /** Static value aboutMe for Get6ItemsItem. */ + /** + * Static value aboutMe for Get6ItemsItem. + */ public static final Get6ItemsItem ABOUT_ME = fromString("aboutMe"); - /** Static value aboutMe desc for Get6ItemsItem. */ + /** + * Static value aboutMe desc for Get6ItemsItem. + */ public static final Get6ItemsItem ABOUT_ME_DESC = fromString("aboutMe desc"); - /** Static value birthday for Get6ItemsItem. */ + /** + * Static value birthday for Get6ItemsItem. + */ public static final Get6ItemsItem BIRTHDAY = fromString("birthday"); - /** Static value birthday desc for Get6ItemsItem. */ + /** + * Static value birthday desc for Get6ItemsItem. + */ public static final Get6ItemsItem BIRTHDAY_DESC = fromString("birthday desc"); - /** Static value hireDate for Get6ItemsItem. */ + /** + * Static value hireDate for Get6ItemsItem. + */ public static final Get6ItemsItem HIRE_DATE = fromString("hireDate"); - /** Static value hireDate desc for Get6ItemsItem. */ + /** + * Static value hireDate desc for Get6ItemsItem. + */ public static final Get6ItemsItem HIRE_DATE_DESC = fromString("hireDate desc"); - /** Static value interests for Get6ItemsItem. */ + /** + * Static value interests for Get6ItemsItem. + */ public static final Get6ItemsItem INTERESTS = fromString("interests"); - /** Static value interests desc for Get6ItemsItem. */ + /** + * Static value interests desc for Get6ItemsItem. + */ public static final Get6ItemsItem INTERESTS_DESC = fromString("interests desc"); - /** Static value mySite for Get6ItemsItem. */ + /** + * Static value mySite for Get6ItemsItem. + */ public static final Get6ItemsItem MY_SITE = fromString("mySite"); - /** Static value mySite desc for Get6ItemsItem. */ + /** + * Static value mySite desc for Get6ItemsItem. + */ public static final Get6ItemsItem MY_SITE_DESC = fromString("mySite desc"); - /** Static value pastProjects for Get6ItemsItem. */ + /** + * Static value pastProjects for Get6ItemsItem. + */ public static final Get6ItemsItem PAST_PROJECTS = fromString("pastProjects"); - /** Static value pastProjects desc for Get6ItemsItem. */ + /** + * Static value pastProjects desc for Get6ItemsItem. + */ public static final Get6ItemsItem PAST_PROJECTS_DESC = fromString("pastProjects desc"); - /** Static value preferredName for Get6ItemsItem. */ + /** + * Static value preferredName for Get6ItemsItem. + */ public static final Get6ItemsItem PREFERRED_NAME = fromString("preferredName"); - /** Static value preferredName desc for Get6ItemsItem. */ + /** + * Static value preferredName desc for Get6ItemsItem. + */ public static final Get6ItemsItem PREFERRED_NAME_DESC = fromString("preferredName desc"); - /** Static value responsibilities for Get6ItemsItem. */ + /** + * Static value responsibilities for Get6ItemsItem. + */ public static final Get6ItemsItem RESPONSIBILITIES = fromString("responsibilities"); - /** Static value responsibilities desc for Get6ItemsItem. */ + /** + * Static value responsibilities desc for Get6ItemsItem. + */ public static final Get6ItemsItem RESPONSIBILITIES_DESC = fromString("responsibilities desc"); - /** Static value schools for Get6ItemsItem. */ + /** + * Static value schools for Get6ItemsItem. + */ public static final Get6ItemsItem SCHOOLS = fromString("schools"); - /** Static value schools desc for Get6ItemsItem. */ + /** + * Static value schools desc for Get6ItemsItem. + */ public static final Get6ItemsItem SCHOOLS_DESC = fromString("schools desc"); - /** Static value skills for Get6ItemsItem. */ + /** + * Static value skills for Get6ItemsItem. + */ public static final Get6ItemsItem SKILLS = fromString("skills"); - /** Static value skills desc for Get6ItemsItem. */ + /** + * Static value skills desc for Get6ItemsItem. + */ public static final Get6ItemsItem SKILLS_DESC = fromString("skills desc"); - /** Static value authenticationType for Get6ItemsItem. */ + /** + * Static value authenticationType for Get6ItemsItem. + */ public static final Get6ItemsItem AUTHENTICATION_TYPE = fromString("authenticationType"); - /** Static value availabilityStatus for Get6ItemsItem. */ + /** + * Static value availabilityStatus for Get6ItemsItem. + */ public static final Get6ItemsItem AVAILABILITY_STATUS = fromString("availabilityStatus"); - /** Static value isAdminManaged for Get6ItemsItem. */ + /** + * Static value isAdminManaged for Get6ItemsItem. + */ public static final Get6ItemsItem IS_ADMIN_MANAGED = fromString("isAdminManaged"); - /** Static value isDefault for Get6ItemsItem. */ + /** + * Static value isDefault for Get6ItemsItem. + */ public static final Get6ItemsItem IS_DEFAULT = fromString("isDefault"); - /** Static value isInitial for Get6ItemsItem. */ + /** + * Static value isInitial for Get6ItemsItem. + */ public static final Get6ItemsItem IS_INITIAL = fromString("isInitial"); - /** Static value isRoot for Get6ItemsItem. */ + /** + * Static value isRoot for Get6ItemsItem. + */ public static final Get6ItemsItem IS_ROOT = fromString("isRoot"); - /** Static value isVerified for Get6ItemsItem. */ + /** + * Static value isVerified for Get6ItemsItem. + */ public static final Get6ItemsItem IS_VERIFIED = fromString("isVerified"); - /** Static value manufacturer for Get6ItemsItem. */ + /** + * Static value manufacturer for Get6ItemsItem. + */ public static final Get6ItemsItem MANUFACTURER = fromString("manufacturer"); - /** Static value model for Get6ItemsItem. */ + /** + * Static value model for Get6ItemsItem. + */ public static final Get6ItemsItem MODEL = fromString("model"); - /** Static value passwordNotificationWindowInDays for Get6ItemsItem. */ - public static final Get6ItemsItem PASSWORD_NOTIFICATION_WINDOW_IN_DAYS = - fromString("passwordNotificationWindowInDays"); + /** + * Static value passwordNotificationWindowInDays for Get6ItemsItem. + */ + public static final Get6ItemsItem PASSWORD_NOTIFICATION_WINDOW_IN_DAYS + = fromString("passwordNotificationWindowInDays"); - /** Static value passwordValidityPeriodInDays for Get6ItemsItem. */ + /** + * Static value passwordValidityPeriodInDays for Get6ItemsItem. + */ public static final Get6ItemsItem PASSWORD_VALIDITY_PERIOD_IN_DAYS = fromString("passwordValidityPeriodInDays"); - /** Static value supportedServices for Get6ItemsItem. */ + /** + * Static value supportedServices for Get6ItemsItem. + */ public static final Get6ItemsItem SUPPORTED_SERVICES = fromString("supportedServices"); - /** Static value domainNameReferences for Get6ItemsItem. */ + /** + * Static value domainNameReferences for Get6ItemsItem. + */ public static final Get6ItemsItem DOMAIN_NAME_REFERENCES = fromString("domainNameReferences"); - /** Static value serviceConfigurationRecords for Get6ItemsItem. */ + /** + * Static value serviceConfigurationRecords for Get6ItemsItem. + */ public static final Get6ItemsItem SERVICE_CONFIGURATION_RECORDS = fromString("serviceConfigurationRecords"); - /** Static value verificationDnsRecords for Get6ItemsItem. */ + /** + * Static value verificationDnsRecords for Get6ItemsItem. + */ public static final Get6ItemsItem VERIFICATION_DNS_RECORDS = fromString("verificationDnsRecords"); /** * Creates a new instance of Get6ItemsItem value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -795,18 +1302,17 @@ public Get6ItemsItem() { /** * Creates or finds a Get6ItemsItem from its string representation. - * + * * @param name a name to look for. * @return the corresponding Get6ItemsItem. */ - @JsonCreator public static Get6ItemsItem fromString(String name) { return fromString(name, Get6ItemsItem.class); } /** * Gets known Get6ItemsItem values. - * + * * @return known Get6ItemsItem values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get7ItemsItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get7ItemsItem.java index 7d96d6660fdec..61e5dccdfbe29 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get7ItemsItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get7ItemsItem.java @@ -5,566 +5,933 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Get7ItemsItem. */ +/** + * Defines values for Get7ItemsItem. + */ public final class Get7ItemsItem extends ExpandableStringEnum { - /** Static value id for Get7ItemsItem. */ + /** + * Static value id for Get7ItemsItem. + */ public static final Get7ItemsItem ID = fromString("id"); - /** Static value deletedDateTime for Get7ItemsItem. */ + /** + * Static value deletedDateTime for Get7ItemsItem. + */ public static final Get7ItemsItem DELETED_DATE_TIME = fromString("deletedDateTime"); - /** Static value addIns for Get7ItemsItem. */ + /** + * Static value addIns for Get7ItemsItem. + */ public static final Get7ItemsItem ADD_INS = fromString("addIns"); - /** Static value api for Get7ItemsItem. */ + /** + * Static value api for Get7ItemsItem. + */ public static final Get7ItemsItem API = fromString("api"); - /** Static value appId for Get7ItemsItem. */ + /** + * Static value appId for Get7ItemsItem. + */ public static final Get7ItemsItem APP_ID = fromString("appId"); - /** Static value applicationTemplateId for Get7ItemsItem. */ + /** + * Static value applicationTemplateId for Get7ItemsItem. + */ public static final Get7ItemsItem APPLICATION_TEMPLATE_ID = fromString("applicationTemplateId"); - /** Static value appRoles for Get7ItemsItem. */ + /** + * Static value appRoles for Get7ItemsItem. + */ public static final Get7ItemsItem APP_ROLES = fromString("appRoles"); - /** Static value createdDateTime for Get7ItemsItem. */ + /** + * Static value createdDateTime for Get7ItemsItem. + */ public static final Get7ItemsItem CREATED_DATE_TIME = fromString("createdDateTime"); - /** Static value description for Get7ItemsItem. */ + /** + * Static value description for Get7ItemsItem. + */ public static final Get7ItemsItem DESCRIPTION = fromString("description"); - /** Static value displayName for Get7ItemsItem. */ + /** + * Static value displayName for Get7ItemsItem. + */ public static final Get7ItemsItem DISPLAY_NAME = fromString("displayName"); - /** Static value groupMembershipClaims for Get7ItemsItem. */ + /** + * Static value groupMembershipClaims for Get7ItemsItem. + */ public static final Get7ItemsItem GROUP_MEMBERSHIP_CLAIMS = fromString("groupMembershipClaims"); - /** Static value identifierUris for Get7ItemsItem. */ + /** + * Static value identifierUris for Get7ItemsItem. + */ public static final Get7ItemsItem IDENTIFIER_URIS = fromString("identifierUris"); - /** Static value info for Get7ItemsItem. */ + /** + * Static value info for Get7ItemsItem. + */ public static final Get7ItemsItem INFO = fromString("info"); - /** Static value isDeviceOnlyAuthSupported for Get7ItemsItem. */ + /** + * Static value isDeviceOnlyAuthSupported for Get7ItemsItem. + */ public static final Get7ItemsItem IS_DEVICE_ONLY_AUTH_SUPPORTED = fromString("isDeviceOnlyAuthSupported"); - /** Static value isFallbackPublicClient for Get7ItemsItem. */ + /** + * Static value isFallbackPublicClient for Get7ItemsItem. + */ public static final Get7ItemsItem IS_FALLBACK_PUBLIC_CLIENT = fromString("isFallbackPublicClient"); - /** Static value keyCredentials for Get7ItemsItem. */ + /** + * Static value keyCredentials for Get7ItemsItem. + */ public static final Get7ItemsItem KEY_CREDENTIALS = fromString("keyCredentials"); - /** Static value logo for Get7ItemsItem. */ + /** + * Static value logo for Get7ItemsItem. + */ public static final Get7ItemsItem LOGO = fromString("logo"); - /** Static value notes for Get7ItemsItem. */ + /** + * Static value notes for Get7ItemsItem. + */ public static final Get7ItemsItem NOTES = fromString("notes"); - /** Static value oauth2RequirePostResponse for Get7ItemsItem. */ + /** + * Static value oauth2RequirePostResponse for Get7ItemsItem. + */ public static final Get7ItemsItem OAUTH2REQUIRE_POST_RESPONSE = fromString("oauth2RequirePostResponse"); - /** Static value optionalClaims for Get7ItemsItem. */ + /** + * Static value optionalClaims for Get7ItemsItem. + */ public static final Get7ItemsItem OPTIONAL_CLAIMS = fromString("optionalClaims"); - /** Static value parentalControlSettings for Get7ItemsItem. */ + /** + * Static value parentalControlSettings for Get7ItemsItem. + */ public static final Get7ItemsItem PARENTAL_CONTROL_SETTINGS = fromString("parentalControlSettings"); - /** Static value passwordCredentials for Get7ItemsItem. */ + /** + * Static value passwordCredentials for Get7ItemsItem. + */ public static final Get7ItemsItem PASSWORD_CREDENTIALS = fromString("passwordCredentials"); - /** Static value publicClient for Get7ItemsItem. */ + /** + * Static value publicClient for Get7ItemsItem. + */ public static final Get7ItemsItem PUBLIC_CLIENT = fromString("publicClient"); - /** Static value publisherDomain for Get7ItemsItem. */ + /** + * Static value publisherDomain for Get7ItemsItem. + */ public static final Get7ItemsItem PUBLISHER_DOMAIN = fromString("publisherDomain"); - /** Static value requiredResourceAccess for Get7ItemsItem. */ + /** + * Static value requiredResourceAccess for Get7ItemsItem. + */ public static final Get7ItemsItem REQUIRED_RESOURCE_ACCESS = fromString("requiredResourceAccess"); - /** Static value signInAudience for Get7ItemsItem. */ + /** + * Static value signInAudience for Get7ItemsItem. + */ public static final Get7ItemsItem SIGN_IN_AUDIENCE = fromString("signInAudience"); - /** Static value tags for Get7ItemsItem. */ + /** + * Static value tags for Get7ItemsItem. + */ public static final Get7ItemsItem TAGS = fromString("tags"); - /** Static value tokenEncryptionKeyId for Get7ItemsItem. */ + /** + * Static value tokenEncryptionKeyId for Get7ItemsItem. + */ public static final Get7ItemsItem TOKEN_ENCRYPTION_KEY_ID = fromString("tokenEncryptionKeyId"); - /** Static value web for Get7ItemsItem. */ + /** + * Static value web for Get7ItemsItem. + */ public static final Get7ItemsItem WEB = fromString("web"); - /** Static value createdOnBehalfOf for Get7ItemsItem. */ + /** + * Static value createdOnBehalfOf for Get7ItemsItem. + */ public static final Get7ItemsItem CREATED_ON_BEHALF_OF = fromString("createdOnBehalfOf"); - /** Static value extensionProperties for Get7ItemsItem. */ + /** + * Static value extensionProperties for Get7ItemsItem. + */ public static final Get7ItemsItem EXTENSION_PROPERTIES = fromString("extensionProperties"); - /** Static value homeRealmDiscoveryPolicies for Get7ItemsItem. */ + /** + * Static value homeRealmDiscoveryPolicies for Get7ItemsItem. + */ public static final Get7ItemsItem HOME_REALM_DISCOVERY_POLICIES = fromString("homeRealmDiscoveryPolicies"); - /** Static value owners for Get7ItemsItem. */ + /** + * Static value owners for Get7ItemsItem. + */ public static final Get7ItemsItem OWNERS = fromString("owners"); - /** Static value tokenIssuancePolicies for Get7ItemsItem. */ + /** + * Static value tokenIssuancePolicies for Get7ItemsItem. + */ public static final Get7ItemsItem TOKEN_ISSUANCE_POLICIES = fromString("tokenIssuancePolicies"); - /** Static value tokenLifetimePolicies for Get7ItemsItem. */ + /** + * Static value tokenLifetimePolicies for Get7ItemsItem. + */ public static final Get7ItemsItem TOKEN_LIFETIME_POLICIES = fromString("tokenLifetimePolicies"); - /** Static value assignedLabels for Get7ItemsItem. */ + /** + * Static value assignedLabels for Get7ItemsItem. + */ public static final Get7ItemsItem ASSIGNED_LABELS = fromString("assignedLabels"); - /** Static value assignedLicenses for Get7ItemsItem. */ + /** + * Static value assignedLicenses for Get7ItemsItem. + */ public static final Get7ItemsItem ASSIGNED_LICENSES = fromString("assignedLicenses"); - /** Static value classification for Get7ItemsItem. */ + /** + * Static value classification for Get7ItemsItem. + */ public static final Get7ItemsItem CLASSIFICATION = fromString("classification"); - /** Static value expirationDateTime for Get7ItemsItem. */ + /** + * Static value expirationDateTime for Get7ItemsItem. + */ public static final Get7ItemsItem EXPIRATION_DATE_TIME = fromString("expirationDateTime"); - /** Static value groupTypes for Get7ItemsItem. */ + /** + * Static value groupTypes for Get7ItemsItem. + */ public static final Get7ItemsItem GROUP_TYPES = fromString("groupTypes"); - /** Static value hasMembersWithLicenseErrors for Get7ItemsItem. */ + /** + * Static value hasMembersWithLicenseErrors for Get7ItemsItem. + */ public static final Get7ItemsItem HAS_MEMBERS_WITH_LICENSE_ERRORS = fromString("hasMembersWithLicenseErrors"); - /** Static value licenseProcessingState for Get7ItemsItem. */ + /** + * Static value licenseProcessingState for Get7ItemsItem. + */ public static final Get7ItemsItem LICENSE_PROCESSING_STATE = fromString("licenseProcessingState"); - /** Static value mail for Get7ItemsItem. */ + /** + * Static value mail for Get7ItemsItem. + */ public static final Get7ItemsItem MAIL = fromString("mail"); - /** Static value mailEnabled for Get7ItemsItem. */ + /** + * Static value mailEnabled for Get7ItemsItem. + */ public static final Get7ItemsItem MAIL_ENABLED = fromString("mailEnabled"); - /** Static value mailNickname for Get7ItemsItem. */ + /** + * Static value mailNickname for Get7ItemsItem. + */ public static final Get7ItemsItem MAIL_NICKNAME = fromString("mailNickname"); - /** Static value membershipRule for Get7ItemsItem. */ + /** + * Static value membershipRule for Get7ItemsItem. + */ public static final Get7ItemsItem MEMBERSHIP_RULE = fromString("membershipRule"); - /** Static value membershipRuleProcessingState for Get7ItemsItem. */ + /** + * Static value membershipRuleProcessingState for Get7ItemsItem. + */ public static final Get7ItemsItem MEMBERSHIP_RULE_PROCESSING_STATE = fromString("membershipRuleProcessingState"); - /** Static value onPremisesDomainName for Get7ItemsItem. */ + /** + * Static value onPremisesDomainName for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_DOMAIN_NAME = fromString("onPremisesDomainName"); - /** Static value onPremisesLastSyncDateTime for Get7ItemsItem. */ + /** + * Static value onPremisesLastSyncDateTime for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_LAST_SYNC_DATE_TIME = fromString("onPremisesLastSyncDateTime"); - /** Static value onPremisesNetBiosName for Get7ItemsItem. */ + /** + * Static value onPremisesNetBiosName for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_NET_BIOS_NAME = fromString("onPremisesNetBiosName"); - /** Static value onPremisesProvisioningErrors for Get7ItemsItem. */ + /** + * Static value onPremisesProvisioningErrors for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_PROVISIONING_ERRORS = fromString("onPremisesProvisioningErrors"); - /** Static value onPremisesSamAccountName for Get7ItemsItem. */ + /** + * Static value onPremisesSamAccountName for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_SAM_ACCOUNT_NAME = fromString("onPremisesSamAccountName"); - /** Static value onPremisesSecurityIdentifier for Get7ItemsItem. */ + /** + * Static value onPremisesSecurityIdentifier for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_SECURITY_IDENTIFIER = fromString("onPremisesSecurityIdentifier"); - /** Static value onPremisesSyncEnabled for Get7ItemsItem. */ + /** + * Static value onPremisesSyncEnabled for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_SYNC_ENABLED = fromString("onPremisesSyncEnabled"); - /** Static value preferredDataLocation for Get7ItemsItem. */ + /** + * Static value preferredDataLocation for Get7ItemsItem. + */ public static final Get7ItemsItem PREFERRED_DATA_LOCATION = fromString("preferredDataLocation"); - /** Static value preferredLanguage for Get7ItemsItem. */ + /** + * Static value preferredLanguage for Get7ItemsItem. + */ public static final Get7ItemsItem PREFERRED_LANGUAGE = fromString("preferredLanguage"); - /** Static value proxyAddresses for Get7ItemsItem. */ + /** + * Static value proxyAddresses for Get7ItemsItem. + */ public static final Get7ItemsItem PROXY_ADDRESSES = fromString("proxyAddresses"); - /** Static value renewedDateTime for Get7ItemsItem. */ + /** + * Static value renewedDateTime for Get7ItemsItem. + */ public static final Get7ItemsItem RENEWED_DATE_TIME = fromString("renewedDateTime"); - /** Static value securityEnabled for Get7ItemsItem. */ + /** + * Static value securityEnabled for Get7ItemsItem. + */ public static final Get7ItemsItem SECURITY_ENABLED = fromString("securityEnabled"); - /** Static value securityIdentifier for Get7ItemsItem. */ + /** + * Static value securityIdentifier for Get7ItemsItem. + */ public static final Get7ItemsItem SECURITY_IDENTIFIER = fromString("securityIdentifier"); - /** Static value theme for Get7ItemsItem. */ + /** + * Static value theme for Get7ItemsItem. + */ public static final Get7ItemsItem THEME = fromString("theme"); - /** Static value visibility for Get7ItemsItem. */ + /** + * Static value visibility for Get7ItemsItem. + */ public static final Get7ItemsItem VISIBILITY = fromString("visibility"); - /** Static value allowExternalSenders for Get7ItemsItem. */ + /** + * Static value allowExternalSenders for Get7ItemsItem. + */ public static final Get7ItemsItem ALLOW_EXTERNAL_SENDERS = fromString("allowExternalSenders"); - /** Static value autoSubscribeNewMembers for Get7ItemsItem. */ + /** + * Static value autoSubscribeNewMembers for Get7ItemsItem. + */ public static final Get7ItemsItem AUTO_SUBSCRIBE_NEW_MEMBERS = fromString("autoSubscribeNewMembers"); - /** Static value hideFromAddressLists for Get7ItemsItem. */ + /** + * Static value hideFromAddressLists for Get7ItemsItem. + */ public static final Get7ItemsItem HIDE_FROM_ADDRESS_LISTS = fromString("hideFromAddressLists"); - /** Static value hideFromOutlookClients for Get7ItemsItem. */ + /** + * Static value hideFromOutlookClients for Get7ItemsItem. + */ public static final Get7ItemsItem HIDE_FROM_OUTLOOK_CLIENTS = fromString("hideFromOutlookClients"); - /** Static value isSubscribedByMail for Get7ItemsItem. */ + /** + * Static value isSubscribedByMail for Get7ItemsItem. + */ public static final Get7ItemsItem IS_SUBSCRIBED_BY_MAIL = fromString("isSubscribedByMail"); - /** Static value unseenCount for Get7ItemsItem. */ + /** + * Static value unseenCount for Get7ItemsItem. + */ public static final Get7ItemsItem UNSEEN_COUNT = fromString("unseenCount"); - /** Static value isArchived for Get7ItemsItem. */ + /** + * Static value isArchived for Get7ItemsItem. + */ public static final Get7ItemsItem IS_ARCHIVED = fromString("isArchived"); - /** Static value appRoleAssignments for Get7ItemsItem. */ + /** + * Static value appRoleAssignments for Get7ItemsItem. + */ public static final Get7ItemsItem APP_ROLE_ASSIGNMENTS = fromString("appRoleAssignments"); - /** Static value memberOf for Get7ItemsItem. */ + /** + * Static value memberOf for Get7ItemsItem. + */ public static final Get7ItemsItem MEMBER_OF = fromString("memberOf"); - /** Static value members for Get7ItemsItem. */ + /** + * Static value members for Get7ItemsItem. + */ public static final Get7ItemsItem MEMBERS = fromString("members"); - /** Static value membersWithLicenseErrors for Get7ItemsItem. */ + /** + * Static value membersWithLicenseErrors for Get7ItemsItem. + */ public static final Get7ItemsItem MEMBERS_WITH_LICENSE_ERRORS = fromString("membersWithLicenseErrors"); - /** Static value permissionGrants for Get7ItemsItem. */ + /** + * Static value permissionGrants for Get7ItemsItem. + */ public static final Get7ItemsItem PERMISSION_GRANTS = fromString("permissionGrants"); - /** Static value settings for Get7ItemsItem. */ + /** + * Static value settings for Get7ItemsItem. + */ public static final Get7ItemsItem SETTINGS = fromString("settings"); - /** Static value transitiveMemberOf for Get7ItemsItem. */ + /** + * Static value transitiveMemberOf for Get7ItemsItem. + */ public static final Get7ItemsItem TRANSITIVE_MEMBER_OF = fromString("transitiveMemberOf"); - /** Static value transitiveMembers for Get7ItemsItem. */ + /** + * Static value transitiveMembers for Get7ItemsItem. + */ public static final Get7ItemsItem TRANSITIVE_MEMBERS = fromString("transitiveMembers"); - /** Static value acceptedSenders for Get7ItemsItem. */ + /** + * Static value acceptedSenders for Get7ItemsItem. + */ public static final Get7ItemsItem ACCEPTED_SENDERS = fromString("acceptedSenders"); - /** Static value calendar for Get7ItemsItem. */ + /** + * Static value calendar for Get7ItemsItem. + */ public static final Get7ItemsItem CALENDAR = fromString("calendar"); - /** Static value calendarView for Get7ItemsItem. */ + /** + * Static value calendarView for Get7ItemsItem. + */ public static final Get7ItemsItem CALENDAR_VIEW = fromString("calendarView"); - /** Static value conversations for Get7ItemsItem. */ + /** + * Static value conversations for Get7ItemsItem. + */ public static final Get7ItemsItem CONVERSATIONS = fromString("conversations"); - /** Static value events for Get7ItemsItem. */ + /** + * Static value events for Get7ItemsItem. + */ public static final Get7ItemsItem EVENTS = fromString("events"); - /** Static value photo for Get7ItemsItem. */ + /** + * Static value photo for Get7ItemsItem. + */ public static final Get7ItemsItem PHOTO = fromString("photo"); - /** Static value photos for Get7ItemsItem. */ + /** + * Static value photos for Get7ItemsItem. + */ public static final Get7ItemsItem PHOTOS = fromString("photos"); - /** Static value rejectedSenders for Get7ItemsItem. */ + /** + * Static value rejectedSenders for Get7ItemsItem. + */ public static final Get7ItemsItem REJECTED_SENDERS = fromString("rejectedSenders"); - /** Static value threads for Get7ItemsItem. */ + /** + * Static value threads for Get7ItemsItem. + */ public static final Get7ItemsItem THREADS = fromString("threads"); - /** Static value drive for Get7ItemsItem. */ + /** + * Static value drive for Get7ItemsItem. + */ public static final Get7ItemsItem DRIVE = fromString("drive"); - /** Static value drives for Get7ItemsItem. */ + /** + * Static value drives for Get7ItemsItem. + */ public static final Get7ItemsItem DRIVES = fromString("drives"); - /** Static value sites for Get7ItemsItem. */ + /** + * Static value sites for Get7ItemsItem. + */ public static final Get7ItemsItem SITES = fromString("sites"); - /** Static value extensions for Get7ItemsItem. */ + /** + * Static value extensions for Get7ItemsItem. + */ public static final Get7ItemsItem EXTENSIONS = fromString("extensions"); - /** Static value groupLifecyclePolicies for Get7ItemsItem. */ + /** + * Static value groupLifecyclePolicies for Get7ItemsItem. + */ public static final Get7ItemsItem GROUP_LIFECYCLE_POLICIES = fromString("groupLifecyclePolicies"); - /** Static value planner for Get7ItemsItem. */ + /** + * Static value planner for Get7ItemsItem. + */ public static final Get7ItemsItem PLANNER = fromString("planner"); - /** Static value onenote for Get7ItemsItem. */ + /** + * Static value onenote for Get7ItemsItem. + */ public static final Get7ItemsItem ONENOTE = fromString("onenote"); - /** Static value team for Get7ItemsItem. */ + /** + * Static value team for Get7ItemsItem. + */ public static final Get7ItemsItem TEAM = fromString("team"); - /** Static value accountEnabled for Get7ItemsItem. */ + /** + * Static value accountEnabled for Get7ItemsItem. + */ public static final Get7ItemsItem ACCOUNT_ENABLED = fromString("accountEnabled"); - /** Static value ageGroup for Get7ItemsItem. */ + /** + * Static value ageGroup for Get7ItemsItem. + */ public static final Get7ItemsItem AGE_GROUP = fromString("ageGroup"); - /** Static value assignedPlans for Get7ItemsItem. */ + /** + * Static value assignedPlans for Get7ItemsItem. + */ public static final Get7ItemsItem ASSIGNED_PLANS = fromString("assignedPlans"); - /** Static value businessPhones for Get7ItemsItem. */ + /** + * Static value businessPhones for Get7ItemsItem. + */ public static final Get7ItemsItem BUSINESS_PHONES = fromString("businessPhones"); - /** Static value city for Get7ItemsItem. */ + /** + * Static value city for Get7ItemsItem. + */ public static final Get7ItemsItem CITY = fromString("city"); - /** Static value companyName for Get7ItemsItem. */ + /** + * Static value companyName for Get7ItemsItem. + */ public static final Get7ItemsItem COMPANY_NAME = fromString("companyName"); - /** Static value consentProvidedForMinor for Get7ItemsItem. */ + /** + * Static value consentProvidedForMinor for Get7ItemsItem. + */ public static final Get7ItemsItem CONSENT_PROVIDED_FOR_MINOR = fromString("consentProvidedForMinor"); - /** Static value country for Get7ItemsItem. */ + /** + * Static value country for Get7ItemsItem. + */ public static final Get7ItemsItem COUNTRY = fromString("country"); - /** Static value creationType for Get7ItemsItem. */ + /** + * Static value creationType for Get7ItemsItem. + */ public static final Get7ItemsItem CREATION_TYPE = fromString("creationType"); - /** Static value department for Get7ItemsItem. */ + /** + * Static value department for Get7ItemsItem. + */ public static final Get7ItemsItem DEPARTMENT = fromString("department"); - /** Static value employeeHireDate for Get7ItemsItem. */ + /** + * Static value employeeHireDate for Get7ItemsItem. + */ public static final Get7ItemsItem EMPLOYEE_HIRE_DATE = fromString("employeeHireDate"); - /** Static value employeeId for Get7ItemsItem. */ + /** + * Static value employeeId for Get7ItemsItem. + */ public static final Get7ItemsItem EMPLOYEE_ID = fromString("employeeId"); - /** Static value employeeOrgData for Get7ItemsItem. */ + /** + * Static value employeeOrgData for Get7ItemsItem. + */ public static final Get7ItemsItem EMPLOYEE_ORG_DATA = fromString("employeeOrgData"); - /** Static value employeeType for Get7ItemsItem. */ + /** + * Static value employeeType for Get7ItemsItem. + */ public static final Get7ItemsItem EMPLOYEE_TYPE = fromString("employeeType"); - /** Static value externalUserState for Get7ItemsItem. */ + /** + * Static value externalUserState for Get7ItemsItem. + */ public static final Get7ItemsItem EXTERNAL_USER_STATE = fromString("externalUserState"); - /** Static value externalUserStateChangeDateTime for Get7ItemsItem. */ - public static final Get7ItemsItem EXTERNAL_USER_STATE_CHANGE_DATE_TIME = - fromString("externalUserStateChangeDateTime"); + /** + * Static value externalUserStateChangeDateTime for Get7ItemsItem. + */ + public static final Get7ItemsItem EXTERNAL_USER_STATE_CHANGE_DATE_TIME + = fromString("externalUserStateChangeDateTime"); - /** Static value faxNumber for Get7ItemsItem. */ + /** + * Static value faxNumber for Get7ItemsItem. + */ public static final Get7ItemsItem FAX_NUMBER = fromString("faxNumber"); - /** Static value givenName for Get7ItemsItem. */ + /** + * Static value givenName for Get7ItemsItem. + */ public static final Get7ItemsItem GIVEN_NAME = fromString("givenName"); - /** Static value identities for Get7ItemsItem. */ + /** + * Static value identities for Get7ItemsItem. + */ public static final Get7ItemsItem IDENTITIES = fromString("identities"); - /** Static value imAddresses for Get7ItemsItem. */ + /** + * Static value imAddresses for Get7ItemsItem. + */ public static final Get7ItemsItem IM_ADDRESSES = fromString("imAddresses"); - /** Static value isResourceAccount for Get7ItemsItem. */ + /** + * Static value isResourceAccount for Get7ItemsItem. + */ public static final Get7ItemsItem IS_RESOURCE_ACCOUNT = fromString("isResourceAccount"); - /** Static value jobTitle for Get7ItemsItem. */ + /** + * Static value jobTitle for Get7ItemsItem. + */ public static final Get7ItemsItem JOB_TITLE = fromString("jobTitle"); - /** Static value lastPasswordChangeDateTime for Get7ItemsItem. */ + /** + * Static value lastPasswordChangeDateTime for Get7ItemsItem. + */ public static final Get7ItemsItem LAST_PASSWORD_CHANGE_DATE_TIME = fromString("lastPasswordChangeDateTime"); - /** Static value legalAgeGroupClassification for Get7ItemsItem. */ + /** + * Static value legalAgeGroupClassification for Get7ItemsItem. + */ public static final Get7ItemsItem LEGAL_AGE_GROUP_CLASSIFICATION = fromString("legalAgeGroupClassification"); - /** Static value licenseAssignmentStates for Get7ItemsItem. */ + /** + * Static value licenseAssignmentStates for Get7ItemsItem. + */ public static final Get7ItemsItem LICENSE_ASSIGNMENT_STATES = fromString("licenseAssignmentStates"); - /** Static value mobilePhone for Get7ItemsItem. */ + /** + * Static value mobilePhone for Get7ItemsItem. + */ public static final Get7ItemsItem MOBILE_PHONE = fromString("mobilePhone"); - /** Static value officeLocation for Get7ItemsItem. */ + /** + * Static value officeLocation for Get7ItemsItem. + */ public static final Get7ItemsItem OFFICE_LOCATION = fromString("officeLocation"); - /** Static value onPremisesDistinguishedName for Get7ItemsItem. */ + /** + * Static value onPremisesDistinguishedName for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_DISTINGUISHED_NAME = fromString("onPremisesDistinguishedName"); - /** Static value onPremisesExtensionAttributes for Get7ItemsItem. */ + /** + * Static value onPremisesExtensionAttributes for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_EXTENSION_ATTRIBUTES = fromString("onPremisesExtensionAttributes"); - /** Static value onPremisesImmutableId for Get7ItemsItem. */ + /** + * Static value onPremisesImmutableId for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_IMMUTABLE_ID = fromString("onPremisesImmutableId"); - /** Static value onPremisesUserPrincipalName for Get7ItemsItem. */ + /** + * Static value onPremisesUserPrincipalName for Get7ItemsItem. + */ public static final Get7ItemsItem ON_PREMISES_USER_PRINCIPAL_NAME = fromString("onPremisesUserPrincipalName"); - /** Static value otherMails for Get7ItemsItem. */ + /** + * Static value otherMails for Get7ItemsItem. + */ public static final Get7ItemsItem OTHER_MAILS = fromString("otherMails"); - /** Static value passwordPolicies for Get7ItemsItem. */ + /** + * Static value passwordPolicies for Get7ItemsItem. + */ public static final Get7ItemsItem PASSWORD_POLICIES = fromString("passwordPolicies"); - /** Static value passwordProfile for Get7ItemsItem. */ + /** + * Static value passwordProfile for Get7ItemsItem. + */ public static final Get7ItemsItem PASSWORD_PROFILE = fromString("passwordProfile"); - /** Static value postalCode for Get7ItemsItem. */ + /** + * Static value postalCode for Get7ItemsItem. + */ public static final Get7ItemsItem POSTAL_CODE = fromString("postalCode"); - /** Static value provisionedPlans for Get7ItemsItem. */ + /** + * Static value provisionedPlans for Get7ItemsItem. + */ public static final Get7ItemsItem PROVISIONED_PLANS = fromString("provisionedPlans"); - /** Static value showInAddressList for Get7ItemsItem. */ + /** + * Static value showInAddressList for Get7ItemsItem. + */ public static final Get7ItemsItem SHOW_IN_ADDRESS_LIST = fromString("showInAddressList"); - /** Static value signInSessionsValidFromDateTime for Get7ItemsItem. */ - public static final Get7ItemsItem SIGN_IN_SESSIONS_VALID_FROM_DATE_TIME = - fromString("signInSessionsValidFromDateTime"); + /** + * Static value signInSessionsValidFromDateTime for Get7ItemsItem. + */ + public static final Get7ItemsItem SIGN_IN_SESSIONS_VALID_FROM_DATE_TIME + = fromString("signInSessionsValidFromDateTime"); - /** Static value state for Get7ItemsItem. */ + /** + * Static value state for Get7ItemsItem. + */ public static final Get7ItemsItem STATE = fromString("state"); - /** Static value streetAddress for Get7ItemsItem. */ + /** + * Static value streetAddress for Get7ItemsItem. + */ public static final Get7ItemsItem STREET_ADDRESS = fromString("streetAddress"); - /** Static value surname for Get7ItemsItem. */ + /** + * Static value surname for Get7ItemsItem. + */ public static final Get7ItemsItem SURNAME = fromString("surname"); - /** Static value usageLocation for Get7ItemsItem. */ + /** + * Static value usageLocation for Get7ItemsItem. + */ public static final Get7ItemsItem USAGE_LOCATION = fromString("usageLocation"); - /** Static value userPrincipalName for Get7ItemsItem. */ + /** + * Static value userPrincipalName for Get7ItemsItem. + */ public static final Get7ItemsItem USER_PRINCIPAL_NAME = fromString("userPrincipalName"); - /** Static value userType for Get7ItemsItem. */ + /** + * Static value userType for Get7ItemsItem. + */ public static final Get7ItemsItem USER_TYPE = fromString("userType"); - /** Static value mailboxSettings for Get7ItemsItem. */ + /** + * Static value mailboxSettings for Get7ItemsItem. + */ public static final Get7ItemsItem MAILBOX_SETTINGS = fromString("mailboxSettings"); - /** Static value deviceEnrollmentLimit for Get7ItemsItem. */ + /** + * Static value deviceEnrollmentLimit for Get7ItemsItem. + */ public static final Get7ItemsItem DEVICE_ENROLLMENT_LIMIT = fromString("deviceEnrollmentLimit"); - /** Static value aboutMe for Get7ItemsItem. */ + /** + * Static value aboutMe for Get7ItemsItem. + */ public static final Get7ItemsItem ABOUT_ME = fromString("aboutMe"); - /** Static value birthday for Get7ItemsItem. */ + /** + * Static value birthday for Get7ItemsItem. + */ public static final Get7ItemsItem BIRTHDAY = fromString("birthday"); - /** Static value hireDate for Get7ItemsItem. */ + /** + * Static value hireDate for Get7ItemsItem. + */ public static final Get7ItemsItem HIRE_DATE = fromString("hireDate"); - /** Static value interests for Get7ItemsItem. */ + /** + * Static value interests for Get7ItemsItem. + */ public static final Get7ItemsItem INTERESTS = fromString("interests"); - /** Static value mySite for Get7ItemsItem. */ + /** + * Static value mySite for Get7ItemsItem. + */ public static final Get7ItemsItem MY_SITE = fromString("mySite"); - /** Static value pastProjects for Get7ItemsItem. */ + /** + * Static value pastProjects for Get7ItemsItem. + */ public static final Get7ItemsItem PAST_PROJECTS = fromString("pastProjects"); - /** Static value preferredName for Get7ItemsItem. */ + /** + * Static value preferredName for Get7ItemsItem. + */ public static final Get7ItemsItem PREFERRED_NAME = fromString("preferredName"); - /** Static value responsibilities for Get7ItemsItem. */ + /** + * Static value responsibilities for Get7ItemsItem. + */ public static final Get7ItemsItem RESPONSIBILITIES = fromString("responsibilities"); - /** Static value schools for Get7ItemsItem. */ + /** + * Static value schools for Get7ItemsItem. + */ public static final Get7ItemsItem SCHOOLS = fromString("schools"); - /** Static value skills for Get7ItemsItem. */ + /** + * Static value skills for Get7ItemsItem. + */ public static final Get7ItemsItem SKILLS = fromString("skills"); - /** Static value createdObjects for Get7ItemsItem. */ + /** + * Static value createdObjects for Get7ItemsItem. + */ public static final Get7ItemsItem CREATED_OBJECTS = fromString("createdObjects"); - /** Static value directReports for Get7ItemsItem. */ + /** + * Static value directReports for Get7ItemsItem. + */ public static final Get7ItemsItem DIRECT_REPORTS = fromString("directReports"); - /** Static value licenseDetails for Get7ItemsItem. */ + /** + * Static value licenseDetails for Get7ItemsItem. + */ public static final Get7ItemsItem LICENSE_DETAILS = fromString("licenseDetails"); - /** Static value manager for Get7ItemsItem. */ + /** + * Static value manager for Get7ItemsItem. + */ public static final Get7ItemsItem MANAGER = fromString("manager"); - /** Static value oauth2PermissionGrants for Get7ItemsItem. */ + /** + * Static value oauth2PermissionGrants for Get7ItemsItem. + */ public static final Get7ItemsItem OAUTH2PERMISSION_GRANTS = fromString("oauth2PermissionGrants"); - /** Static value ownedDevices for Get7ItemsItem. */ + /** + * Static value ownedDevices for Get7ItemsItem. + */ public static final Get7ItemsItem OWNED_DEVICES = fromString("ownedDevices"); - /** Static value ownedObjects for Get7ItemsItem. */ + /** + * Static value ownedObjects for Get7ItemsItem. + */ public static final Get7ItemsItem OWNED_OBJECTS = fromString("ownedObjects"); - /** Static value registeredDevices for Get7ItemsItem. */ + /** + * Static value registeredDevices for Get7ItemsItem. + */ public static final Get7ItemsItem REGISTERED_DEVICES = fromString("registeredDevices"); - /** Static value scopedRoleMemberOf for Get7ItemsItem. */ + /** + * Static value scopedRoleMemberOf for Get7ItemsItem. + */ public static final Get7ItemsItem SCOPED_ROLE_MEMBER_OF = fromString("scopedRoleMemberOf"); - /** Static value calendarGroups for Get7ItemsItem. */ + /** + * Static value calendarGroups for Get7ItemsItem. + */ public static final Get7ItemsItem CALENDAR_GROUPS = fromString("calendarGroups"); - /** Static value calendars for Get7ItemsItem. */ + /** + * Static value calendars for Get7ItemsItem. + */ public static final Get7ItemsItem CALENDARS = fromString("calendars"); - /** Static value contactFolders for Get7ItemsItem. */ + /** + * Static value contactFolders for Get7ItemsItem. + */ public static final Get7ItemsItem CONTACT_FOLDERS = fromString("contactFolders"); - /** Static value contacts for Get7ItemsItem. */ + /** + * Static value contacts for Get7ItemsItem. + */ public static final Get7ItemsItem CONTACTS = fromString("contacts"); - /** Static value inferenceClassification for Get7ItemsItem. */ + /** + * Static value inferenceClassification for Get7ItemsItem. + */ public static final Get7ItemsItem INFERENCE_CLASSIFICATION = fromString("inferenceClassification"); - /** Static value mailFolders for Get7ItemsItem. */ + /** + * Static value mailFolders for Get7ItemsItem. + */ public static final Get7ItemsItem MAIL_FOLDERS = fromString("mailFolders"); - /** Static value messages for Get7ItemsItem. */ + /** + * Static value messages for Get7ItemsItem. + */ public static final Get7ItemsItem MESSAGES = fromString("messages"); - /** Static value outlook for Get7ItemsItem. */ + /** + * Static value outlook for Get7ItemsItem. + */ public static final Get7ItemsItem OUTLOOK = fromString("outlook"); - /** Static value people for Get7ItemsItem. */ + /** + * Static value people for Get7ItemsItem. + */ public static final Get7ItemsItem PEOPLE = fromString("people"); - /** Static value followedSites for Get7ItemsItem. */ + /** + * Static value followedSites for Get7ItemsItem. + */ public static final Get7ItemsItem FOLLOWED_SITES = fromString("followedSites"); - /** Static value managedDevices for Get7ItemsItem. */ + /** + * Static value managedDevices for Get7ItemsItem. + */ public static final Get7ItemsItem MANAGED_DEVICES = fromString("managedDevices"); - /** Static value managedAppRegistrations for Get7ItemsItem. */ + /** + * Static value managedAppRegistrations for Get7ItemsItem. + */ public static final Get7ItemsItem MANAGED_APP_REGISTRATIONS = fromString("managedAppRegistrations"); - /** Static value deviceManagementTroubleshootingEvents for Get7ItemsItem. */ - public static final Get7ItemsItem DEVICE_MANAGEMENT_TROUBLESHOOTING_EVENTS = - fromString("deviceManagementTroubleshootingEvents"); + /** + * Static value deviceManagementTroubleshootingEvents for Get7ItemsItem. + */ + public static final Get7ItemsItem DEVICE_MANAGEMENT_TROUBLESHOOTING_EVENTS + = fromString("deviceManagementTroubleshootingEvents"); - /** Static value insights for Get7ItemsItem. */ + /** + * Static value insights for Get7ItemsItem. + */ public static final Get7ItemsItem INSIGHTS = fromString("insights"); - /** Static value activities for Get7ItemsItem. */ + /** + * Static value activities for Get7ItemsItem. + */ public static final Get7ItemsItem ACTIVITIES = fromString("activities"); - /** Static value onlineMeetings for Get7ItemsItem. */ + /** + * Static value onlineMeetings for Get7ItemsItem. + */ public static final Get7ItemsItem ONLINE_MEETINGS = fromString("onlineMeetings"); - /** Static value presence for Get7ItemsItem. */ + /** + * Static value presence for Get7ItemsItem. + */ public static final Get7ItemsItem PRESENCE = fromString("presence"); - /** Static value joinedTeams for Get7ItemsItem. */ + /** + * Static value joinedTeams for Get7ItemsItem. + */ public static final Get7ItemsItem JOINED_TEAMS = fromString("joinedTeams"); - /** Static value teamwork for Get7ItemsItem. */ + /** + * Static value teamwork for Get7ItemsItem. + */ public static final Get7ItemsItem TEAMWORK = fromString("teamwork"); - /** Static value todo for Get7ItemsItem. */ + /** + * Static value todo for Get7ItemsItem. + */ public static final Get7ItemsItem TODO = fromString("todo"); - /** Static value * for Get7ItemsItem. */ + /** + * Static value * for Get7ItemsItem. + */ public static final Get7ItemsItem ASTERISK = fromString("*"); - /** Static value domainNameReferences for Get7ItemsItem. */ + /** + * Static value domainNameReferences for Get7ItemsItem. + */ public static final Get7ItemsItem DOMAIN_NAME_REFERENCES = fromString("domainNameReferences"); - /** Static value serviceConfigurationRecords for Get7ItemsItem. */ + /** + * Static value serviceConfigurationRecords for Get7ItemsItem. + */ public static final Get7ItemsItem SERVICE_CONFIGURATION_RECORDS = fromString("serviceConfigurationRecords"); - /** Static value verificationDnsRecords for Get7ItemsItem. */ + /** + * Static value verificationDnsRecords for Get7ItemsItem. + */ public static final Get7ItemsItem VERIFICATION_DNS_RECORDS = fromString("verificationDnsRecords"); /** * Creates a new instance of Get7ItemsItem value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -573,18 +940,17 @@ public Get7ItemsItem() { /** * Creates or finds a Get7ItemsItem from its string representation. - * + * * @param name a name to look for. * @return the corresponding Get7ItemsItem. */ - @JsonCreator public static Get7ItemsItem fromString(String name) { return fromString(name, Get7ItemsItem.class); } /** * Gets known Get7ItemsItem values. - * + * * @return known Get7ItemsItem values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get8ItemsItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get8ItemsItem.java index 36e7707965319..434e3ac7217e2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get8ItemsItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/Get8ItemsItem.java @@ -5,198 +5,321 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Get8ItemsItem. */ +/** + * Defines values for Get8ItemsItem. + */ public final class Get8ItemsItem extends ExpandableStringEnum { - /** Static value * for Get8ItemsItem. */ + /** + * Static value * for Get8ItemsItem. + */ public static final Get8ItemsItem ASTERISK = fromString("*"); - /** Static value createdOnBehalfOf for Get8ItemsItem. */ + /** + * Static value createdOnBehalfOf for Get8ItemsItem. + */ public static final Get8ItemsItem CREATED_ON_BEHALF_OF = fromString("createdOnBehalfOf"); - /** Static value extensionProperties for Get8ItemsItem. */ + /** + * Static value extensionProperties for Get8ItemsItem. + */ public static final Get8ItemsItem EXTENSION_PROPERTIES = fromString("extensionProperties"); - /** Static value homeRealmDiscoveryPolicies for Get8ItemsItem. */ + /** + * Static value homeRealmDiscoveryPolicies for Get8ItemsItem. + */ public static final Get8ItemsItem HOME_REALM_DISCOVERY_POLICIES = fromString("homeRealmDiscoveryPolicies"); - /** Static value owners for Get8ItemsItem. */ + /** + * Static value owners for Get8ItemsItem. + */ public static final Get8ItemsItem OWNERS = fromString("owners"); - /** Static value tokenIssuancePolicies for Get8ItemsItem. */ + /** + * Static value tokenIssuancePolicies for Get8ItemsItem. + */ public static final Get8ItemsItem TOKEN_ISSUANCE_POLICIES = fromString("tokenIssuancePolicies"); - /** Static value tokenLifetimePolicies for Get8ItemsItem. */ + /** + * Static value tokenLifetimePolicies for Get8ItemsItem. + */ public static final Get8ItemsItem TOKEN_LIFETIME_POLICIES = fromString("tokenLifetimePolicies"); - /** Static value appRoleAssignments for Get8ItemsItem. */ + /** + * Static value appRoleAssignments for Get8ItemsItem. + */ public static final Get8ItemsItem APP_ROLE_ASSIGNMENTS = fromString("appRoleAssignments"); - /** Static value memberOf for Get8ItemsItem. */ + /** + * Static value memberOf for Get8ItemsItem. + */ public static final Get8ItemsItem MEMBER_OF = fromString("memberOf"); - /** Static value members for Get8ItemsItem. */ + /** + * Static value members for Get8ItemsItem. + */ public static final Get8ItemsItem MEMBERS = fromString("members"); - /** Static value membersWithLicenseErrors for Get8ItemsItem. */ + /** + * Static value membersWithLicenseErrors for Get8ItemsItem. + */ public static final Get8ItemsItem MEMBERS_WITH_LICENSE_ERRORS = fromString("membersWithLicenseErrors"); - /** Static value permissionGrants for Get8ItemsItem. */ + /** + * Static value permissionGrants for Get8ItemsItem. + */ public static final Get8ItemsItem PERMISSION_GRANTS = fromString("permissionGrants"); - /** Static value settings for Get8ItemsItem. */ + /** + * Static value settings for Get8ItemsItem. + */ public static final Get8ItemsItem SETTINGS = fromString("settings"); - /** Static value transitiveMemberOf for Get8ItemsItem. */ + /** + * Static value transitiveMemberOf for Get8ItemsItem. + */ public static final Get8ItemsItem TRANSITIVE_MEMBER_OF = fromString("transitiveMemberOf"); - /** Static value transitiveMembers for Get8ItemsItem. */ + /** + * Static value transitiveMembers for Get8ItemsItem. + */ public static final Get8ItemsItem TRANSITIVE_MEMBERS = fromString("transitiveMembers"); - /** Static value acceptedSenders for Get8ItemsItem. */ + /** + * Static value acceptedSenders for Get8ItemsItem. + */ public static final Get8ItemsItem ACCEPTED_SENDERS = fromString("acceptedSenders"); - /** Static value calendar for Get8ItemsItem. */ + /** + * Static value calendar for Get8ItemsItem. + */ public static final Get8ItemsItem CALENDAR = fromString("calendar"); - /** Static value calendarView for Get8ItemsItem. */ + /** + * Static value calendarView for Get8ItemsItem. + */ public static final Get8ItemsItem CALENDAR_VIEW = fromString("calendarView"); - /** Static value conversations for Get8ItemsItem. */ + /** + * Static value conversations for Get8ItemsItem. + */ public static final Get8ItemsItem CONVERSATIONS = fromString("conversations"); - /** Static value events for Get8ItemsItem. */ + /** + * Static value events for Get8ItemsItem. + */ public static final Get8ItemsItem EVENTS = fromString("events"); - /** Static value photo for Get8ItemsItem. */ + /** + * Static value photo for Get8ItemsItem. + */ public static final Get8ItemsItem PHOTO = fromString("photo"); - /** Static value photos for Get8ItemsItem. */ + /** + * Static value photos for Get8ItemsItem. + */ public static final Get8ItemsItem PHOTOS = fromString("photos"); - /** Static value rejectedSenders for Get8ItemsItem. */ + /** + * Static value rejectedSenders for Get8ItemsItem. + */ public static final Get8ItemsItem REJECTED_SENDERS = fromString("rejectedSenders"); - /** Static value threads for Get8ItemsItem. */ + /** + * Static value threads for Get8ItemsItem. + */ public static final Get8ItemsItem THREADS = fromString("threads"); - /** Static value drive for Get8ItemsItem. */ + /** + * Static value drive for Get8ItemsItem. + */ public static final Get8ItemsItem DRIVE = fromString("drive"); - /** Static value drives for Get8ItemsItem. */ + /** + * Static value drives for Get8ItemsItem. + */ public static final Get8ItemsItem DRIVES = fromString("drives"); - /** Static value sites for Get8ItemsItem. */ + /** + * Static value sites for Get8ItemsItem. + */ public static final Get8ItemsItem SITES = fromString("sites"); - /** Static value extensions for Get8ItemsItem. */ + /** + * Static value extensions for Get8ItemsItem. + */ public static final Get8ItemsItem EXTENSIONS = fromString("extensions"); - /** Static value groupLifecyclePolicies for Get8ItemsItem. */ + /** + * Static value groupLifecyclePolicies for Get8ItemsItem. + */ public static final Get8ItemsItem GROUP_LIFECYCLE_POLICIES = fromString("groupLifecyclePolicies"); - /** Static value planner for Get8ItemsItem. */ + /** + * Static value planner for Get8ItemsItem. + */ public static final Get8ItemsItem PLANNER = fromString("planner"); - /** Static value onenote for Get8ItemsItem. */ + /** + * Static value onenote for Get8ItemsItem. + */ public static final Get8ItemsItem ONENOTE = fromString("onenote"); - /** Static value team for Get8ItemsItem. */ + /** + * Static value team for Get8ItemsItem. + */ public static final Get8ItemsItem TEAM = fromString("team"); - /** Static value createdObjects for Get8ItemsItem. */ + /** + * Static value createdObjects for Get8ItemsItem. + */ public static final Get8ItemsItem CREATED_OBJECTS = fromString("createdObjects"); - /** Static value directReports for Get8ItemsItem. */ + /** + * Static value directReports for Get8ItemsItem. + */ public static final Get8ItemsItem DIRECT_REPORTS = fromString("directReports"); - /** Static value licenseDetails for Get8ItemsItem. */ + /** + * Static value licenseDetails for Get8ItemsItem. + */ public static final Get8ItemsItem LICENSE_DETAILS = fromString("licenseDetails"); - /** Static value manager for Get8ItemsItem. */ + /** + * Static value manager for Get8ItemsItem. + */ public static final Get8ItemsItem MANAGER = fromString("manager"); - /** Static value oauth2PermissionGrants for Get8ItemsItem. */ + /** + * Static value oauth2PermissionGrants for Get8ItemsItem. + */ public static final Get8ItemsItem OAUTH2PERMISSION_GRANTS = fromString("oauth2PermissionGrants"); - /** Static value ownedDevices for Get8ItemsItem. */ + /** + * Static value ownedDevices for Get8ItemsItem. + */ public static final Get8ItemsItem OWNED_DEVICES = fromString("ownedDevices"); - /** Static value ownedObjects for Get8ItemsItem. */ + /** + * Static value ownedObjects for Get8ItemsItem. + */ public static final Get8ItemsItem OWNED_OBJECTS = fromString("ownedObjects"); - /** Static value registeredDevices for Get8ItemsItem. */ + /** + * Static value registeredDevices for Get8ItemsItem. + */ public static final Get8ItemsItem REGISTERED_DEVICES = fromString("registeredDevices"); - /** Static value scopedRoleMemberOf for Get8ItemsItem. */ + /** + * Static value scopedRoleMemberOf for Get8ItemsItem. + */ public static final Get8ItemsItem SCOPED_ROLE_MEMBER_OF = fromString("scopedRoleMemberOf"); - /** Static value calendarGroups for Get8ItemsItem. */ + /** + * Static value calendarGroups for Get8ItemsItem. + */ public static final Get8ItemsItem CALENDAR_GROUPS = fromString("calendarGroups"); - /** Static value calendars for Get8ItemsItem. */ + /** + * Static value calendars for Get8ItemsItem. + */ public static final Get8ItemsItem CALENDARS = fromString("calendars"); - /** Static value contactFolders for Get8ItemsItem. */ + /** + * Static value contactFolders for Get8ItemsItem. + */ public static final Get8ItemsItem CONTACT_FOLDERS = fromString("contactFolders"); - /** Static value contacts for Get8ItemsItem. */ + /** + * Static value contacts for Get8ItemsItem. + */ public static final Get8ItemsItem CONTACTS = fromString("contacts"); - /** Static value inferenceClassification for Get8ItemsItem. */ + /** + * Static value inferenceClassification for Get8ItemsItem. + */ public static final Get8ItemsItem INFERENCE_CLASSIFICATION = fromString("inferenceClassification"); - /** Static value mailFolders for Get8ItemsItem. */ + /** + * Static value mailFolders for Get8ItemsItem. + */ public static final Get8ItemsItem MAIL_FOLDERS = fromString("mailFolders"); - /** Static value messages for Get8ItemsItem. */ + /** + * Static value messages for Get8ItemsItem. + */ public static final Get8ItemsItem MESSAGES = fromString("messages"); - /** Static value outlook for Get8ItemsItem. */ + /** + * Static value outlook for Get8ItemsItem. + */ public static final Get8ItemsItem OUTLOOK = fromString("outlook"); - /** Static value people for Get8ItemsItem. */ + /** + * Static value people for Get8ItemsItem. + */ public static final Get8ItemsItem PEOPLE = fromString("people"); - /** Static value followedSites for Get8ItemsItem. */ + /** + * Static value followedSites for Get8ItemsItem. + */ public static final Get8ItemsItem FOLLOWED_SITES = fromString("followedSites"); - /** Static value managedDevices for Get8ItemsItem. */ + /** + * Static value managedDevices for Get8ItemsItem. + */ public static final Get8ItemsItem MANAGED_DEVICES = fromString("managedDevices"); - /** Static value managedAppRegistrations for Get8ItemsItem. */ + /** + * Static value managedAppRegistrations for Get8ItemsItem. + */ public static final Get8ItemsItem MANAGED_APP_REGISTRATIONS = fromString("managedAppRegistrations"); - /** Static value deviceManagementTroubleshootingEvents for Get8ItemsItem. */ - public static final Get8ItemsItem DEVICE_MANAGEMENT_TROUBLESHOOTING_EVENTS = - fromString("deviceManagementTroubleshootingEvents"); + /** + * Static value deviceManagementTroubleshootingEvents for Get8ItemsItem. + */ + public static final Get8ItemsItem DEVICE_MANAGEMENT_TROUBLESHOOTING_EVENTS + = fromString("deviceManagementTroubleshootingEvents"); - /** Static value insights for Get8ItemsItem. */ + /** + * Static value insights for Get8ItemsItem. + */ public static final Get8ItemsItem INSIGHTS = fromString("insights"); - /** Static value activities for Get8ItemsItem. */ + /** + * Static value activities for Get8ItemsItem. + */ public static final Get8ItemsItem ACTIVITIES = fromString("activities"); - /** Static value onlineMeetings for Get8ItemsItem. */ + /** + * Static value onlineMeetings for Get8ItemsItem. + */ public static final Get8ItemsItem ONLINE_MEETINGS = fromString("onlineMeetings"); - /** Static value presence for Get8ItemsItem. */ + /** + * Static value presence for Get8ItemsItem. + */ public static final Get8ItemsItem PRESENCE = fromString("presence"); - /** Static value joinedTeams for Get8ItemsItem. */ + /** + * Static value joinedTeams for Get8ItemsItem. + */ public static final Get8ItemsItem JOINED_TEAMS = fromString("joinedTeams"); - /** Static value teamwork for Get8ItemsItem. */ + /** + * Static value teamwork for Get8ItemsItem. + */ public static final Get8ItemsItem TEAMWORK = fromString("teamwork"); - /** Static value todo for Get8ItemsItem. */ + /** + * Static value todo for Get8ItemsItem. + */ public static final Get8ItemsItem TODO = fromString("todo"); /** * Creates a new instance of Get8ItemsItem value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -205,18 +328,17 @@ public Get8ItemsItem() { /** * Creates or finds a Get8ItemsItem from its string representation. - * + * * @param name a name to look for. * @return the corresponding Get8ItemsItem. */ - @JsonCreator public static Get8ItemsItem fromString(String name) { return fromString(name, Get8ItemsItem.class); } /** * Gets known Get8ItemsItem values. - * + * * @return known Get8ItemsItem values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/GroupsOrderby.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/GroupsOrderby.java index d6306db124eb9..226241d0dace2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/GroupsOrderby.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/GroupsOrderby.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for GroupsOrderby. */ +/** + * Defines values for GroupsOrderby. + */ public final class GroupsOrderby extends ExpandableStringEnum { - /** Static value id for GroupsOrderby. */ + /** + * Static value id for GroupsOrderby. + */ public static final GroupsOrderby ID = fromString("id"); - /** Static value id desc for GroupsOrderby. */ + /** + * Static value id desc for GroupsOrderby. + */ public static final GroupsOrderby ID_DESC = fromString("id desc"); - /** Static value deletedDateTime for GroupsOrderby. */ + /** + * Static value deletedDateTime for GroupsOrderby. + */ public static final GroupsOrderby DELETED_DATE_TIME = fromString("deletedDateTime"); - /** Static value deletedDateTime desc for GroupsOrderby. */ + /** + * Static value deletedDateTime desc for GroupsOrderby. + */ public static final GroupsOrderby DELETED_DATE_TIME_DESC = fromString("deletedDateTime desc"); /** * Creates a new instance of GroupsOrderby value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public GroupsOrderby() { /** * Creates or finds a GroupsOrderby from its string representation. - * + * * @param name a name to look for. * @return the corresponding GroupsOrderby. */ - @JsonCreator public static GroupsOrderby fromString(String name) { return fromString(name, GroupsOrderby.class); } /** * Gets known GroupsOrderby values. - * + * * @return known GroupsOrderby values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/GroupsSelect.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/GroupsSelect.java index a138bbea0bbd8..b6b4785dc51a5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/GroupsSelect.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/GroupsSelect.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for GroupsSelect. */ +/** + * Defines values for GroupsSelect. + */ public final class GroupsSelect extends ExpandableStringEnum { - /** Static value id for GroupsSelect. */ + /** + * Static value id for GroupsSelect. + */ public static final GroupsSelect ID = fromString("id"); - /** Static value deletedDateTime for GroupsSelect. */ + /** + * Static value deletedDateTime for GroupsSelect. + */ public static final GroupsSelect DELETED_DATE_TIME = fromString("deletedDateTime"); /** * Creates a new instance of GroupsSelect value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public GroupsSelect() { /** * Creates or finds a GroupsSelect from its string representation. - * + * * @param name a name to look for. * @return the corresponding GroupsSelect. */ - @JsonCreator public static GroupsSelect fromString(String name) { return fromString(name, GroupsSelect.class); } /** * Gets known GroupsSelect values. - * + * * @return known GroupsSelect values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphActionState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphActionState.java index fd0a3d0cee3f6..2f296205c64bc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphActionState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphActionState.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** actionState. */ +/** + * actionState. + */ public final class MicrosoftGraphActionState extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphActionState. */ + /** + * Static value none for MicrosoftGraphActionState. + */ public static final MicrosoftGraphActionState NONE = fromString("none"); - /** Static value pending for MicrosoftGraphActionState. */ + /** + * Static value pending for MicrosoftGraphActionState. + */ public static final MicrosoftGraphActionState PENDING = fromString("pending"); - /** Static value canceled for MicrosoftGraphActionState. */ + /** + * Static value canceled for MicrosoftGraphActionState. + */ public static final MicrosoftGraphActionState CANCELED = fromString("canceled"); - /** Static value active for MicrosoftGraphActionState. */ + /** + * Static value active for MicrosoftGraphActionState. + */ public static final MicrosoftGraphActionState ACTIVE = fromString("active"); - /** Static value done for MicrosoftGraphActionState. */ + /** + * Static value done for MicrosoftGraphActionState. + */ public static final MicrosoftGraphActionState DONE = fromString("done"); - /** Static value failed for MicrosoftGraphActionState. */ + /** + * Static value failed for MicrosoftGraphActionState. + */ public static final MicrosoftGraphActionState FAILED = fromString("failed"); - /** Static value notSupported for MicrosoftGraphActionState. */ + /** + * Static value notSupported for MicrosoftGraphActionState. + */ public static final MicrosoftGraphActionState NOT_SUPPORTED = fromString("notSupported"); /** * Creates a new instance of MicrosoftGraphActionState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public MicrosoftGraphActionState() { /** * Creates or finds a MicrosoftGraphActionState from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphActionState. */ - @JsonCreator public static MicrosoftGraphActionState fromString(String name) { return fromString(name, MicrosoftGraphActionState.class); } /** * Gets known MicrosoftGraphActionState values. - * + * * @return known MicrosoftGraphActionState values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphActivityHistoryItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphActivityHistoryItem.java index e8d6a44c6efd3..acb499cc3b582 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphActivityHistoryItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphActivityHistoryItem.java @@ -5,87 +5,84 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** activityHistoryItem. */ +/** + * activityHistoryItem. + */ @Fluent public final class MicrosoftGraphActivityHistoryItem extends MicrosoftGraphEntity { /* * Optional. The duration of active user engagement. if not supplied, this is calculated from the startedDateTime * and lastActiveDateTime. */ - @JsonProperty(value = "activeDurationSeconds") private Integer activeDurationSeconds; /* * Set by the server. DateTime in UTC when the object was created on the server. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * Optional. UTC DateTime when the historyItem will undergo hard-delete. Can be set by the client. */ - @JsonProperty(value = "expirationDateTime") private OffsetDateTime expirationDateTime; /* * Optional. UTC DateTime when the historyItem (activity session) was last understood as active or finished - if * null, historyItem status should be Ongoing. */ - @JsonProperty(value = "lastActiveDateTime") private OffsetDateTime lastActiveDateTime; /* * Set by the server. DateTime in UTC when the object was modified on the server. */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * Required. UTC DateTime when the historyItem (activity session) was started. Required for timeline history. */ - @JsonProperty(value = "startedDateTime") private OffsetDateTime startedDateTime; /* * status */ - @JsonProperty(value = "status") private MicrosoftGraphStatus status; /* * Optional. The timezone in which the user's device used to generate the activity was located at activity creation * time. Values supplied as Olson IDs in order to support cross-platform representation. */ - @JsonProperty(value = "userTimezone") private String userTimezone; /* * userActivity */ - @JsonProperty(value = "activity") private MicrosoftGraphUserActivity activity; /* * activityHistoryItem */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphActivityHistoryItem class. */ + /** + * Creates an instance of MicrosoftGraphActivityHistoryItem class. + */ public MicrosoftGraphActivityHistoryItem() { } /** * Get the activeDurationSeconds property: Optional. The duration of active user engagement. if not supplied, this * is calculated from the startedDateTime and lastActiveDateTime. - * + * * @return the activeDurationSeconds value. */ public Integer activeDurationSeconds() { @@ -95,7 +92,7 @@ public Integer activeDurationSeconds() { /** * Set the activeDurationSeconds property: Optional. The duration of active user engagement. if not supplied, this * is calculated from the startedDateTime and lastActiveDateTime. - * + * * @param activeDurationSeconds the activeDurationSeconds value to set. * @return the MicrosoftGraphActivityHistoryItem object itself. */ @@ -106,7 +103,7 @@ public MicrosoftGraphActivityHistoryItem withActiveDurationSeconds(Integer activ /** * Get the createdDateTime property: Set by the server. DateTime in UTC when the object was created on the server. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -115,7 +112,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: Set by the server. DateTime in UTC when the object was created on the server. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphActivityHistoryItem object itself. */ @@ -127,7 +124,7 @@ public MicrosoftGraphActivityHistoryItem withCreatedDateTime(OffsetDateTime crea /** * Get the expirationDateTime property: Optional. UTC DateTime when the historyItem will undergo hard-delete. Can be * set by the client. - * + * * @return the expirationDateTime value. */ public OffsetDateTime expirationDateTime() { @@ -137,7 +134,7 @@ public OffsetDateTime expirationDateTime() { /** * Set the expirationDateTime property: Optional. UTC DateTime when the historyItem will undergo hard-delete. Can be * set by the client. - * + * * @param expirationDateTime the expirationDateTime value to set. * @return the MicrosoftGraphActivityHistoryItem object itself. */ @@ -149,7 +146,7 @@ public MicrosoftGraphActivityHistoryItem withExpirationDateTime(OffsetDateTime e /** * Get the lastActiveDateTime property: Optional. UTC DateTime when the historyItem (activity session) was last * understood as active or finished - if null, historyItem status should be Ongoing. - * + * * @return the lastActiveDateTime value. */ public OffsetDateTime lastActiveDateTime() { @@ -159,7 +156,7 @@ public OffsetDateTime lastActiveDateTime() { /** * Set the lastActiveDateTime property: Optional. UTC DateTime when the historyItem (activity session) was last * understood as active or finished - if null, historyItem status should be Ongoing. - * + * * @param lastActiveDateTime the lastActiveDateTime value to set. * @return the MicrosoftGraphActivityHistoryItem object itself. */ @@ -171,7 +168,7 @@ public MicrosoftGraphActivityHistoryItem withLastActiveDateTime(OffsetDateTime l /** * Get the lastModifiedDateTime property: Set by the server. DateTime in UTC when the object was modified on the * server. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -181,7 +178,7 @@ public OffsetDateTime lastModifiedDateTime() { /** * Set the lastModifiedDateTime property: Set by the server. DateTime in UTC when the object was modified on the * server. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphActivityHistoryItem object itself. */ @@ -193,7 +190,7 @@ public MicrosoftGraphActivityHistoryItem withLastModifiedDateTime(OffsetDateTime /** * Get the startedDateTime property: Required. UTC DateTime when the historyItem (activity session) was started. * Required for timeline history. - * + * * @return the startedDateTime value. */ public OffsetDateTime startedDateTime() { @@ -203,7 +200,7 @@ public OffsetDateTime startedDateTime() { /** * Set the startedDateTime property: Required. UTC DateTime when the historyItem (activity session) was started. * Required for timeline history. - * + * * @param startedDateTime the startedDateTime value to set. * @return the MicrosoftGraphActivityHistoryItem object itself. */ @@ -214,7 +211,7 @@ public MicrosoftGraphActivityHistoryItem withStartedDateTime(OffsetDateTime star /** * Get the status property: status. - * + * * @return the status value. */ public MicrosoftGraphStatus status() { @@ -223,7 +220,7 @@ public MicrosoftGraphStatus status() { /** * Set the status property: status. - * + * * @param status the status value to set. * @return the MicrosoftGraphActivityHistoryItem object itself. */ @@ -236,7 +233,7 @@ public MicrosoftGraphActivityHistoryItem withStatus(MicrosoftGraphStatus status) * Get the userTimezone property: Optional. The timezone in which the user's device used to generate the activity * was located at activity creation time. Values supplied as Olson IDs in order to support cross-platform * representation. - * + * * @return the userTimezone value. */ public String userTimezone() { @@ -247,7 +244,7 @@ public String userTimezone() { * Set the userTimezone property: Optional. The timezone in which the user's device used to generate the activity * was located at activity creation time. Values supplied as Olson IDs in order to support cross-platform * representation. - * + * * @param userTimezone the userTimezone value to set. * @return the MicrosoftGraphActivityHistoryItem object itself. */ @@ -258,7 +255,7 @@ public MicrosoftGraphActivityHistoryItem withUserTimezone(String userTimezone) { /** * Get the activity property: userActivity. - * + * * @return the activity value. */ public MicrosoftGraphUserActivity activity() { @@ -267,7 +264,7 @@ public MicrosoftGraphUserActivity activity() { /** * Set the activity property: userActivity. - * + * * @param activity the activity value to set. * @return the MicrosoftGraphActivityHistoryItem object itself. */ @@ -278,17 +275,16 @@ public MicrosoftGraphActivityHistoryItem withActivity(MicrosoftGraphUserActivity /** * Get the additionalProperties property: activityHistoryItem. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: activityHistoryItem. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphActivityHistoryItem object itself. */ @@ -297,15 +293,9 @@ public MicrosoftGraphActivityHistoryItem withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphActivityHistoryItem withId(String id) { super.withId(id); @@ -314,7 +304,7 @@ public MicrosoftGraphActivityHistoryItem withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -324,4 +314,98 @@ public void validate() { activity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeNumberField("activeDurationSeconds", this.activeDurationSeconds); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeStringField("lastActiveDateTime", + this.lastActiveDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastActiveDateTime)); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + jsonWriter.writeStringField("startedDateTime", + this.startedDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startedDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("userTimezone", this.userTimezone); + jsonWriter.writeJsonField("activity", this.activity); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphActivityHistoryItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphActivityHistoryItem 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 MicrosoftGraphActivityHistoryItem. + */ + public static MicrosoftGraphActivityHistoryItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphActivityHistoryItem deserializedMicrosoftGraphActivityHistoryItem + = new MicrosoftGraphActivityHistoryItem(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphActivityHistoryItem.withId(reader.getString()); + } else if ("activeDurationSeconds".equals(fieldName)) { + deserializedMicrosoftGraphActivityHistoryItem.activeDurationSeconds + = reader.getNullable(JsonReader::getInt); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphActivityHistoryItem.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expirationDateTime".equals(fieldName)) { + deserializedMicrosoftGraphActivityHistoryItem.expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastActiveDateTime".equals(fieldName)) { + deserializedMicrosoftGraphActivityHistoryItem.lastActiveDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphActivityHistoryItem.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphActivityHistoryItem.startedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedMicrosoftGraphActivityHistoryItem.status + = MicrosoftGraphStatus.fromString(reader.getString()); + } else if ("userTimezone".equals(fieldName)) { + deserializedMicrosoftGraphActivityHistoryItem.userTimezone = reader.getString(); + } else if ("activity".equals(fieldName)) { + deserializedMicrosoftGraphActivityHistoryItem.activity + = MicrosoftGraphUserActivity.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphActivityHistoryItem.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphActivityHistoryItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAddIn.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAddIn.java index 0a24193126b61..198c822389668 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAddIn.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAddIn.java @@ -5,48 +5,51 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** addIn. */ +/** + * addIn. + */ @Fluent -public final class MicrosoftGraphAddIn { +public final class MicrosoftGraphAddIn implements JsonSerializable { /* * The id property. */ - @JsonProperty(value = "id") private UUID id; /* * The properties property. */ - @JsonProperty(value = "properties") private List properties; /* * The type property. */ - @JsonProperty(value = "type") private String type; /* * addIn */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAddIn class. */ + /** + * Creates an instance of MicrosoftGraphAddIn class. + */ public MicrosoftGraphAddIn() { } /** * Get the id property: The id property. - * + * * @return the id value. */ public UUID id() { @@ -55,7 +58,7 @@ public UUID id() { /** * Set the id property: The id property. - * + * * @param id the id value to set. * @return the MicrosoftGraphAddIn object itself. */ @@ -66,7 +69,7 @@ public MicrosoftGraphAddIn withId(UUID id) { /** * Get the properties property: The properties property. - * + * * @return the properties value. */ public List properties() { @@ -75,7 +78,7 @@ public List properties() { /** * Set the properties property: The properties property. - * + * * @param properties the properties value to set. * @return the MicrosoftGraphAddIn object itself. */ @@ -86,7 +89,7 @@ public MicrosoftGraphAddIn withProperties(List propertie /** * Get the type property: The type property. - * + * * @return the type value. */ public String type() { @@ -95,7 +98,7 @@ public String type() { /** * Set the type property: The type property. - * + * * @param type the type value to set. * @return the MicrosoftGraphAddIn object itself. */ @@ -106,17 +109,16 @@ public MicrosoftGraphAddIn withType(String type) { /** * Get the additionalProperties property: addIn. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: addIn. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAddIn object itself. */ @@ -125,17 +127,9 @@ public MicrosoftGraphAddIn withAdditionalProperties(Map addition return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -143,4 +137,60 @@ public void validate() { properties().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", Objects.toString(this.id, null)); + jsonWriter.writeArrayField("properties", this.properties, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("type", this.type); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAddIn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAddIn 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 MicrosoftGraphAddIn. + */ + public static MicrosoftGraphAddIn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAddIn deserializedMicrosoftGraphAddIn = new MicrosoftGraphAddIn(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphAddIn.id + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("properties".equals(fieldName)) { + List properties + = reader.readArray(reader1 -> MicrosoftGraphKeyValue.fromJson(reader1)); + deserializedMicrosoftGraphAddIn.properties = properties; + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphAddIn.type = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAddIn.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAddIn; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAdministrativeUnit.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAdministrativeUnit.java index f806f3d7efa26..c0962a7c3bc69 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAdministrativeUnit.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAdministrativeUnit.java @@ -5,19 +5,21 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * administrativeUnit - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -25,13 +27,11 @@ public final class MicrosoftGraphAdministrativeUnit extends MicrosoftGraphDirect /* * An optional description for the administrative unit. */ - @JsonProperty(value = "description") private String description; /* * Display name for the administrative unit. */ - @JsonProperty(value = "displayName") private String displayName; /* @@ -39,42 +39,40 @@ public final class MicrosoftGraphAdministrativeUnit extends MicrosoftGraphDirect * Public. If not set, default behavior is Public. When set to HiddenMembership, only members of the administrative * unit can list other members of the adminstrative unit. */ - @JsonProperty(value = "visibility") private String visibility; /* * Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list members), POST (add * members), DELETE (remove members). */ - @JsonProperty(value = "members") private List members; /* - * Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add + * Scoped-role members of this Administrative Unit. HTTP Methods: GET (list scopedRoleMemberships), POST (add * scopedRoleMembership), DELETE (remove scopedRoleMembership). */ - @JsonProperty(value = "scopedRoleMembers") private List scopedRoleMembers; /* * The extensions property. */ - @JsonProperty(value = "extensions") private List extensions; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAdministrativeUnit class. */ + /** + * Creates an instance of MicrosoftGraphAdministrativeUnit class. + */ public MicrosoftGraphAdministrativeUnit() { } /** * Get the description property: An optional description for the administrative unit. - * + * * @return the description value. */ public String description() { @@ -83,7 +81,7 @@ public String description() { /** * Set the description property: An optional description for the administrative unit. - * + * * @param description the description value to set. * @return the MicrosoftGraphAdministrativeUnit object itself. */ @@ -94,7 +92,7 @@ public MicrosoftGraphAdministrativeUnit withDescription(String description) { /** * Get the displayName property: Display name for the administrative unit. - * + * * @return the displayName value. */ public String displayName() { @@ -103,7 +101,7 @@ public String displayName() { /** * Set the displayName property: Display name for the administrative unit. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphAdministrativeUnit object itself. */ @@ -116,7 +114,7 @@ public MicrosoftGraphAdministrativeUnit withDisplayName(String displayName) { * Get the visibility property: Controls whether the administrative unit and its members are hidden or public. Can * be set to HiddenMembership or Public. If not set, default behavior is Public. When set to HiddenMembership, only * members of the administrative unit can list other members of the adminstrative unit. - * + * * @return the visibility value. */ public String visibility() { @@ -127,7 +125,7 @@ public String visibility() { * Set the visibility property: Controls whether the administrative unit and its members are hidden or public. Can * be set to HiddenMembership or Public. If not set, default behavior is Public. When set to HiddenMembership, only * members of the administrative unit can list other members of the adminstrative unit. - * + * * @param visibility the visibility value to set. * @return the MicrosoftGraphAdministrativeUnit object itself. */ @@ -139,7 +137,7 @@ public MicrosoftGraphAdministrativeUnit withVisibility(String visibility) { /** * Get the members property: Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list * members), POST (add members), DELETE (remove members). - * + * * @return the members value. */ public List members() { @@ -149,7 +147,7 @@ public List members() { /** * Set the members property: Users and groups that are members of this Adminsitrative Unit. HTTP Methods: GET (list * members), POST (add members), DELETE (remove members). - * + * * @param members the members value to set. * @return the MicrosoftGraphAdministrativeUnit object itself. */ @@ -161,7 +159,7 @@ public MicrosoftGraphAdministrativeUnit withMembers(List scopedRoleMembers() { @@ -171,19 +169,19 @@ public List scopedRoleMembers() { /** * Set the scopedRoleMembers property: Scoped-role members of this Administrative Unit. HTTP Methods: GET (list * scopedRoleMemberships), POST (add scopedRoleMembership), DELETE (remove scopedRoleMembership). - * + * * @param scopedRoleMembers the scopedRoleMembers value to set. * @return the MicrosoftGraphAdministrativeUnit object itself. */ - public MicrosoftGraphAdministrativeUnit withScopedRoleMembers( - List scopedRoleMembers) { + public MicrosoftGraphAdministrativeUnit + withScopedRoleMembers(List scopedRoleMembers) { this.scopedRoleMembers = scopedRoleMembers; return this; } /** * Get the extensions property: The extensions property. - * + * * @return the extensions value. */ public List extensions() { @@ -192,7 +190,7 @@ public List extensions() { /** * Set the extensions property: The extensions property. - * + * * @param extensions the extensions value to set. * @return the MicrosoftGraphAdministrativeUnit object itself. */ @@ -204,10 +202,9 @@ public MicrosoftGraphAdministrativeUnit withExtensions(List additionalProperties() { return this.additionalProperties; } @@ -215,7 +212,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAdministrativeUnit object itself. */ @@ -224,22 +221,18 @@ public MicrosoftGraphAdministrativeUnit withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphAdministrativeUnit withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphAdministrativeUnit withId(String id) { super.withId(id); @@ -248,7 +241,7 @@ public MicrosoftGraphAdministrativeUnit withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -264,4 +257,82 @@ public void validate() { extensions().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("visibility", this.visibility); + jsonWriter.writeArrayField("members", this.members, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("scopedRoleMembers", this.scopedRoleMembers, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAdministrativeUnit from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAdministrativeUnit 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 MicrosoftGraphAdministrativeUnit. + */ + public static MicrosoftGraphAdministrativeUnit fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAdministrativeUnit deserializedMicrosoftGraphAdministrativeUnit + = new MicrosoftGraphAdministrativeUnit(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphAdministrativeUnit.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphAdministrativeUnit.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphAdministrativeUnit.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphAdministrativeUnit.displayName = reader.getString(); + } else if ("visibility".equals(fieldName)) { + deserializedMicrosoftGraphAdministrativeUnit.visibility = reader.getString(); + } else if ("members".equals(fieldName)) { + List members + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphAdministrativeUnit.members = members; + } else if ("scopedRoleMembers".equals(fieldName)) { + List scopedRoleMembers + = reader.readArray(reader1 -> MicrosoftGraphScopedRoleMembership.fromJson(reader1)); + deserializedMicrosoftGraphAdministrativeUnit.scopedRoleMembers = scopedRoleMembers; + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> MicrosoftGraphExtension.fromJson(reader1)); + deserializedMicrosoftGraphAdministrativeUnit.extensions = extensions; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAdministrativeUnit.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAdministrativeUnit; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAlternativeSecurityId.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAlternativeSecurityId.java index 2849aeabafcc2..7902b76ee32a8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAlternativeSecurityId.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAlternativeSecurityId.java @@ -7,48 +7,52 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.Base64Url; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; -/** alternativeSecurityId. */ +/** + * alternativeSecurityId. + */ @Fluent -public final class MicrosoftGraphAlternativeSecurityId { +public final class MicrosoftGraphAlternativeSecurityId + implements JsonSerializable { private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; /* * For internal use only */ - @JsonProperty(value = "identityProvider") private String identityProvider; /* * For internal use only */ - @JsonProperty(value = "key") private Base64Url key; /* * For internal use only */ - @JsonProperty(value = "type") private Integer type; /* * alternativeSecurityId */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAlternativeSecurityId class. */ + /** + * Creates an instance of MicrosoftGraphAlternativeSecurityId class. + */ public MicrosoftGraphAlternativeSecurityId() { } /** * Get the identityProvider property: For internal use only. - * + * * @return the identityProvider value. */ public String identityProvider() { @@ -57,7 +61,7 @@ public String identityProvider() { /** * Set the identityProvider property: For internal use only. - * + * * @param identityProvider the identityProvider value to set. * @return the MicrosoftGraphAlternativeSecurityId object itself. */ @@ -68,7 +72,7 @@ public MicrosoftGraphAlternativeSecurityId withIdentityProvider(String identityP /** * Get the key property: For internal use only. - * + * * @return the key value. */ public byte[] key() { @@ -80,7 +84,7 @@ public byte[] key() { /** * Set the key property: For internal use only. - * + * * @param key the key value to set. * @return the MicrosoftGraphAlternativeSecurityId object itself. */ @@ -95,7 +99,7 @@ public MicrosoftGraphAlternativeSecurityId withKey(byte[] key) { /** * Get the type property: For internal use only. - * + * * @return the type value. */ public Integer type() { @@ -104,7 +108,7 @@ public Integer type() { /** * Set the type property: For internal use only. - * + * * @param type the type value to set. * @return the MicrosoftGraphAlternativeSecurityId object itself. */ @@ -115,17 +119,16 @@ public MicrosoftGraphAlternativeSecurityId withType(Integer type) { /** * Get the additionalProperties property: alternativeSecurityId. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: alternativeSecurityId. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAlternativeSecurityId object itself. */ @@ -134,19 +137,66 @@ public MicrosoftGraphAlternativeSecurityId withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identityProvider", this.identityProvider); + jsonWriter.writeStringField("key", Objects.toString(this.key, null)); + jsonWriter.writeNumberField("type", this.type); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAlternativeSecurityId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAlternativeSecurityId 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 MicrosoftGraphAlternativeSecurityId. + */ + public static MicrosoftGraphAlternativeSecurityId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAlternativeSecurityId deserializedMicrosoftGraphAlternativeSecurityId + = new MicrosoftGraphAlternativeSecurityId(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identityProvider".equals(fieldName)) { + deserializedMicrosoftGraphAlternativeSecurityId.identityProvider = reader.getString(); + } else if ("key".equals(fieldName)) { + deserializedMicrosoftGraphAlternativeSecurityId.key + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphAlternativeSecurityId.type = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAlternativeSecurityId.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAlternativeSecurityId; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphApiApplication.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphApiApplication.java index 2053ae8d97787..56f213577e93b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphApiApplication.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphApiApplication.java @@ -5,22 +5,25 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** apiApplication. */ +/** + * apiApplication. + */ @Fluent -public final class MicrosoftGraphApiApplication { +public final class MicrosoftGraphApiApplication implements JsonSerializable { /* * When true, allows an application to use claims mapping without specifying a custom signing key. */ - @JsonProperty(value = "acceptMappedClaims") private Boolean acceptMappedClaims; /* @@ -30,7 +33,6 @@ public final class MicrosoftGraphApiApplication { * service principals for both APIs at the same time. Both the client and the web API app must be registered in the * same tenant. */ - @JsonProperty(value = "knownClientApplications") private List knownClientApplications; /* @@ -38,7 +40,6 @@ public final class MicrosoftGraphApiApplication { * These delegated permissions may be requested by a client application, and may be granted by users or * administrators during consent. Delegated permissions are sometimes referred to as OAuth 2.0 scopes. */ - @JsonProperty(value = "oauth2PermissionScopes") private List oauth2PermissionScopes; /* @@ -47,34 +48,34 @@ public final class MicrosoftGraphApiApplication { * specified). However, any additional permissions not listed in preAuthorizedApplications (requested through * incremental consent for example) will require user consent. */ - @JsonProperty(value = "preAuthorizedApplications") private List preAuthorizedApplications; /* * Specifies the access token version expected by this resource. This changes the version and format of the JWT - * produced independent of the endpoint or client used to request the access token. The endpoint used, v1.0 or - * v2.0, is chosen by the client and only impacts the version of id_tokens. Resources need to explicitly configure - * requestedAccessTokenVersion to indicate the supported access token format. Possible values for - * requestedAccessTokenVersion are 1, 2, or null. If the value is null, this defaults to 1, which corresponds to - * the v1.0 endpoint. If signInAudience on the application is configured as AzureADandPersonalMicrosoftAccount, - * the value for this property must be 2 - */ - @JsonProperty(value = "requestedAccessTokenVersion") + * produced independent of the endpoint or client used to request the access token. The endpoint used, v1.0 or v2.0, + * is chosen by the client and only impacts the version of id_tokens. Resources need to explicitly configure + * requestedAccessTokenVersion to indicate the supported access token format. Possible values for + * requestedAccessTokenVersion are 1, 2, or null. If the value is null, this defaults to 1, which corresponds to the + * v1.0 endpoint. If signInAudience on the application is configured as AzureADandPersonalMicrosoftAccount, the + * value for this property must be 2 + */ private Integer requestedAccessTokenVersion; /* * apiApplication */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphApiApplication class. */ + /** + * Creates an instance of MicrosoftGraphApiApplication class. + */ public MicrosoftGraphApiApplication() { } /** * Get the acceptMappedClaims property: When true, allows an application to use claims mapping without specifying a * custom signing key. - * + * * @return the acceptMappedClaims value. */ public Boolean acceptMappedClaims() { @@ -84,7 +85,7 @@ public Boolean acceptMappedClaims() { /** * Set the acceptMappedClaims property: When true, allows an application to use claims mapping without specifying a * custom signing key. - * + * * @param acceptMappedClaims the acceptMappedClaims value to set. * @return the MicrosoftGraphApiApplication object itself. */ @@ -99,7 +100,7 @@ public MicrosoftGraphApiApplication withAcceptMappedClaims(Boolean acceptMappedC * consents once to the client app. Azure AD knows that consenting to the client means implicitly consenting to the * web API and automatically provisions service principals for both APIs at the same time. Both the client and the * web API app must be registered in the same tenant. - * + * * @return the knownClientApplications value. */ public List knownClientApplications() { @@ -112,7 +113,7 @@ public List knownClientApplications() { * consents once to the client app. Azure AD knows that consenting to the client means implicitly consenting to the * web API and automatically provisions service principals for both APIs at the same time. Both the client and the * web API app must be registered in the same tenant. - * + * * @param knownClientApplications the knownClientApplications value to set. * @return the MicrosoftGraphApiApplication object itself. */ @@ -126,7 +127,7 @@ public MicrosoftGraphApiApplication withKnownClientApplications(List known * represented by this application registration. These delegated permissions may be requested by a client * application, and may be granted by users or administrators during consent. Delegated permissions are sometimes * referred to as OAuth 2.0 scopes. - * + * * @return the oauth2PermissionScopes value. */ public List oauth2PermissionScopes() { @@ -138,12 +139,12 @@ public List oauth2PermissionScopes() { * represented by this application registration. These delegated permissions may be requested by a client * application, and may be granted by users or administrators during consent. Delegated permissions are sometimes * referred to as OAuth 2.0 scopes. - * + * * @param oauth2PermissionScopes the oauth2PermissionScopes value to set. * @return the MicrosoftGraphApiApplication object itself. */ - public MicrosoftGraphApiApplication withOauth2PermissionScopes( - List oauth2PermissionScopes) { + public MicrosoftGraphApiApplication + withOauth2PermissionScopes(List oauth2PermissionScopes) { this.oauth2PermissionScopes = oauth2PermissionScopes; return this; } @@ -153,7 +154,7 @@ public MicrosoftGraphApiApplication withOauth2PermissionScopes( * specified delegated permissions to access this application's APIs. Users are not required to consent to any * pre-authorized application (for the permissions specified). However, any additional permissions not listed in * preAuthorizedApplications (requested through incremental consent for example) will require user consent. - * + * * @return the preAuthorizedApplications value. */ public List preAuthorizedApplications() { @@ -165,12 +166,12 @@ public List preAuthorizedApplications() * specified delegated permissions to access this application's APIs. Users are not required to consent to any * pre-authorized application (for the permissions specified). However, any additional permissions not listed in * preAuthorizedApplications (requested through incremental consent for example) will require user consent. - * + * * @param preAuthorizedApplications the preAuthorizedApplications value to set. * @return the MicrosoftGraphApiApplication object itself. */ - public MicrosoftGraphApiApplication withPreAuthorizedApplications( - List preAuthorizedApplications) { + public MicrosoftGraphApiApplication + withPreAuthorizedApplications(List preAuthorizedApplications) { this.preAuthorizedApplications = preAuthorizedApplications; return this; } @@ -183,7 +184,7 @@ public MicrosoftGraphApiApplication withPreAuthorizedApplications( * Possible values for requestedAccessTokenVersion are 1, 2, or null. If the value is null, this defaults to 1, * which corresponds to the v1.0 endpoint. If signInAudience on the application is configured as * AzureADandPersonalMicrosoftAccount, the value for this property must be 2. - * + * * @return the requestedAccessTokenVersion value. */ public Integer requestedAccessTokenVersion() { @@ -198,7 +199,7 @@ public Integer requestedAccessTokenVersion() { * Possible values for requestedAccessTokenVersion are 1, 2, or null. If the value is null, this defaults to 1, * which corresponds to the v1.0 endpoint. If signInAudience on the application is configured as * AzureADandPersonalMicrosoftAccount, the value for this property must be 2. - * + * * @param requestedAccessTokenVersion the requestedAccessTokenVersion value to set. * @return the MicrosoftGraphApiApplication object itself. */ @@ -209,17 +210,16 @@ public MicrosoftGraphApiApplication withRequestedAccessTokenVersion(Integer requ /** * Get the additionalProperties property: apiApplication. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: apiApplication. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphApiApplication object itself. */ @@ -228,17 +228,9 @@ public MicrosoftGraphApiApplication withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -249,4 +241,74 @@ public void validate() { preAuthorizedApplications().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("acceptMappedClaims", this.acceptMappedClaims); + jsonWriter.writeArrayField("knownClientApplications", this.knownClientApplications, + (writer, element) -> writer.writeString(Objects.toString(element, null))); + jsonWriter.writeArrayField("oauth2PermissionScopes", this.oauth2PermissionScopes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("preAuthorizedApplications", this.preAuthorizedApplications, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("requestedAccessTokenVersion", this.requestedAccessTokenVersion); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphApiApplication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphApiApplication 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 MicrosoftGraphApiApplication. + */ + public static MicrosoftGraphApiApplication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphApiApplication deserializedMicrosoftGraphApiApplication = new MicrosoftGraphApiApplication(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("acceptMappedClaims".equals(fieldName)) { + deserializedMicrosoftGraphApiApplication.acceptMappedClaims + = reader.getNullable(JsonReader::getBoolean); + } else if ("knownClientApplications".equals(fieldName)) { + List knownClientApplications = reader.readArray( + reader1 -> reader1.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()))); + deserializedMicrosoftGraphApiApplication.knownClientApplications = knownClientApplications; + } else if ("oauth2PermissionScopes".equals(fieldName)) { + List oauth2PermissionScopes + = reader.readArray(reader1 -> MicrosoftGraphPermissionScope.fromJson(reader1)); + deserializedMicrosoftGraphApiApplication.oauth2PermissionScopes = oauth2PermissionScopes; + } else if ("preAuthorizedApplications".equals(fieldName)) { + List preAuthorizedApplications + = reader.readArray(reader1 -> MicrosoftGraphPreAuthorizedApplication.fromJson(reader1)); + deserializedMicrosoftGraphApiApplication.preAuthorizedApplications = preAuthorizedApplications; + } else if ("requestedAccessTokenVersion".equals(fieldName)) { + deserializedMicrosoftGraphApiApplication.requestedAccessTokenVersion + = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphApiApplication.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphApiApplication; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAppRole.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAppRole.java index 99c1bd576a840..0dca3f142e29c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAppRole.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAppRole.java @@ -5,76 +5,75 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** appRole. */ +/** + * appRole. + */ @Fluent -public final class MicrosoftGraphAppRole { +public final class MicrosoftGraphAppRole implements JsonSerializable { /* * Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other * application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles * supporting assignment to other applications' service principals are also known as application permissions. The * 'Application' value is only supported for app roles defined on application entities. */ - @JsonProperty(value = "allowedMemberTypes") private List allowedMemberTypes; /* * The description for the app role. This is displayed when the app role is being assigned and, if the app role - * functions as an application permission, during consent experiences. + * functions as an application permission, during consent experiences. */ - @JsonProperty(value = "description") private String description; /* * Display name for the permission that appears in the app role assignment and consent experiences. */ - @JsonProperty(value = "displayName") private String displayName; /* * Unique role identifier inside the appRoles collection. When creating a new app role, a new Guid identifier must * be provided. */ - @JsonProperty(value = "id") private UUID id; /* * When creating or updating an app role, this must be set to true (which is the default). To delete a role, this - * must first be set to false. At that point, in a subsequent call, this role may be removed. + * must first be set to false. At that point, in a subsequent call, this role may be removed. */ - @JsonProperty(value = "isEnabled") private Boolean isEnabled; /* * Specifies if the app role is defined on the application object or on the servicePrincipal entity. Must not be * included in any POST or PATCH requests. Read-only. */ - @JsonProperty(value = "origin") private String origin; /* * Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user * or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - - * . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, + * . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, * including the space character, are not allowed. */ - @JsonProperty(value = "value") private String value; /* * appRole */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAppRole class. */ + /** + * Creates an instance of MicrosoftGraphAppRole class. + */ public MicrosoftGraphAppRole() { } @@ -83,7 +82,7 @@ public MicrosoftGraphAppRole() { * setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', * 'Application']). App roles supporting assignment to other applications' service principals are also known as * application permissions. The 'Application' value is only supported for app roles defined on application entities. - * + * * @return the allowedMemberTypes value. */ public List allowedMemberTypes() { @@ -95,7 +94,7 @@ public List allowedMemberTypes() { * setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', * 'Application']). App roles supporting assignment to other applications' service principals are also known as * application permissions. The 'Application' value is only supported for app roles defined on application entities. - * + * * @param allowedMemberTypes the allowedMemberTypes value to set. * @return the MicrosoftGraphAppRole object itself. */ @@ -107,7 +106,7 @@ public MicrosoftGraphAppRole withAllowedMemberTypes(List allowedMemberTy /** * Get the description property: The description for the app role. This is displayed when the app role is being * assigned and, if the app role functions as an application permission, during consent experiences. - * + * * @return the description value. */ public String description() { @@ -117,7 +116,7 @@ public String description() { /** * Set the description property: The description for the app role. This is displayed when the app role is being * assigned and, if the app role functions as an application permission, during consent experiences. - * + * * @param description the description value to set. * @return the MicrosoftGraphAppRole object itself. */ @@ -129,7 +128,7 @@ public MicrosoftGraphAppRole withDescription(String description) { /** * Get the displayName property: Display name for the permission that appears in the app role assignment and consent * experiences. - * + * * @return the displayName value. */ public String displayName() { @@ -139,7 +138,7 @@ public String displayName() { /** * Set the displayName property: Display name for the permission that appears in the app role assignment and consent * experiences. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphAppRole object itself. */ @@ -151,7 +150,7 @@ public MicrosoftGraphAppRole withDisplayName(String displayName) { /** * Get the id property: Unique role identifier inside the appRoles collection. When creating a new app role, a new * Guid identifier must be provided. - * + * * @return the id value. */ public UUID id() { @@ -161,7 +160,7 @@ public UUID id() { /** * Set the id property: Unique role identifier inside the appRoles collection. When creating a new app role, a new * Guid identifier must be provided. - * + * * @param id the id value to set. * @return the MicrosoftGraphAppRole object itself. */ @@ -174,7 +173,7 @@ public MicrosoftGraphAppRole withId(UUID id) { * Get the isEnabled property: When creating or updating an app role, this must be set to true (which is the * default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may * be removed. - * + * * @return the isEnabled value. */ public Boolean isEnabled() { @@ -185,7 +184,7 @@ public Boolean isEnabled() { * Set the isEnabled property: When creating or updating an app role, this must be set to true (which is the * default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may * be removed. - * + * * @param isEnabled the isEnabled value to set. * @return the MicrosoftGraphAppRole object itself. */ @@ -197,7 +196,7 @@ public MicrosoftGraphAppRole withIsEnabled(Boolean isEnabled) { /** * Get the origin property: Specifies if the app role is defined on the application object or on the * servicePrincipal entity. Must not be included in any POST or PATCH requests. Read-only. - * + * * @return the origin value. */ public String origin() { @@ -207,7 +206,7 @@ public String origin() { /** * Set the origin property: Specifies if the app role is defined on the application object or on the * servicePrincipal entity. Must not be included in any POST or PATCH requests. Read-only. - * + * * @param origin the origin value to set. * @return the MicrosoftGraphAppRole object itself. */ @@ -219,9 +218,9 @@ public MicrosoftGraphAppRole withOrigin(String origin) { /** * Get the value property: Specifies the value to include in the roles claim in ID tokens and access tokens * authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed - * characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges - * 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. - * + * characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the + * ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. + * * @return the value value. */ public String value() { @@ -231,9 +230,9 @@ public String value() { /** * Set the value property: Specifies the value to include in the roles claim in ID tokens and access tokens * authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed - * characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges - * 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. - * + * characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the + * ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. + * * @param value the value value to set. * @return the MicrosoftGraphAppRole object itself. */ @@ -244,17 +243,16 @@ public MicrosoftGraphAppRole withValue(String value) { /** * Get the additionalProperties property: appRole. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: appRole. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAppRole object itself. */ @@ -263,19 +261,79 @@ public MicrosoftGraphAppRole withAdditionalProperties(Map additi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowedMemberTypes", this.allowedMemberTypes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("id", Objects.toString(this.id, null)); + jsonWriter.writeBooleanField("isEnabled", this.isEnabled); + jsonWriter.writeStringField("origin", this.origin); + jsonWriter.writeStringField("value", this.value); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAppRole from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAppRole 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 MicrosoftGraphAppRole. + */ + public static MicrosoftGraphAppRole fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAppRole deserializedMicrosoftGraphAppRole = new MicrosoftGraphAppRole(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowedMemberTypes".equals(fieldName)) { + List allowedMemberTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphAppRole.allowedMemberTypes = allowedMemberTypes; + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphAppRole.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphAppRole.displayName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMicrosoftGraphAppRole.id + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("isEnabled".equals(fieldName)) { + deserializedMicrosoftGraphAppRole.isEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("origin".equals(fieldName)) { + deserializedMicrosoftGraphAppRole.origin = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedMicrosoftGraphAppRole.value = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAppRole.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAppRole; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAppRoleAssignment.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAppRoleAssignment.java index 0c6f2b5ce13ed..3ec6b80617b59 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAppRoleAssignment.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAppRoleAssignment.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.UUID; /** * appRoleAssignment - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -29,57 +32,52 @@ public final class MicrosoftGraphAppRoleAssignment extends MicrosoftGraphDirecto * signal that the principal is assigned to the resource app without any specific app roles. Required on create. * Does not support $filter. */ - @JsonProperty(value = "appRoleId") private UUID appRoleId; /* * The createdDateTime property. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * The display name of the user, group, or service principal that was granted the app role assignment. Read-only. * Supports $filter (eq and startswith). */ - @JsonProperty(value = "principalDisplayName") private String principalDisplayName; /* * The unique identifier (id) for the user, group or service principal being granted the app role. Required on * create. Does not support $filter. */ - @JsonProperty(value = "principalId") private UUID principalId; /* - * The type of the assigned principal. This can either be 'User', 'Group' or 'ServicePrincipal'. Read-only. Does - * not support $filter. + * The type of the assigned principal. This can either be 'User', 'Group' or 'ServicePrincipal'. Read-only. Does not + * support $filter. */ - @JsonProperty(value = "principalType") private String principalType; /* * The display name of the resource app's service principal to which the assignment is made. Does not support * $filter. */ - @JsonProperty(value = "resourceDisplayName") private String resourceDisplayName; /* * The unique identifier (id) for the resource service principal for which the assignment is made. Required on * create. Supports $filter (eq only). */ - @JsonProperty(value = "resourceId") private UUID resourceId; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAppRoleAssignment class. */ + /** + * Creates an instance of MicrosoftGraphAppRoleAssignment class. + */ public MicrosoftGraphAppRoleAssignment() { } @@ -89,7 +87,7 @@ public MicrosoftGraphAppRoleAssignment() { * the resource application has not declared any app roles, a default app role ID of * 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource * app without any specific app roles. Required on create. Does not support $filter. - * + * * @return the appRoleId value. */ public UUID appRoleId() { @@ -102,7 +100,7 @@ public UUID appRoleId() { * the resource application has not declared any app roles, a default app role ID of * 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource * app without any specific app roles. Required on create. Does not support $filter. - * + * * @param appRoleId the appRoleId value to set. * @return the MicrosoftGraphAppRoleAssignment object itself. */ @@ -113,7 +111,7 @@ public MicrosoftGraphAppRoleAssignment withAppRoleId(UUID appRoleId) { /** * Get the createdDateTime property: The createdDateTime property. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -122,7 +120,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: The createdDateTime property. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphAppRoleAssignment object itself. */ @@ -134,7 +132,7 @@ public MicrosoftGraphAppRoleAssignment withCreatedDateTime(OffsetDateTime create /** * Get the principalDisplayName property: The display name of the user, group, or service principal that was granted * the app role assignment. Read-only. Supports $filter (eq and startswith). - * + * * @return the principalDisplayName value. */ public String principalDisplayName() { @@ -144,7 +142,7 @@ public String principalDisplayName() { /** * Set the principalDisplayName property: The display name of the user, group, or service principal that was granted * the app role assignment. Read-only. Supports $filter (eq and startswith). - * + * * @param principalDisplayName the principalDisplayName value to set. * @return the MicrosoftGraphAppRoleAssignment object itself. */ @@ -156,7 +154,7 @@ public MicrosoftGraphAppRoleAssignment withPrincipalDisplayName(String principal /** * Get the principalId property: The unique identifier (id) for the user, group or service principal being granted * the app role. Required on create. Does not support $filter. - * + * * @return the principalId value. */ public UUID principalId() { @@ -166,7 +164,7 @@ public UUID principalId() { /** * Set the principalId property: The unique identifier (id) for the user, group or service principal being granted * the app role. Required on create. Does not support $filter. - * + * * @param principalId the principalId value to set. * @return the MicrosoftGraphAppRoleAssignment object itself. */ @@ -178,7 +176,7 @@ public MicrosoftGraphAppRoleAssignment withPrincipalId(UUID principalId) { /** * Get the principalType property: The type of the assigned principal. This can either be 'User', 'Group' or * 'ServicePrincipal'. Read-only. Does not support $filter. - * + * * @return the principalType value. */ public String principalType() { @@ -188,7 +186,7 @@ public String principalType() { /** * Set the principalType property: The type of the assigned principal. This can either be 'User', 'Group' or * 'ServicePrincipal'. Read-only. Does not support $filter. - * + * * @param principalType the principalType value to set. * @return the MicrosoftGraphAppRoleAssignment object itself. */ @@ -200,7 +198,7 @@ public MicrosoftGraphAppRoleAssignment withPrincipalType(String principalType) { /** * Get the resourceDisplayName property: The display name of the resource app's service principal to which the * assignment is made. Does not support $filter. - * + * * @return the resourceDisplayName value. */ public String resourceDisplayName() { @@ -210,7 +208,7 @@ public String resourceDisplayName() { /** * Set the resourceDisplayName property: The display name of the resource app's service principal to which the * assignment is made. Does not support $filter. - * + * * @param resourceDisplayName the resourceDisplayName value to set. * @return the MicrosoftGraphAppRoleAssignment object itself. */ @@ -222,7 +220,7 @@ public MicrosoftGraphAppRoleAssignment withResourceDisplayName(String resourceDi /** * Get the resourceId property: The unique identifier (id) for the resource service principal for which the * assignment is made. Required on create. Supports $filter (eq only). - * + * * @return the resourceId value. */ public UUID resourceId() { @@ -232,7 +230,7 @@ public UUID resourceId() { /** * Set the resourceId property: The unique identifier (id) for the resource service principal for which the * assignment is made. Required on create. Supports $filter (eq only). - * + * * @param resourceId the resourceId value to set. * @return the MicrosoftGraphAppRoleAssignment object itself. */ @@ -244,10 +242,9 @@ public MicrosoftGraphAppRoleAssignment withResourceId(UUID resourceId) { /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -255,7 +252,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAppRoleAssignment object itself. */ @@ -264,22 +261,18 @@ public MicrosoftGraphAppRoleAssignment withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphAppRoleAssignment withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphAppRoleAssignment withId(String id) { super.withId(id); @@ -288,11 +281,90 @@ public MicrosoftGraphAppRoleAssignment withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("appRoleId", Objects.toString(this.appRoleId, null)); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("principalDisplayName", this.principalDisplayName); + jsonWriter.writeStringField("principalId", Objects.toString(this.principalId, null)); + jsonWriter.writeStringField("principalType", this.principalType); + jsonWriter.writeStringField("resourceDisplayName", this.resourceDisplayName); + jsonWriter.writeStringField("resourceId", Objects.toString(this.resourceId, null)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAppRoleAssignment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAppRoleAssignment 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 MicrosoftGraphAppRoleAssignment. + */ + public static MicrosoftGraphAppRoleAssignment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAppRoleAssignment deserializedMicrosoftGraphAppRoleAssignment + = new MicrosoftGraphAppRoleAssignment(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphAppRoleAssignment.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphAppRoleAssignment.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("appRoleId".equals(fieldName)) { + deserializedMicrosoftGraphAppRoleAssignment.appRoleId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphAppRoleAssignment.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("principalDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphAppRoleAssignment.principalDisplayName = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedMicrosoftGraphAppRoleAssignment.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("principalType".equals(fieldName)) { + deserializedMicrosoftGraphAppRoleAssignment.principalType = reader.getString(); + } else if ("resourceDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphAppRoleAssignment.resourceDisplayName = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedMicrosoftGraphAppRoleAssignment.resourceId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAppRoleAssignment.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAppRoleAssignment; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphApplicationInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphApplicationInner.java index 684bf742c275e..cd1c48ccc192c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphApplicationInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphApplicationInner.java @@ -7,20 +7,22 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.Base64Url; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; /** * application - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -32,51 +34,43 @@ public final class MicrosoftGraphApplicationInner extends MicrosoftGraphDirector * applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This * will let services like Microsoft 365 call the application in the context of a document the user is working on. */ - @JsonProperty(value = "addIns") private List addIns; /* * apiApplication */ - @JsonProperty(value = "api") private MicrosoftGraphApiApplication api; /* * The unique identifier for the application that is assigned to an application by Azure AD. Not nullable. * Read-only. */ - @JsonProperty(value = "appId") private String appId; /* * The applicationTemplateId property. */ - @JsonProperty(value = "applicationTemplateId") private String applicationTemplateId; /* * The collection of roles the application declares. With app role assignments, these roles can be assigned to * users, groups, or other applications' service principals. Not nullable. */ - @JsonProperty(value = "appRoles") private List appRoles; /* * The date and time the application was registered. Read-only. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * The description property. */ - @JsonProperty(value = "description") private String description; /* * The display name for the application. */ - @JsonProperty(value = "displayName") private String displayName; /* @@ -85,7 +79,6 @@ public final class MicrosoftGraphApplicationInner extends MicrosoftGraphDirector * rolesAll: This will get all of the security groups, distribution groups, and Azure AD directory roles that the * signed-in user is a member of */ - @JsonProperty(value = "groupMembershipClaims") private String groupMembershipClaims; /* @@ -93,91 +86,77 @@ public final class MicrosoftGraphApplicationInner extends MicrosoftGraphDirector * application is multi-tenant. For more information see Application Objects and Service Principal Objects. The any * operator is required for filter expressions on multi-valued properties. Not nullable. */ - @JsonProperty(value = "identifierUris") private List identifierUris; /* * informationalUrl */ - @JsonProperty(value = "info") private MicrosoftGraphInformationalUrl info; /* * The isDeviceOnlyAuthSupported property. */ - @JsonProperty(value = "isDeviceOnlyAuthSupported") private Boolean isDeviceOnlyAuthSupported; /* * Specifies the fallback application type as public client, such as an installed application running on a mobile * device. The default value is false which means the fallback application type is confidential client such as web * app. There are certain scenarios where Azure AD cannot determine the client application type (e.g. ROPC flow - * where it is configured without specifying a redirect URI). In those cases Azure AD will interpret the - * application type based on the value of this property. + * where it is configured without specifying a redirect URI). In those cases Azure AD will interpret the application + * type based on the value of this property. */ - @JsonProperty(value = "isFallbackPublicClient") private Boolean isFallbackPublicClient; /* * The collection of key credentials associated with the application Not nullable. */ - @JsonProperty(value = "keyCredentials") private List keyCredentials; /* * The main logo for the application. Not nullable. */ - @JsonProperty(value = "logo") private Base64Url logo; /* * The notes property. */ - @JsonProperty(value = "notes") private String notes; /* * The oauth2RequirePostResponse property. */ - @JsonProperty(value = "oauth2RequirePostResponse") private Boolean oauth2RequirePostResponse; /* * optionalClaims */ - @JsonProperty(value = "optionalClaims") private MicrosoftGraphOptionalClaims optionalClaims; /* * parentalControlSettings */ - @JsonProperty(value = "parentalControlSettings") private MicrosoftGraphParentalControlSettings parentalControlSettings; /* * The collection of password credentials associated with the application. Not nullable. */ - @JsonProperty(value = "passwordCredentials") private List passwordCredentials; /* * publicClientApplication */ - @JsonProperty(value = "publicClient") private MicrosoftGraphPublicClientApplication publicClient; /* * The verified publisher domain for the application. Read-only. */ - @JsonProperty(value = "publisherDomain") private String publisherDomain; /* * Specifies resources that this application requires access to and the set of OAuth permission scopes and - * application roles that it needs under each of those resources. This pre-configuration of required resource - * access drives the consent experience. Not nullable. + * application roles that it needs under each of those resources. This pre-configuration of required resource access + * drives the consent experience. Not nullable. */ - @JsonProperty(value = "requiredResourceAccess") private List requiredResourceAccess; /* @@ -190,13 +169,11 @@ public final class MicrosoftGraphApplicationInner extends MicrosoftGraphDirector * allows for the widest set of user identities including local accounts and user identities from Microsoft, * Facebook, Google, Twitter, or any OpenID Connect provider. */ - @JsonProperty(value = "signInAudience") private String signInAudience; /* * Custom strings that can be used to categorize and identify the application. Not nullable. */ - @JsonProperty(value = "tags") private List tags; /* @@ -204,62 +181,54 @@ public final class MicrosoftGraphApplicationInner extends MicrosoftGraphDirector * the tokens it emits by using the key this property points to. The application code that receives the encrypted * token must use the matching private key to decrypt the token before it can be used for the signed-in user. */ - @JsonProperty(value = "tokenEncryptionKeyId") private UUID tokenEncryptionKeyId; /* * webApplication */ - @JsonProperty(value = "web") private MicrosoftGraphWebApplication web; /* - * directoryObject - * * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonProperty(value = "createdOnBehalfOf") private MicrosoftGraphDirectoryObjectInner createdOnBehalfOf; /* * Read-only. Nullable. */ - @JsonProperty(value = "extensionProperties") private List extensionProperties; /* * The homeRealmDiscoveryPolicies property. */ - @JsonProperty(value = "homeRealmDiscoveryPolicies") private List homeRealmDiscoveryPolicies; /* * Directory objects that are owners of the application. The owners are a set of non-admin users who are allowed to * modify this object. Requires version 2013-11-08 or newer. Read-only. Nullable. */ - @JsonProperty(value = "owners") private List owners; /* * The tokenIssuancePolicies property. */ - @JsonProperty(value = "tokenIssuancePolicies") private List tokenIssuancePolicies; /* * The tokenLifetimePolicies property. */ - @JsonProperty(value = "tokenLifetimePolicies") private List tokenLifetimePolicies; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphApplicationInner class. */ + /** + * Creates an instance of MicrosoftGraphApplicationInner class. + */ public MicrosoftGraphApplicationInner() { } @@ -268,7 +237,7 @@ public MicrosoftGraphApplicationInner() { * contexts. For example, applications that can render file streams may set the addIns property for its * 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a * document the user is working on. - * + * * @return the addIns value. */ public List addIns() { @@ -280,7 +249,7 @@ public List addIns() { * contexts. For example, applications that can render file streams may set the addIns property for its * 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a * document the user is working on. - * + * * @param addIns the addIns value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -291,7 +260,7 @@ public MicrosoftGraphApplicationInner withAddIns(List addIn /** * Get the api property: apiApplication. - * + * * @return the api value. */ public MicrosoftGraphApiApplication api() { @@ -300,7 +269,7 @@ public MicrosoftGraphApiApplication api() { /** * Set the api property: apiApplication. - * + * * @param api the api value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -312,7 +281,7 @@ public MicrosoftGraphApplicationInner withApi(MicrosoftGraphApiApplication api) /** * Get the appId property: The unique identifier for the application that is assigned to an application by Azure AD. * Not nullable. Read-only. - * + * * @return the appId value. */ public String appId() { @@ -322,7 +291,7 @@ public String appId() { /** * Set the appId property: The unique identifier for the application that is assigned to an application by Azure AD. * Not nullable. Read-only. - * + * * @param appId the appId value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -333,7 +302,7 @@ public MicrosoftGraphApplicationInner withAppId(String appId) { /** * Get the applicationTemplateId property: The applicationTemplateId property. - * + * * @return the applicationTemplateId value. */ public String applicationTemplateId() { @@ -342,7 +311,7 @@ public String applicationTemplateId() { /** * Set the applicationTemplateId property: The applicationTemplateId property. - * + * * @param applicationTemplateId the applicationTemplateId value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -354,7 +323,7 @@ public MicrosoftGraphApplicationInner withApplicationTemplateId(String applicati /** * Get the appRoles property: The collection of roles the application declares. With app role assignments, these * roles can be assigned to users, groups, or other applications' service principals. Not nullable. - * + * * @return the appRoles value. */ public List appRoles() { @@ -364,7 +333,7 @@ public List appRoles() { /** * Set the appRoles property: The collection of roles the application declares. With app role assignments, these * roles can be assigned to users, groups, or other applications' service principals. Not nullable. - * + * * @param appRoles the appRoles value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -375,7 +344,7 @@ public MicrosoftGraphApplicationInner withAppRoles(List a /** * Get the createdDateTime property: The date and time the application was registered. Read-only. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -384,7 +353,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: The date and time the application was registered. Read-only. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -395,7 +364,7 @@ public MicrosoftGraphApplicationInner withCreatedDateTime(OffsetDateTime created /** * Get the description property: The description property. - * + * * @return the description value. */ public String description() { @@ -404,7 +373,7 @@ public String description() { /** * Set the description property: The description property. - * + * * @param description the description value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -415,7 +384,7 @@ public MicrosoftGraphApplicationInner withDescription(String description) { /** * Get the displayName property: The display name for the application. - * + * * @return the displayName value. */ public String displayName() { @@ -424,7 +393,7 @@ public String displayName() { /** * Set the displayName property: The display name for the application. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -438,7 +407,7 @@ public MicrosoftGraphApplicationInner withDisplayName(String displayName) { * that the application expects. To set this attribute, use one of the following valid string * values:NoneSecurityGroup: For security groups and Azure AD rolesAll: This will get all of the security groups, * distribution groups, and Azure AD directory roles that the signed-in user is a member of. - * + * * @return the groupMembershipClaims value. */ public String groupMembershipClaims() { @@ -450,7 +419,7 @@ public String groupMembershipClaims() { * that the application expects. To set this attribute, use one of the following valid string * values:NoneSecurityGroup: For security groups and Azure AD rolesAll: This will get all of the security groups, * distribution groups, and Azure AD directory roles that the signed-in user is a member of. - * + * * @param groupMembershipClaims the groupMembershipClaims value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -464,7 +433,7 @@ public MicrosoftGraphApplicationInner withGroupMembershipClaims(String groupMemb * verified custom domain if the application is multi-tenant. For more information see Application Objects and * Service Principal Objects. The any operator is required for filter expressions on multi-valued properties. Not * nullable. - * + * * @return the identifierUris value. */ public List identifierUris() { @@ -476,7 +445,7 @@ public List identifierUris() { * verified custom domain if the application is multi-tenant. For more information see Application Objects and * Service Principal Objects. The any operator is required for filter expressions on multi-valued properties. Not * nullable. - * + * * @param identifierUris the identifierUris value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -487,7 +456,7 @@ public MicrosoftGraphApplicationInner withIdentifierUris(List identifier /** * Get the info property: informationalUrl. - * + * * @return the info value. */ public MicrosoftGraphInformationalUrl info() { @@ -496,7 +465,7 @@ public MicrosoftGraphInformationalUrl info() { /** * Set the info property: informationalUrl. - * + * * @param info the info value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -507,7 +476,7 @@ public MicrosoftGraphApplicationInner withInfo(MicrosoftGraphInformationalUrl in /** * Get the isDeviceOnlyAuthSupported property: The isDeviceOnlyAuthSupported property. - * + * * @return the isDeviceOnlyAuthSupported value. */ public Boolean isDeviceOnlyAuthSupported() { @@ -516,7 +485,7 @@ public Boolean isDeviceOnlyAuthSupported() { /** * Set the isDeviceOnlyAuthSupported property: The isDeviceOnlyAuthSupported property. - * + * * @param isDeviceOnlyAuthSupported the isDeviceOnlyAuthSupported value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -531,7 +500,7 @@ public MicrosoftGraphApplicationInner withIsDeviceOnlyAuthSupported(Boolean isDe * type is confidential client such as web app. There are certain scenarios where Azure AD cannot determine the * client application type (e.g. ROPC flow where it is configured without specifying a redirect URI). In those cases * Azure AD will interpret the application type based on the value of this property. - * + * * @return the isFallbackPublicClient value. */ public Boolean isFallbackPublicClient() { @@ -544,7 +513,7 @@ public Boolean isFallbackPublicClient() { * type is confidential client such as web app. There are certain scenarios where Azure AD cannot determine the * client application type (e.g. ROPC flow where it is configured without specifying a redirect URI). In those cases * Azure AD will interpret the application type based on the value of this property. - * + * * @param isFallbackPublicClient the isFallbackPublicClient value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -555,7 +524,7 @@ public MicrosoftGraphApplicationInner withIsFallbackPublicClient(Boolean isFallb /** * Get the keyCredentials property: The collection of key credentials associated with the application Not nullable. - * + * * @return the keyCredentials value. */ public List keyCredentials() { @@ -564,7 +533,7 @@ public List keyCredentials() { /** * Set the keyCredentials property: The collection of key credentials associated with the application Not nullable. - * + * * @param keyCredentials the keyCredentials value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -575,7 +544,7 @@ public MicrosoftGraphApplicationInner withKeyCredentials(List passwordCredentials() { @@ -694,19 +663,19 @@ public List passwordCredentials() { /** * Set the passwordCredentials property: The collection of password credentials associated with the application. Not * nullable. - * + * * @param passwordCredentials the passwordCredentials value to set. * @return the MicrosoftGraphApplicationInner object itself. */ - public MicrosoftGraphApplicationInner withPasswordCredentials( - List passwordCredentials) { + public MicrosoftGraphApplicationInner + withPasswordCredentials(List passwordCredentials) { this.passwordCredentials = passwordCredentials; return this; } /** * Get the publicClient property: publicClientApplication. - * + * * @return the publicClient value. */ public MicrosoftGraphPublicClientApplication publicClient() { @@ -715,7 +684,7 @@ public MicrosoftGraphPublicClientApplication publicClient() { /** * Set the publicClient property: publicClientApplication. - * + * * @param publicClient the publicClient value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -726,7 +695,7 @@ public MicrosoftGraphApplicationInner withPublicClient(MicrosoftGraphPublicClien /** * Get the publisherDomain property: The verified publisher domain for the application. Read-only. - * + * * @return the publisherDomain value. */ public String publisherDomain() { @@ -735,7 +704,7 @@ public String publisherDomain() { /** * Set the publisherDomain property: The verified publisher domain for the application. Read-only. - * + * * @param publisherDomain the publisherDomain value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -748,7 +717,7 @@ public MicrosoftGraphApplicationInner withPublisherDomain(String publisherDomain * Get the requiredResourceAccess property: Specifies resources that this application requires access to and the set * of OAuth permission scopes and application roles that it needs under each of those resources. This * pre-configuration of required resource access drives the consent experience. Not nullable. - * + * * @return the requiredResourceAccess value. */ public List requiredResourceAccess() { @@ -759,12 +728,12 @@ public List requiredResourceAccess() { * Set the requiredResourceAccess property: Specifies resources that this application requires access to and the set * of OAuth permission scopes and application roles that it needs under each of those resources. This * pre-configuration of required resource access drives the consent experience. Not nullable. - * + * * @param requiredResourceAccess the requiredResourceAccess value to set. * @return the MicrosoftGraphApplicationInner object itself. */ - public MicrosoftGraphApplicationInner withRequiredResourceAccess( - List requiredResourceAccess) { + public MicrosoftGraphApplicationInner + withRequiredResourceAccess(List requiredResourceAccess) { this.requiredResourceAccess = requiredResourceAccess; return this; } @@ -778,7 +747,7 @@ public MicrosoftGraphApplicationInner withRequiredResourceAccess( * Microsoft account only.For authenticating users with Azure AD B2C user flows, use * AzureADandPersonalMicrosoftAccount. This value allows for the widest set of user identities including local * accounts and user identities from Microsoft, Facebook, Google, Twitter, or any OpenID Connect provider. - * + * * @return the signInAudience value. */ public String signInAudience() { @@ -794,7 +763,7 @@ public String signInAudience() { * Microsoft account only.For authenticating users with Azure AD B2C user flows, use * AzureADandPersonalMicrosoftAccount. This value allows for the widest set of user identities including local * accounts and user identities from Microsoft, Facebook, Google, Twitter, or any OpenID Connect provider. - * + * * @param signInAudience the signInAudience value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -805,7 +774,7 @@ public MicrosoftGraphApplicationInner withSignInAudience(String signInAudience) /** * Get the tags property: Custom strings that can be used to categorize and identify the application. Not nullable. - * + * * @return the tags value. */ public List tags() { @@ -814,7 +783,7 @@ public List tags() { /** * Set the tags property: Custom strings that can be used to categorize and identify the application. Not nullable. - * + * * @param tags the tags value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -828,7 +797,7 @@ public MicrosoftGraphApplicationInner withTags(List tags) { * When configured, Azure AD encrypts all the tokens it emits by using the key this property points to. The * application code that receives the encrypted token must use the matching private key to decrypt the token before * it can be used for the signed-in user. - * + * * @return the tokenEncryptionKeyId value. */ public UUID tokenEncryptionKeyId() { @@ -840,7 +809,7 @@ public UUID tokenEncryptionKeyId() { * When configured, Azure AD encrypts all the tokens it emits by using the key this property points to. The * application code that receives the encrypted token must use the matching private key to decrypt the token before * it can be used for the signed-in user. - * + * * @param tokenEncryptionKeyId the tokenEncryptionKeyId value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -851,7 +820,7 @@ public MicrosoftGraphApplicationInner withTokenEncryptionKeyId(UUID tokenEncrypt /** * Get the web property: webApplication. - * + * * @return the web value. */ public MicrosoftGraphWebApplication web() { @@ -860,7 +829,7 @@ public MicrosoftGraphWebApplication web() { /** * Set the web property: webApplication. - * + * * @param web the web value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -870,11 +839,9 @@ public MicrosoftGraphApplicationInner withWeb(MicrosoftGraphWebApplication web) } /** - * Get the createdOnBehalfOf property: directoryObject - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other - * directory entity types. - * + * Get the createdOnBehalfOf property: Represents an Azure Active Directory object. The directoryObject type is the + * base type for many other directory entity types. + * * @return the createdOnBehalfOf value. */ public MicrosoftGraphDirectoryObjectInner createdOnBehalfOf() { @@ -882,11 +849,9 @@ public MicrosoftGraphDirectoryObjectInner createdOnBehalfOf() { } /** - * Set the createdOnBehalfOf property: directoryObject - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other - * directory entity types. - * + * Set the createdOnBehalfOf property: Represents an Azure Active Directory object. The directoryObject type is the + * base type for many other directory entity types. + * * @param createdOnBehalfOf the createdOnBehalfOf value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -897,7 +862,7 @@ public MicrosoftGraphApplicationInner withCreatedOnBehalfOf(MicrosoftGraphDirect /** * Get the extensionProperties property: Read-only. Nullable. - * + * * @return the extensionProperties value. */ public List extensionProperties() { @@ -906,19 +871,19 @@ public List extensionProperties() { /** * Set the extensionProperties property: Read-only. Nullable. - * + * * @param extensionProperties the extensionProperties value to set. * @return the MicrosoftGraphApplicationInner object itself. */ - public MicrosoftGraphApplicationInner withExtensionProperties( - List extensionProperties) { + public MicrosoftGraphApplicationInner + withExtensionProperties(List extensionProperties) { this.extensionProperties = extensionProperties; return this; } /** * Get the homeRealmDiscoveryPolicies property: The homeRealmDiscoveryPolicies property. - * + * * @return the homeRealmDiscoveryPolicies value. */ public List homeRealmDiscoveryPolicies() { @@ -927,12 +892,12 @@ public List homeRealmDiscoveryPolic /** * Set the homeRealmDiscoveryPolicies property: The homeRealmDiscoveryPolicies property. - * + * * @param homeRealmDiscoveryPolicies the homeRealmDiscoveryPolicies value to set. * @return the MicrosoftGraphApplicationInner object itself. */ - public MicrosoftGraphApplicationInner withHomeRealmDiscoveryPolicies( - List homeRealmDiscoveryPolicies) { + public MicrosoftGraphApplicationInner + withHomeRealmDiscoveryPolicies(List homeRealmDiscoveryPolicies) { this.homeRealmDiscoveryPolicies = homeRealmDiscoveryPolicies; return this; } @@ -940,7 +905,7 @@ public MicrosoftGraphApplicationInner withHomeRealmDiscoveryPolicies( /** * Get the owners property: Directory objects that are owners of the application. The owners are a set of non-admin * users who are allowed to modify this object. Requires version 2013-11-08 or newer. Read-only. Nullable. - * + * * @return the owners value. */ public List owners() { @@ -950,7 +915,7 @@ public List owners() { /** * Set the owners property: Directory objects that are owners of the application. The owners are a set of non-admin * users who are allowed to modify this object. Requires version 2013-11-08 or newer. Read-only. Nullable. - * + * * @param owners the owners value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -961,7 +926,7 @@ public MicrosoftGraphApplicationInner withOwners(List tokenIssuancePolicies() { @@ -970,19 +935,19 @@ public List tokenIssuancePolicies() { /** * Set the tokenIssuancePolicies property: The tokenIssuancePolicies property. - * + * * @param tokenIssuancePolicies the tokenIssuancePolicies value to set. * @return the MicrosoftGraphApplicationInner object itself. */ - public MicrosoftGraphApplicationInner withTokenIssuancePolicies( - List tokenIssuancePolicies) { + public MicrosoftGraphApplicationInner + withTokenIssuancePolicies(List tokenIssuancePolicies) { this.tokenIssuancePolicies = tokenIssuancePolicies; return this; } /** * Get the tokenLifetimePolicies property: The tokenLifetimePolicies property. - * + * * @return the tokenLifetimePolicies value. */ public List tokenLifetimePolicies() { @@ -991,12 +956,12 @@ public List tokenLifetimePolicies() { /** * Set the tokenLifetimePolicies property: The tokenLifetimePolicies property. - * + * * @param tokenLifetimePolicies the tokenLifetimePolicies value to set. * @return the MicrosoftGraphApplicationInner object itself. */ - public MicrosoftGraphApplicationInner withTokenLifetimePolicies( - List tokenLifetimePolicies) { + public MicrosoftGraphApplicationInner + withTokenLifetimePolicies(List tokenLifetimePolicies) { this.tokenLifetimePolicies = tokenLifetimePolicies; return this; } @@ -1004,10 +969,9 @@ public MicrosoftGraphApplicationInner withTokenLifetimePolicies( /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -1015,7 +979,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphApplicationInner object itself. */ @@ -1024,22 +988,18 @@ public MicrosoftGraphApplicationInner withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphApplicationInner withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphApplicationInner withId(String id) { super.withId(id); @@ -1048,7 +1008,7 @@ public MicrosoftGraphApplicationInner withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -1106,4 +1066,197 @@ public void validate() { tokenLifetimePolicies().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeArrayField("addIns", this.addIns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("api", this.api); + jsonWriter.writeStringField("appId", this.appId); + jsonWriter.writeStringField("applicationTemplateId", this.applicationTemplateId); + jsonWriter.writeArrayField("appRoles", this.appRoles, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("groupMembershipClaims", this.groupMembershipClaims); + jsonWriter.writeArrayField("identifierUris", this.identifierUris, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("info", this.info); + jsonWriter.writeBooleanField("isDeviceOnlyAuthSupported", this.isDeviceOnlyAuthSupported); + jsonWriter.writeBooleanField("isFallbackPublicClient", this.isFallbackPublicClient); + jsonWriter.writeArrayField("keyCredentials", this.keyCredentials, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("logo", Objects.toString(this.logo, null)); + jsonWriter.writeStringField("notes", this.notes); + jsonWriter.writeBooleanField("oauth2RequirePostResponse", this.oauth2RequirePostResponse); + jsonWriter.writeJsonField("optionalClaims", this.optionalClaims); + jsonWriter.writeJsonField("parentalControlSettings", this.parentalControlSettings); + jsonWriter.writeArrayField("passwordCredentials", this.passwordCredentials, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("publicClient", this.publicClient); + jsonWriter.writeStringField("publisherDomain", this.publisherDomain); + jsonWriter.writeArrayField("requiredResourceAccess", this.requiredResourceAccess, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("signInAudience", this.signInAudience); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("tokenEncryptionKeyId", Objects.toString(this.tokenEncryptionKeyId, null)); + jsonWriter.writeJsonField("web", this.web); + jsonWriter.writeJsonField("createdOnBehalfOf", this.createdOnBehalfOf); + jsonWriter.writeArrayField("extensionProperties", this.extensionProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("homeRealmDiscoveryPolicies", this.homeRealmDiscoveryPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("owners", this.owners, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tokenIssuancePolicies", this.tokenIssuancePolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tokenLifetimePolicies", this.tokenLifetimePolicies, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphApplicationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphApplicationInner 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 MicrosoftGraphApplicationInner. + */ + public static MicrosoftGraphApplicationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphApplicationInner deserializedMicrosoftGraphApplicationInner + = new MicrosoftGraphApplicationInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("addIns".equals(fieldName)) { + List addIns + = reader.readArray(reader1 -> MicrosoftGraphAddIn.fromJson(reader1)); + deserializedMicrosoftGraphApplicationInner.addIns = addIns; + } else if ("api".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.api = MicrosoftGraphApiApplication.fromJson(reader); + } else if ("appId".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.appId = reader.getString(); + } else if ("applicationTemplateId".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.applicationTemplateId = reader.getString(); + } else if ("appRoles".equals(fieldName)) { + List appRoles + = reader.readArray(reader1 -> MicrosoftGraphAppRole.fromJson(reader1)); + deserializedMicrosoftGraphApplicationInner.appRoles = appRoles; + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.displayName = reader.getString(); + } else if ("groupMembershipClaims".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.groupMembershipClaims = reader.getString(); + } else if ("identifierUris".equals(fieldName)) { + List identifierUris = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphApplicationInner.identifierUris = identifierUris; + } else if ("info".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.info = MicrosoftGraphInformationalUrl.fromJson(reader); + } else if ("isDeviceOnlyAuthSupported".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.isDeviceOnlyAuthSupported + = reader.getNullable(JsonReader::getBoolean); + } else if ("isFallbackPublicClient".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.isFallbackPublicClient + = reader.getNullable(JsonReader::getBoolean); + } else if ("keyCredentials".equals(fieldName)) { + List keyCredentials + = reader.readArray(reader1 -> MicrosoftGraphKeyCredentialInner.fromJson(reader1)); + deserializedMicrosoftGraphApplicationInner.keyCredentials = keyCredentials; + } else if ("logo".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.logo + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("notes".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.notes = reader.getString(); + } else if ("oauth2RequirePostResponse".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.oauth2RequirePostResponse + = reader.getNullable(JsonReader::getBoolean); + } else if ("optionalClaims".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.optionalClaims + = MicrosoftGraphOptionalClaims.fromJson(reader); + } else if ("parentalControlSettings".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.parentalControlSettings + = MicrosoftGraphParentalControlSettings.fromJson(reader); + } else if ("passwordCredentials".equals(fieldName)) { + List passwordCredentials + = reader.readArray(reader1 -> MicrosoftGraphPasswordCredentialInner.fromJson(reader1)); + deserializedMicrosoftGraphApplicationInner.passwordCredentials = passwordCredentials; + } else if ("publicClient".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.publicClient + = MicrosoftGraphPublicClientApplication.fromJson(reader); + } else if ("publisherDomain".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.publisherDomain = reader.getString(); + } else if ("requiredResourceAccess".equals(fieldName)) { + List requiredResourceAccess + = reader.readArray(reader1 -> MicrosoftGraphRequiredResourceAccess.fromJson(reader1)); + deserializedMicrosoftGraphApplicationInner.requiredResourceAccess = requiredResourceAccess; + } else if ("signInAudience".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.signInAudience = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphApplicationInner.tags = tags; + } else if ("tokenEncryptionKeyId".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.tokenEncryptionKeyId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("web".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.web = MicrosoftGraphWebApplication.fromJson(reader); + } else if ("createdOnBehalfOf".equals(fieldName)) { + deserializedMicrosoftGraphApplicationInner.createdOnBehalfOf + = MicrosoftGraphDirectoryObjectInner.fromJson(reader); + } else if ("extensionProperties".equals(fieldName)) { + List extensionProperties + = reader.readArray(reader1 -> MicrosoftGraphExtensionPropertyInner.fromJson(reader1)); + deserializedMicrosoftGraphApplicationInner.extensionProperties = extensionProperties; + } else if ("homeRealmDiscoveryPolicies".equals(fieldName)) { + List homeRealmDiscoveryPolicies + = reader.readArray(reader1 -> MicrosoftGraphHomeRealmDiscoveryPolicyInner.fromJson(reader1)); + deserializedMicrosoftGraphApplicationInner.homeRealmDiscoveryPolicies = homeRealmDiscoveryPolicies; + } else if ("owners".equals(fieldName)) { + List owners + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphApplicationInner.owners = owners; + } else if ("tokenIssuancePolicies".equals(fieldName)) { + List tokenIssuancePolicies + = reader.readArray(reader1 -> MicrosoftGraphTokenIssuancePolicy.fromJson(reader1)); + deserializedMicrosoftGraphApplicationInner.tokenIssuancePolicies = tokenIssuancePolicies; + } else if ("tokenLifetimePolicies".equals(fieldName)) { + List tokenLifetimePolicies + = reader.readArray(reader1 -> MicrosoftGraphTokenLifetimePolicy.fromJson(reader1)); + deserializedMicrosoftGraphApplicationInner.tokenLifetimePolicies = tokenLifetimePolicies; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphApplicationInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphApplicationInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedLabel.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedLabel.java index c0adfe09caae6..831b26baedba8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedLabel.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedLabel.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** assignedLabel. */ +/** + * assignedLabel. + */ @Fluent -public final class MicrosoftGraphAssignedLabel { +public final class MicrosoftGraphAssignedLabel implements JsonSerializable { /* * The display name of the label. Read-only. */ - @JsonProperty(value = "displayName") private String displayName; /* * The unique identifier of the label. */ - @JsonProperty(value = "labelId") private String labelId; /* * assignedLabel */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAssignedLabel class. */ + /** + * Creates an instance of MicrosoftGraphAssignedLabel class. + */ public MicrosoftGraphAssignedLabel() { } /** * Get the displayName property: The display name of the label. Read-only. - * + * * @return the displayName value. */ public String displayName() { @@ -47,7 +50,7 @@ public String displayName() { /** * Set the displayName property: The display name of the label. Read-only. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphAssignedLabel object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphAssignedLabel withDisplayName(String displayName) { /** * Get the labelId property: The unique identifier of the label. - * + * * @return the labelId value. */ public String labelId() { @@ -67,7 +70,7 @@ public String labelId() { /** * Set the labelId property: The unique identifier of the label. - * + * * @param labelId the labelId value to set. * @return the MicrosoftGraphAssignedLabel object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphAssignedLabel withLabelId(String labelId) { /** * Get the additionalProperties property: assignedLabel. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: assignedLabel. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAssignedLabel object itself. */ @@ -97,19 +99,61 @@ public MicrosoftGraphAssignedLabel withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("labelId", this.labelId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAssignedLabel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAssignedLabel 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 MicrosoftGraphAssignedLabel. + */ + public static MicrosoftGraphAssignedLabel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAssignedLabel deserializedMicrosoftGraphAssignedLabel = new MicrosoftGraphAssignedLabel(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphAssignedLabel.displayName = reader.getString(); + } else if ("labelId".equals(fieldName)) { + deserializedMicrosoftGraphAssignedLabel.labelId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAssignedLabel.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAssignedLabel; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedLicense.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedLicense.java index ff6093fedcc7e..eaaddff34595a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedLicense.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedLicense.java @@ -5,42 +5,46 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** assignedLicense. */ +/** + * assignedLicense. + */ @Fluent -public final class MicrosoftGraphAssignedLicense { +public final class MicrosoftGraphAssignedLicense implements JsonSerializable { /* * A collection of the unique identifiers for plans that have been disabled. */ - @JsonProperty(value = "disabledPlans") private List disabledPlans; /* * The unique identifier for the SKU. */ - @JsonProperty(value = "skuId") private UUID skuId; /* * assignedLicense */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAssignedLicense class. */ + /** + * Creates an instance of MicrosoftGraphAssignedLicense class. + */ public MicrosoftGraphAssignedLicense() { } /** * Get the disabledPlans property: A collection of the unique identifiers for plans that have been disabled. - * + * * @return the disabledPlans value. */ public List disabledPlans() { @@ -49,7 +53,7 @@ public List disabledPlans() { /** * Set the disabledPlans property: A collection of the unique identifiers for plans that have been disabled. - * + * * @param disabledPlans the disabledPlans value to set. * @return the MicrosoftGraphAssignedLicense object itself. */ @@ -60,7 +64,7 @@ public MicrosoftGraphAssignedLicense withDisabledPlans(List disabledPlans) /** * Get the skuId property: The unique identifier for the SKU. - * + * * @return the skuId value. */ public UUID skuId() { @@ -69,7 +73,7 @@ public UUID skuId() { /** * Set the skuId property: The unique identifier for the SKU. - * + * * @param skuId the skuId value to set. * @return the MicrosoftGraphAssignedLicense object itself. */ @@ -80,17 +84,16 @@ public MicrosoftGraphAssignedLicense withSkuId(UUID skuId) { /** * Get the additionalProperties property: assignedLicense. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: assignedLicense. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAssignedLicense object itself. */ @@ -99,19 +102,66 @@ public MicrosoftGraphAssignedLicense withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("disabledPlans", this.disabledPlans, + (writer, element) -> writer.writeString(Objects.toString(element, null))); + jsonWriter.writeStringField("skuId", Objects.toString(this.skuId, null)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAssignedLicense from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAssignedLicense 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 MicrosoftGraphAssignedLicense. + */ + public static MicrosoftGraphAssignedLicense fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAssignedLicense deserializedMicrosoftGraphAssignedLicense + = new MicrosoftGraphAssignedLicense(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("disabledPlans".equals(fieldName)) { + List disabledPlans = reader.readArray( + reader1 -> reader1.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()))); + deserializedMicrosoftGraphAssignedLicense.disabledPlans = disabledPlans; + } else if ("skuId".equals(fieldName)) { + deserializedMicrosoftGraphAssignedLicense.skuId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAssignedLicense.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAssignedLicense; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedPlan.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedPlan.java index 513f04e25edf0..8b7e0b414b1eb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedPlan.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAssignedPlan.java @@ -5,54 +5,58 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** assignedPlan. */ +/** + * assignedPlan. + */ @Fluent -public final class MicrosoftGraphAssignedPlan { +public final class MicrosoftGraphAssignedPlan implements JsonSerializable { /* * The assignedDateTime property. */ - @JsonProperty(value = "assignedDateTime") private OffsetDateTime assignedDateTime; /* * Condition of the capability assignment. The possible values are Enabled, Warning, Suspended, Deleted, LockedOut. */ - @JsonProperty(value = "capabilityStatus") private String capabilityStatus; /* * The name of the service; for example, 'Exchange'. */ - @JsonProperty(value = "service") private String service; /* * A GUID that identifies the service plan. */ - @JsonProperty(value = "servicePlanId") private UUID servicePlanId; /* * assignedPlan */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAssignedPlan class. */ + /** + * Creates an instance of MicrosoftGraphAssignedPlan class. + */ public MicrosoftGraphAssignedPlan() { } /** * Get the assignedDateTime property: The assignedDateTime property. - * + * * @return the assignedDateTime value. */ public OffsetDateTime assignedDateTime() { @@ -61,7 +65,7 @@ public OffsetDateTime assignedDateTime() { /** * Set the assignedDateTime property: The assignedDateTime property. - * + * * @param assignedDateTime the assignedDateTime value to set. * @return the MicrosoftGraphAssignedPlan object itself. */ @@ -73,7 +77,7 @@ public MicrosoftGraphAssignedPlan withAssignedDateTime(OffsetDateTime assignedDa /** * Get the capabilityStatus property: Condition of the capability assignment. The possible values are Enabled, * Warning, Suspended, Deleted, LockedOut. - * + * * @return the capabilityStatus value. */ public String capabilityStatus() { @@ -83,7 +87,7 @@ public String capabilityStatus() { /** * Set the capabilityStatus property: Condition of the capability assignment. The possible values are Enabled, * Warning, Suspended, Deleted, LockedOut. - * + * * @param capabilityStatus the capabilityStatus value to set. * @return the MicrosoftGraphAssignedPlan object itself. */ @@ -94,7 +98,7 @@ public MicrosoftGraphAssignedPlan withCapabilityStatus(String capabilityStatus) /** * Get the service property: The name of the service; for example, 'Exchange'. - * + * * @return the service value. */ public String service() { @@ -103,7 +107,7 @@ public String service() { /** * Set the service property: The name of the service; for example, 'Exchange'. - * + * * @param service the service value to set. * @return the MicrosoftGraphAssignedPlan object itself. */ @@ -114,7 +118,7 @@ public MicrosoftGraphAssignedPlan withService(String service) { /** * Get the servicePlanId property: A GUID that identifies the service plan. - * + * * @return the servicePlanId value. */ public UUID servicePlanId() { @@ -123,7 +127,7 @@ public UUID servicePlanId() { /** * Set the servicePlanId property: A GUID that identifies the service plan. - * + * * @param servicePlanId the servicePlanId value to set. * @return the MicrosoftGraphAssignedPlan object itself. */ @@ -134,17 +138,16 @@ public MicrosoftGraphAssignedPlan withServicePlanId(UUID servicePlanId) { /** * Get the additionalProperties property: assignedPlan. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: assignedPlan. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAssignedPlan object itself. */ @@ -153,19 +156,72 @@ public MicrosoftGraphAssignedPlan withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("assignedDateTime", + this.assignedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.assignedDateTime)); + jsonWriter.writeStringField("capabilityStatus", this.capabilityStatus); + jsonWriter.writeStringField("service", this.service); + jsonWriter.writeStringField("servicePlanId", Objects.toString(this.servicePlanId, null)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAssignedPlan from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAssignedPlan 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 MicrosoftGraphAssignedPlan. + */ + public static MicrosoftGraphAssignedPlan fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAssignedPlan deserializedMicrosoftGraphAssignedPlan = new MicrosoftGraphAssignedPlan(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphAssignedPlan.assignedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("capabilityStatus".equals(fieldName)) { + deserializedMicrosoftGraphAssignedPlan.capabilityStatus = reader.getString(); + } else if ("service".equals(fieldName)) { + deserializedMicrosoftGraphAssignedPlan.service = reader.getString(); + } else if ("servicePlanId".equals(fieldName)) { + deserializedMicrosoftGraphAssignedPlan.servicePlanId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAssignedPlan.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAssignedPlan; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachment.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachment.java index 2c51516449238..2374f88372246 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachment.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachment.java @@ -5,60 +5,61 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** attachment. */ +/** + * attachment. + */ @Fluent public final class MicrosoftGraphAttachment extends MicrosoftGraphEntity { /* * The MIME type. */ - @JsonProperty(value = "contentType") private String contentType; /* * true if the attachment is an inline attachment; otherwise, false. */ - @JsonProperty(value = "isInline") private Boolean isInline; /* * The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * The attachment's file name. */ - @JsonProperty(value = "name") private String name; /* * The length of the attachment in bytes. */ - @JsonProperty(value = "size") private Integer size; /* * attachment */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAttachment class. */ + /** + * Creates an instance of MicrosoftGraphAttachment class. + */ public MicrosoftGraphAttachment() { } /** * Get the contentType property: The MIME type. - * + * * @return the contentType value. */ public String contentType() { @@ -67,7 +68,7 @@ public String contentType() { /** * Set the contentType property: The MIME type. - * + * * @param contentType the contentType value to set. * @return the MicrosoftGraphAttachment object itself. */ @@ -78,7 +79,7 @@ public MicrosoftGraphAttachment withContentType(String contentType) { /** * Get the isInline property: true if the attachment is an inline attachment; otherwise, false. - * + * * @return the isInline value. */ public Boolean isInline() { @@ -87,7 +88,7 @@ public Boolean isInline() { /** * Set the isInline property: true if the attachment is an inline attachment; otherwise, false. - * + * * @param isInline the isInline value to set. * @return the MicrosoftGraphAttachment object itself. */ @@ -100,7 +101,7 @@ public MicrosoftGraphAttachment withIsInline(Boolean isInline) { * Get the lastModifiedDateTime property: The Timestamp type represents date and time information using ISO 8601 * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -111,7 +112,7 @@ public OffsetDateTime lastModifiedDateTime() { * Set the lastModifiedDateTime property: The Timestamp type represents date and time information using ISO 8601 * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphAttachment object itself. */ @@ -122,7 +123,7 @@ public MicrosoftGraphAttachment withLastModifiedDateTime(OffsetDateTime lastModi /** * Get the name property: The attachment's file name. - * + * * @return the name value. */ public String name() { @@ -131,7 +132,7 @@ public String name() { /** * Set the name property: The attachment's file name. - * + * * @param name the name value to set. * @return the MicrosoftGraphAttachment object itself. */ @@ -142,7 +143,7 @@ public MicrosoftGraphAttachment withName(String name) { /** * Get the size property: The length of the attachment in bytes. - * + * * @return the size value. */ public Integer size() { @@ -151,7 +152,7 @@ public Integer size() { /** * Set the size property: The length of the attachment in bytes. - * + * * @param size the size value to set. * @return the MicrosoftGraphAttachment object itself. */ @@ -162,17 +163,16 @@ public MicrosoftGraphAttachment withSize(Integer size) { /** * Get the additionalProperties property: attachment. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: attachment. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAttachment object itself. */ @@ -181,15 +181,9 @@ public MicrosoftGraphAttachment withAdditionalProperties(Map add return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphAttachment withId(String id) { super.withId(id); @@ -198,11 +192,77 @@ public MicrosoftGraphAttachment withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("contentType", this.contentType); + jsonWriter.writeBooleanField("isInline", this.isInline); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("size", this.size); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAttachment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAttachment 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 MicrosoftGraphAttachment. + */ + public static MicrosoftGraphAttachment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAttachment deserializedMicrosoftGraphAttachment = new MicrosoftGraphAttachment(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphAttachment.withId(reader.getString()); + } else if ("contentType".equals(fieldName)) { + deserializedMicrosoftGraphAttachment.contentType = reader.getString(); + } else if ("isInline".equals(fieldName)) { + deserializedMicrosoftGraphAttachment.isInline = reader.getNullable(JsonReader::getBoolean); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphAttachment.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphAttachment.name = reader.getString(); + } else if ("size".equals(fieldName)) { + deserializedMicrosoftGraphAttachment.size = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAttachment.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAttachment; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachmentItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachmentItem.java index 65fd1c511575c..6d8e733b0a4d4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachmentItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachmentItem.java @@ -5,59 +5,59 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** attachmentItem. */ +/** + * attachmentItem. + */ @Fluent -public final class MicrosoftGraphAttachmentItem { +public final class MicrosoftGraphAttachmentItem implements JsonSerializable { /* * attachmentType */ - @JsonProperty(value = "attachmentType") private MicrosoftGraphAttachmentType attachmentType; /* * The nature of the data in the attachment. Optional. */ - @JsonProperty(value = "contentType") private String contentType; /* * true if the attachment is an inline attachment; otherwise, false. Optional. */ - @JsonProperty(value = "isInline") private Boolean isInline; /* * The display name of the attachment. This can be a descriptive string and does not have to be the actual file * name. Required. */ - @JsonProperty(value = "name") private String name; /* * The length of the attachment in bytes. Required. */ - @JsonProperty(value = "size") private Long size; /* * attachmentItem */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAttachmentItem class. */ + /** + * Creates an instance of MicrosoftGraphAttachmentItem class. + */ public MicrosoftGraphAttachmentItem() { } /** * Get the attachmentType property: attachmentType. - * + * * @return the attachmentType value. */ public MicrosoftGraphAttachmentType attachmentType() { @@ -66,7 +66,7 @@ public MicrosoftGraphAttachmentType attachmentType() { /** * Set the attachmentType property: attachmentType. - * + * * @param attachmentType the attachmentType value to set. * @return the MicrosoftGraphAttachmentItem object itself. */ @@ -77,7 +77,7 @@ public MicrosoftGraphAttachmentItem withAttachmentType(MicrosoftGraphAttachmentT /** * Get the contentType property: The nature of the data in the attachment. Optional. - * + * * @return the contentType value. */ public String contentType() { @@ -86,7 +86,7 @@ public String contentType() { /** * Set the contentType property: The nature of the data in the attachment. Optional. - * + * * @param contentType the contentType value to set. * @return the MicrosoftGraphAttachmentItem object itself. */ @@ -97,7 +97,7 @@ public MicrosoftGraphAttachmentItem withContentType(String contentType) { /** * Get the isInline property: true if the attachment is an inline attachment; otherwise, false. Optional. - * + * * @return the isInline value. */ public Boolean isInline() { @@ -106,7 +106,7 @@ public Boolean isInline() { /** * Set the isInline property: true if the attachment is an inline attachment; otherwise, false. Optional. - * + * * @param isInline the isInline value to set. * @return the MicrosoftGraphAttachmentItem object itself. */ @@ -118,7 +118,7 @@ public MicrosoftGraphAttachmentItem withIsInline(Boolean isInline) { /** * Get the name property: The display name of the attachment. This can be a descriptive string and does not have to * be the actual file name. Required. - * + * * @return the name value. */ public String name() { @@ -128,7 +128,7 @@ public String name() { /** * Set the name property: The display name of the attachment. This can be a descriptive string and does not have to * be the actual file name. Required. - * + * * @param name the name value to set. * @return the MicrosoftGraphAttachmentItem object itself. */ @@ -139,7 +139,7 @@ public MicrosoftGraphAttachmentItem withName(String name) { /** * Get the size property: The length of the attachment in bytes. Required. - * + * * @return the size value. */ public Long size() { @@ -148,7 +148,7 @@ public Long size() { /** * Set the size property: The length of the attachment in bytes. Required. - * + * * @param size the size value to set. * @return the MicrosoftGraphAttachmentItem object itself. */ @@ -159,17 +159,16 @@ public MicrosoftGraphAttachmentItem withSize(Long size) { /** * Get the additionalProperties property: attachmentItem. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: attachmentItem. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAttachmentItem object itself. */ @@ -178,19 +177,72 @@ public MicrosoftGraphAttachmentItem withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attachmentType", + this.attachmentType == null ? null : this.attachmentType.toString()); + jsonWriter.writeStringField("contentType", this.contentType); + jsonWriter.writeBooleanField("isInline", this.isInline); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("size", this.size); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAttachmentItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAttachmentItem 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 MicrosoftGraphAttachmentItem. + */ + public static MicrosoftGraphAttachmentItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAttachmentItem deserializedMicrosoftGraphAttachmentItem = new MicrosoftGraphAttachmentItem(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attachmentType".equals(fieldName)) { + deserializedMicrosoftGraphAttachmentItem.attachmentType + = MicrosoftGraphAttachmentType.fromString(reader.getString()); + } else if ("contentType".equals(fieldName)) { + deserializedMicrosoftGraphAttachmentItem.contentType = reader.getString(); + } else if ("isInline".equals(fieldName)) { + deserializedMicrosoftGraphAttachmentItem.isInline = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphAttachmentItem.name = reader.getString(); + } else if ("size".equals(fieldName)) { + deserializedMicrosoftGraphAttachmentItem.size = reader.getNullable(JsonReader::getLong); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAttachmentItem.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAttachmentItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachmentType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachmentType.java index c636fe49872c7..2a621711a4e25 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachmentType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttachmentType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** attachmentType. */ +/** + * attachmentType. + */ public final class MicrosoftGraphAttachmentType extends ExpandableStringEnum { - /** Static value file for MicrosoftGraphAttachmentType. */ + /** + * Static value file for MicrosoftGraphAttachmentType. + */ public static final MicrosoftGraphAttachmentType FILE = fromString("file"); - /** Static value item for MicrosoftGraphAttachmentType. */ + /** + * Static value item for MicrosoftGraphAttachmentType. + */ public static final MicrosoftGraphAttachmentType ITEM = fromString("item"); - /** Static value reference for MicrosoftGraphAttachmentType. */ + /** + * Static value reference for MicrosoftGraphAttachmentType. + */ public static final MicrosoftGraphAttachmentType REFERENCE = fromString("reference"); /** * Creates a new instance of MicrosoftGraphAttachmentType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public MicrosoftGraphAttachmentType() { /** * Creates or finds a MicrosoftGraphAttachmentType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphAttachmentType. */ - @JsonCreator public static MicrosoftGraphAttachmentType fromString(String name) { return fromString(name, MicrosoftGraphAttachmentType.class); } /** * Gets known MicrosoftGraphAttachmentType values. - * + * * @return known MicrosoftGraphAttachmentType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendee.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendee.java index 0cafef00dd88e..0b2461f01fa69 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendee.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendee.java @@ -5,40 +5,42 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** attendee. */ +/** + * attendee. + */ @Fluent public final class MicrosoftGraphAttendee extends MicrosoftGraphAttendeeBase { /* * timeSlot */ - @JsonProperty(value = "proposedNewTime") private MicrosoftGraphTimeSlot proposedNewTime; /* * responseStatus */ - @JsonProperty(value = "status") private MicrosoftGraphResponseStatus status; /* * attendee */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAttendee class. */ + /** + * Creates an instance of MicrosoftGraphAttendee class. + */ public MicrosoftGraphAttendee() { } /** * Get the proposedNewTime property: timeSlot. - * + * * @return the proposedNewTime value. */ public MicrosoftGraphTimeSlot proposedNewTime() { @@ -47,7 +49,7 @@ public MicrosoftGraphTimeSlot proposedNewTime() { /** * Set the proposedNewTime property: timeSlot. - * + * * @param proposedNewTime the proposedNewTime value to set. * @return the MicrosoftGraphAttendee object itself. */ @@ -58,7 +60,7 @@ public MicrosoftGraphAttendee withProposedNewTime(MicrosoftGraphTimeSlot propose /** * Get the status property: responseStatus. - * + * * @return the status value. */ public MicrosoftGraphResponseStatus status() { @@ -67,7 +69,7 @@ public MicrosoftGraphResponseStatus status() { /** * Set the status property: responseStatus. - * + * * @param status the status value to set. * @return the MicrosoftGraphAttendee object itself. */ @@ -78,17 +80,16 @@ public MicrosoftGraphAttendee withStatus(MicrosoftGraphResponseStatus status) { /** * Get the additionalProperties property: attendee. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: attendee. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAttendee object itself. */ @@ -97,22 +98,18 @@ public MicrosoftGraphAttendee withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphAttendee withType(MicrosoftGraphAttendeeType type) { super.withType(type); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphAttendee withEmailAddress(MicrosoftGraphEmailAddress emailAddress) { super.withEmailAddress(emailAddress); @@ -121,7 +118,7 @@ public MicrosoftGraphAttendee withEmailAddress(MicrosoftGraphEmailAddress emailA /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -134,4 +131,61 @@ public void validate() { status().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("emailAddress", emailAddress()); + jsonWriter.writeStringField("type", type() == null ? null : type().toString()); + jsonWriter.writeJsonField("proposedNewTime", this.proposedNewTime); + jsonWriter.writeJsonField("status", this.status); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAttendee from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAttendee 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 MicrosoftGraphAttendee. + */ + public static MicrosoftGraphAttendee fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAttendee deserializedMicrosoftGraphAttendee = new MicrosoftGraphAttendee(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("emailAddress".equals(fieldName)) { + deserializedMicrosoftGraphAttendee.withEmailAddress(MicrosoftGraphEmailAddress.fromJson(reader)); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphAttendee + .withType(MicrosoftGraphAttendeeType.fromString(reader.getString())); + } else if ("proposedNewTime".equals(fieldName)) { + deserializedMicrosoftGraphAttendee.proposedNewTime = MicrosoftGraphTimeSlot.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedMicrosoftGraphAttendee.status = MicrosoftGraphResponseStatus.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAttendee.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAttendee; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendeeBase.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendeeBase.java index b293b9fbb9359..981f90c84caf5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendeeBase.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendeeBase.java @@ -5,34 +5,37 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** attendeeBase. */ +/** + * attendeeBase. + */ @Fluent public class MicrosoftGraphAttendeeBase extends MicrosoftGraphRecipient { /* * attendeeType */ - @JsonProperty(value = "type") private MicrosoftGraphAttendeeType type; /* * attendeeBase */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAttendeeBase class. */ + /** + * Creates an instance of MicrosoftGraphAttendeeBase class. + */ public MicrosoftGraphAttendeeBase() { } /** * Get the type property: attendeeType. - * + * * @return the type value. */ public MicrosoftGraphAttendeeType type() { @@ -41,7 +44,7 @@ public MicrosoftGraphAttendeeType type() { /** * Set the type property: attendeeType. - * + * * @param type the type value to set. * @return the MicrosoftGraphAttendeeBase object itself. */ @@ -52,17 +55,16 @@ public MicrosoftGraphAttendeeBase withType(MicrosoftGraphAttendeeType type) { /** * Get the additionalProperties property: attendeeBase. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: attendeeBase. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAttendeeBase object itself. */ @@ -71,15 +73,9 @@ public MicrosoftGraphAttendeeBase withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphAttendeeBase withEmailAddress(MicrosoftGraphEmailAddress emailAddress) { super.withEmailAddress(emailAddress); @@ -88,11 +84,63 @@ public MicrosoftGraphAttendeeBase withEmailAddress(MicrosoftGraphEmailAddress em /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("emailAddress", emailAddress()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAttendeeBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAttendeeBase 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 MicrosoftGraphAttendeeBase. + */ + public static MicrosoftGraphAttendeeBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAttendeeBase deserializedMicrosoftGraphAttendeeBase = new MicrosoftGraphAttendeeBase(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("emailAddress".equals(fieldName)) { + deserializedMicrosoftGraphAttendeeBase + .withEmailAddress(MicrosoftGraphEmailAddress.fromJson(reader)); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphAttendeeBase.type + = MicrosoftGraphAttendeeType.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAttendeeBase.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAttendeeBase; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendeeType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendeeType.java index de7b6bd7ba449..180e69c6132e8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendeeType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAttendeeType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** attendeeType. */ +/** + * attendeeType. + */ public final class MicrosoftGraphAttendeeType extends ExpandableStringEnum { - /** Static value required for MicrosoftGraphAttendeeType. */ + /** + * Static value required for MicrosoftGraphAttendeeType. + */ public static final MicrosoftGraphAttendeeType REQUIRED = fromString("required"); - /** Static value optional for MicrosoftGraphAttendeeType. */ + /** + * Static value optional for MicrosoftGraphAttendeeType. + */ public static final MicrosoftGraphAttendeeType OPTIONAL = fromString("optional"); - /** Static value resource for MicrosoftGraphAttendeeType. */ + /** + * Static value resource for MicrosoftGraphAttendeeType. + */ public static final MicrosoftGraphAttendeeType RESOURCE = fromString("resource"); /** * Creates a new instance of MicrosoftGraphAttendeeType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public MicrosoftGraphAttendeeType() { /** * Creates or finds a MicrosoftGraphAttendeeType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphAttendeeType. */ - @JsonCreator public static MicrosoftGraphAttendeeType fromString(String name) { return fromString(name, MicrosoftGraphAttendeeType.class); } /** * Gets known MicrosoftGraphAttendeeType values. - * + * * @return known MicrosoftGraphAttendeeType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAudio.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAudio.java index 900821917e0a3..75629d4feaa3a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAudio.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAudio.java @@ -5,124 +5,113 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** audio. */ +/** + * audio. + */ @Fluent -public final class MicrosoftGraphAudio { +public final class MicrosoftGraphAudio implements JsonSerializable { /* * The title of the album for this audio file. */ - @JsonProperty(value = "album") private String album; /* * The artist named on the album for the audio file. */ - @JsonProperty(value = "albumArtist") private String albumArtist; /* * The performing artist for the audio file. */ - @JsonProperty(value = "artist") private String artist; /* * Bitrate expressed in kbps. */ - @JsonProperty(value = "bitrate") private Long bitrate; /* * The name of the composer of the audio file. */ - @JsonProperty(value = "composers") private String composers; /* * Copyright information for the audio file. */ - @JsonProperty(value = "copyright") private String copyright; /* * The number of the disc this audio file came from. */ - @JsonProperty(value = "disc") private Integer disc; /* * The total number of discs in this album. */ - @JsonProperty(value = "discCount") private Integer discCount; /* * Duration of the audio file, expressed in milliseconds */ - @JsonProperty(value = "duration") private Long duration; /* * The genre of this audio file. */ - @JsonProperty(value = "genre") private String genre; /* * Indicates if the file is protected with digital rights management. */ - @JsonProperty(value = "hasDrm") private Boolean hasDrm; /* * Indicates if the file is encoded with a variable bitrate. */ - @JsonProperty(value = "isVariableBitrate") private Boolean isVariableBitrate; /* * The title of the audio file. */ - @JsonProperty(value = "title") private String title; /* * The number of the track on the original disc for this audio file. */ - @JsonProperty(value = "track") private Integer track; /* * The total number of tracks on the original disc for this audio file. */ - @JsonProperty(value = "trackCount") private Integer trackCount; /* * The year the audio file was recorded. */ - @JsonProperty(value = "year") private Integer year; /* * audio */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAudio class. */ + /** + * Creates an instance of MicrosoftGraphAudio class. + */ public MicrosoftGraphAudio() { } /** * Get the album property: The title of the album for this audio file. - * + * * @return the album value. */ public String album() { @@ -131,7 +120,7 @@ public String album() { /** * Set the album property: The title of the album for this audio file. - * + * * @param album the album value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -142,7 +131,7 @@ public MicrosoftGraphAudio withAlbum(String album) { /** * Get the albumArtist property: The artist named on the album for the audio file. - * + * * @return the albumArtist value. */ public String albumArtist() { @@ -151,7 +140,7 @@ public String albumArtist() { /** * Set the albumArtist property: The artist named on the album for the audio file. - * + * * @param albumArtist the albumArtist value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -162,7 +151,7 @@ public MicrosoftGraphAudio withAlbumArtist(String albumArtist) { /** * Get the artist property: The performing artist for the audio file. - * + * * @return the artist value. */ public String artist() { @@ -171,7 +160,7 @@ public String artist() { /** * Set the artist property: The performing artist for the audio file. - * + * * @param artist the artist value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -182,7 +171,7 @@ public MicrosoftGraphAudio withArtist(String artist) { /** * Get the bitrate property: Bitrate expressed in kbps. - * + * * @return the bitrate value. */ public Long bitrate() { @@ -191,7 +180,7 @@ public Long bitrate() { /** * Set the bitrate property: Bitrate expressed in kbps. - * + * * @param bitrate the bitrate value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -202,7 +191,7 @@ public MicrosoftGraphAudio withBitrate(Long bitrate) { /** * Get the composers property: The name of the composer of the audio file. - * + * * @return the composers value. */ public String composers() { @@ -211,7 +200,7 @@ public String composers() { /** * Set the composers property: The name of the composer of the audio file. - * + * * @param composers the composers value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -222,7 +211,7 @@ public MicrosoftGraphAudio withComposers(String composers) { /** * Get the copyright property: Copyright information for the audio file. - * + * * @return the copyright value. */ public String copyright() { @@ -231,7 +220,7 @@ public String copyright() { /** * Set the copyright property: Copyright information for the audio file. - * + * * @param copyright the copyright value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -242,7 +231,7 @@ public MicrosoftGraphAudio withCopyright(String copyright) { /** * Get the disc property: The number of the disc this audio file came from. - * + * * @return the disc value. */ public Integer disc() { @@ -251,7 +240,7 @@ public Integer disc() { /** * Set the disc property: The number of the disc this audio file came from. - * + * * @param disc the disc value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -262,7 +251,7 @@ public MicrosoftGraphAudio withDisc(Integer disc) { /** * Get the discCount property: The total number of discs in this album. - * + * * @return the discCount value. */ public Integer discCount() { @@ -271,7 +260,7 @@ public Integer discCount() { /** * Set the discCount property: The total number of discs in this album. - * + * * @param discCount the discCount value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -282,7 +271,7 @@ public MicrosoftGraphAudio withDiscCount(Integer discCount) { /** * Get the duration property: Duration of the audio file, expressed in milliseconds. - * + * * @return the duration value. */ public Long duration() { @@ -291,7 +280,7 @@ public Long duration() { /** * Set the duration property: Duration of the audio file, expressed in milliseconds. - * + * * @param duration the duration value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -302,7 +291,7 @@ public MicrosoftGraphAudio withDuration(Long duration) { /** * Get the genre property: The genre of this audio file. - * + * * @return the genre value. */ public String genre() { @@ -311,7 +300,7 @@ public String genre() { /** * Set the genre property: The genre of this audio file. - * + * * @param genre the genre value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -322,7 +311,7 @@ public MicrosoftGraphAudio withGenre(String genre) { /** * Get the hasDrm property: Indicates if the file is protected with digital rights management. - * + * * @return the hasDrm value. */ public Boolean hasDrm() { @@ -331,7 +320,7 @@ public Boolean hasDrm() { /** * Set the hasDrm property: Indicates if the file is protected with digital rights management. - * + * * @param hasDrm the hasDrm value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -342,7 +331,7 @@ public MicrosoftGraphAudio withHasDrm(Boolean hasDrm) { /** * Get the isVariableBitrate property: Indicates if the file is encoded with a variable bitrate. - * + * * @return the isVariableBitrate value. */ public Boolean isVariableBitrate() { @@ -351,7 +340,7 @@ public Boolean isVariableBitrate() { /** * Set the isVariableBitrate property: Indicates if the file is encoded with a variable bitrate. - * + * * @param isVariableBitrate the isVariableBitrate value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -362,7 +351,7 @@ public MicrosoftGraphAudio withIsVariableBitrate(Boolean isVariableBitrate) { /** * Get the title property: The title of the audio file. - * + * * @return the title value. */ public String title() { @@ -371,7 +360,7 @@ public String title() { /** * Set the title property: The title of the audio file. - * + * * @param title the title value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -382,7 +371,7 @@ public MicrosoftGraphAudio withTitle(String title) { /** * Get the track property: The number of the track on the original disc for this audio file. - * + * * @return the track value. */ public Integer track() { @@ -391,7 +380,7 @@ public Integer track() { /** * Set the track property: The number of the track on the original disc for this audio file. - * + * * @param track the track value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -402,7 +391,7 @@ public MicrosoftGraphAudio withTrack(Integer track) { /** * Get the trackCount property: The total number of tracks on the original disc for this audio file. - * + * * @return the trackCount value. */ public Integer trackCount() { @@ -411,7 +400,7 @@ public Integer trackCount() { /** * Set the trackCount property: The total number of tracks on the original disc for this audio file. - * + * * @param trackCount the trackCount value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -422,7 +411,7 @@ public MicrosoftGraphAudio withTrackCount(Integer trackCount) { /** * Get the year property: The year the audio file was recorded. - * + * * @return the year value. */ public Integer year() { @@ -431,7 +420,7 @@ public Integer year() { /** * Set the year property: The year the audio file was recorded. - * + * * @param year the year value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -442,17 +431,16 @@ public MicrosoftGraphAudio withYear(Integer year) { /** * Get the additionalProperties property: audio. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: audio. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAudio object itself. */ @@ -461,19 +449,103 @@ public MicrosoftGraphAudio withAdditionalProperties(Map addition return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("album", this.album); + jsonWriter.writeStringField("albumArtist", this.albumArtist); + jsonWriter.writeStringField("artist", this.artist); + jsonWriter.writeNumberField("bitrate", this.bitrate); + jsonWriter.writeStringField("composers", this.composers); + jsonWriter.writeStringField("copyright", this.copyright); + jsonWriter.writeNumberField("disc", this.disc); + jsonWriter.writeNumberField("discCount", this.discCount); + jsonWriter.writeNumberField("duration", this.duration); + jsonWriter.writeStringField("genre", this.genre); + jsonWriter.writeBooleanField("hasDrm", this.hasDrm); + jsonWriter.writeBooleanField("isVariableBitrate", this.isVariableBitrate); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeNumberField("track", this.track); + jsonWriter.writeNumberField("trackCount", this.trackCount); + jsonWriter.writeNumberField("year", this.year); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAudio from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAudio 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 MicrosoftGraphAudio. + */ + public static MicrosoftGraphAudio fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAudio deserializedMicrosoftGraphAudio = new MicrosoftGraphAudio(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("album".equals(fieldName)) { + deserializedMicrosoftGraphAudio.album = reader.getString(); + } else if ("albumArtist".equals(fieldName)) { + deserializedMicrosoftGraphAudio.albumArtist = reader.getString(); + } else if ("artist".equals(fieldName)) { + deserializedMicrosoftGraphAudio.artist = reader.getString(); + } else if ("bitrate".equals(fieldName)) { + deserializedMicrosoftGraphAudio.bitrate = reader.getNullable(JsonReader::getLong); + } else if ("composers".equals(fieldName)) { + deserializedMicrosoftGraphAudio.composers = reader.getString(); + } else if ("copyright".equals(fieldName)) { + deserializedMicrosoftGraphAudio.copyright = reader.getString(); + } else if ("disc".equals(fieldName)) { + deserializedMicrosoftGraphAudio.disc = reader.getNullable(JsonReader::getInt); + } else if ("discCount".equals(fieldName)) { + deserializedMicrosoftGraphAudio.discCount = reader.getNullable(JsonReader::getInt); + } else if ("duration".equals(fieldName)) { + deserializedMicrosoftGraphAudio.duration = reader.getNullable(JsonReader::getLong); + } else if ("genre".equals(fieldName)) { + deserializedMicrosoftGraphAudio.genre = reader.getString(); + } else if ("hasDrm".equals(fieldName)) { + deserializedMicrosoftGraphAudio.hasDrm = reader.getNullable(JsonReader::getBoolean); + } else if ("isVariableBitrate".equals(fieldName)) { + deserializedMicrosoftGraphAudio.isVariableBitrate = reader.getNullable(JsonReader::getBoolean); + } else if ("title".equals(fieldName)) { + deserializedMicrosoftGraphAudio.title = reader.getString(); + } else if ("track".equals(fieldName)) { + deserializedMicrosoftGraphAudio.track = reader.getNullable(JsonReader::getInt); + } else if ("trackCount".equals(fieldName)) { + deserializedMicrosoftGraphAudio.trackCount = reader.getNullable(JsonReader::getInt); + } else if ("year".equals(fieldName)) { + deserializedMicrosoftGraphAudio.year = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAudio.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAudio; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAudioConferencing.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAudioConferencing.java index 95876a24a80b9..c95d644a902dc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAudioConferencing.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAudioConferencing.java @@ -5,52 +5,53 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** audioConferencing. */ +/** + * audioConferencing. + */ @Fluent -public final class MicrosoftGraphAudioConferencing { +public final class MicrosoftGraphAudioConferencing implements JsonSerializable { /* * The conferenceId property. */ - @JsonProperty(value = "conferenceId") private String conferenceId; /* * A URL to the externally-accessible web page that contains dial-in information. */ - @JsonProperty(value = "dialinUrl") private String dialinUrl; /* * The toll-free number that connects to the Audio Conference Provider. */ - @JsonProperty(value = "tollFreeNumber") private String tollFreeNumber; /* * The toll number that connects to the Audio Conference Provider. */ - @JsonProperty(value = "tollNumber") private String tollNumber; /* * audioConferencing */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAudioConferencing class. */ + /** + * Creates an instance of MicrosoftGraphAudioConferencing class. + */ public MicrosoftGraphAudioConferencing() { } /** * Get the conferenceId property: The conferenceId property. - * + * * @return the conferenceId value. */ public String conferenceId() { @@ -59,7 +60,7 @@ public String conferenceId() { /** * Set the conferenceId property: The conferenceId property. - * + * * @param conferenceId the conferenceId value to set. * @return the MicrosoftGraphAudioConferencing object itself. */ @@ -70,7 +71,7 @@ public MicrosoftGraphAudioConferencing withConferenceId(String conferenceId) { /** * Get the dialinUrl property: A URL to the externally-accessible web page that contains dial-in information. - * + * * @return the dialinUrl value. */ public String dialinUrl() { @@ -79,7 +80,7 @@ public String dialinUrl() { /** * Set the dialinUrl property: A URL to the externally-accessible web page that contains dial-in information. - * + * * @param dialinUrl the dialinUrl value to set. * @return the MicrosoftGraphAudioConferencing object itself. */ @@ -90,7 +91,7 @@ public MicrosoftGraphAudioConferencing withDialinUrl(String dialinUrl) { /** * Get the tollFreeNumber property: The toll-free number that connects to the Audio Conference Provider. - * + * * @return the tollFreeNumber value. */ public String tollFreeNumber() { @@ -99,7 +100,7 @@ public String tollFreeNumber() { /** * Set the tollFreeNumber property: The toll-free number that connects to the Audio Conference Provider. - * + * * @param tollFreeNumber the tollFreeNumber value to set. * @return the MicrosoftGraphAudioConferencing object itself. */ @@ -110,7 +111,7 @@ public MicrosoftGraphAudioConferencing withTollFreeNumber(String tollFreeNumber) /** * Get the tollNumber property: The toll number that connects to the Audio Conference Provider. - * + * * @return the tollNumber value. */ public String tollNumber() { @@ -119,7 +120,7 @@ public String tollNumber() { /** * Set the tollNumber property: The toll number that connects to the Audio Conference Provider. - * + * * @param tollNumber the tollNumber value to set. * @return the MicrosoftGraphAudioConferencing object itself. */ @@ -130,17 +131,16 @@ public MicrosoftGraphAudioConferencing withTollNumber(String tollNumber) { /** * Get the additionalProperties property: audioConferencing. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: audioConferencing. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAudioConferencing object itself. */ @@ -149,19 +149,68 @@ public MicrosoftGraphAudioConferencing withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("conferenceId", this.conferenceId); + jsonWriter.writeStringField("dialinUrl", this.dialinUrl); + jsonWriter.writeStringField("tollFreeNumber", this.tollFreeNumber); + jsonWriter.writeStringField("tollNumber", this.tollNumber); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAudioConferencing from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAudioConferencing 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 MicrosoftGraphAudioConferencing. + */ + public static MicrosoftGraphAudioConferencing fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAudioConferencing deserializedMicrosoftGraphAudioConferencing + = new MicrosoftGraphAudioConferencing(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("conferenceId".equals(fieldName)) { + deserializedMicrosoftGraphAudioConferencing.conferenceId = reader.getString(); + } else if ("dialinUrl".equals(fieldName)) { + deserializedMicrosoftGraphAudioConferencing.dialinUrl = reader.getString(); + } else if ("tollFreeNumber".equals(fieldName)) { + deserializedMicrosoftGraphAudioConferencing.tollFreeNumber = reader.getString(); + } else if ("tollNumber".equals(fieldName)) { + deserializedMicrosoftGraphAudioConferencing.tollNumber = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAudioConferencing.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAudioConferencing; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAutomaticRepliesSetting.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAutomaticRepliesSetting.java index 5e5cc45fdbb78..7073f26a85569 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAutomaticRepliesSetting.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAutomaticRepliesSetting.java @@ -5,65 +5,65 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** automaticRepliesSetting. */ +/** + * automaticRepliesSetting. + */ @Fluent -public final class MicrosoftGraphAutomaticRepliesSetting { +public final class MicrosoftGraphAutomaticRepliesSetting + implements JsonSerializable { /* * externalAudienceScope */ - @JsonProperty(value = "externalAudience") private MicrosoftGraphExternalAudienceScope externalAudience; /* * The automatic reply to send to the specified external audience, if Status is AlwaysEnabled or Scheduled. */ - @JsonProperty(value = "externalReplyMessage") private String externalReplyMessage; /* * The automatic reply to send to the audience internal to the signed-in user's organization, if Status is * AlwaysEnabled or Scheduled. */ - @JsonProperty(value = "internalReplyMessage") private String internalReplyMessage; /* * dateTimeTimeZone */ - @JsonProperty(value = "scheduledEndDateTime") private MicrosoftGraphDateTimeZone scheduledEndDateTime; /* * dateTimeTimeZone */ - @JsonProperty(value = "scheduledStartDateTime") private MicrosoftGraphDateTimeZone scheduledStartDateTime; /* * automaticRepliesStatus */ - @JsonProperty(value = "status") private MicrosoftGraphAutomaticRepliesStatus status; /* * automaticRepliesSetting */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphAutomaticRepliesSetting class. */ + /** + * Creates an instance of MicrosoftGraphAutomaticRepliesSetting class. + */ public MicrosoftGraphAutomaticRepliesSetting() { } /** * Get the externalAudience property: externalAudienceScope. - * + * * @return the externalAudience value. */ public MicrosoftGraphExternalAudienceScope externalAudience() { @@ -72,12 +72,12 @@ public MicrosoftGraphExternalAudienceScope externalAudience() { /** * Set the externalAudience property: externalAudienceScope. - * + * * @param externalAudience the externalAudience value to set. * @return the MicrosoftGraphAutomaticRepliesSetting object itself. */ - public MicrosoftGraphAutomaticRepliesSetting withExternalAudience( - MicrosoftGraphExternalAudienceScope externalAudience) { + public MicrosoftGraphAutomaticRepliesSetting + withExternalAudience(MicrosoftGraphExternalAudienceScope externalAudience) { this.externalAudience = externalAudience; return this; } @@ -85,7 +85,7 @@ public MicrosoftGraphAutomaticRepliesSetting withExternalAudience( /** * Get the externalReplyMessage property: The automatic reply to send to the specified external audience, if Status * is AlwaysEnabled or Scheduled. - * + * * @return the externalReplyMessage value. */ public String externalReplyMessage() { @@ -95,7 +95,7 @@ public String externalReplyMessage() { /** * Set the externalReplyMessage property: The automatic reply to send to the specified external audience, if Status * is AlwaysEnabled or Scheduled. - * + * * @param externalReplyMessage the externalReplyMessage value to set. * @return the MicrosoftGraphAutomaticRepliesSetting object itself. */ @@ -107,7 +107,7 @@ public MicrosoftGraphAutomaticRepliesSetting withExternalReplyMessage(String ext /** * Get the internalReplyMessage property: The automatic reply to send to the audience internal to the signed-in * user's organization, if Status is AlwaysEnabled or Scheduled. - * + * * @return the internalReplyMessage value. */ public String internalReplyMessage() { @@ -117,7 +117,7 @@ public String internalReplyMessage() { /** * Set the internalReplyMessage property: The automatic reply to send to the audience internal to the signed-in * user's organization, if Status is AlwaysEnabled or Scheduled. - * + * * @param internalReplyMessage the internalReplyMessage value to set. * @return the MicrosoftGraphAutomaticRepliesSetting object itself. */ @@ -128,7 +128,7 @@ public MicrosoftGraphAutomaticRepliesSetting withInternalReplyMessage(String int /** * Get the scheduledEndDateTime property: dateTimeTimeZone. - * + * * @return the scheduledEndDateTime value. */ public MicrosoftGraphDateTimeZone scheduledEndDateTime() { @@ -137,19 +137,19 @@ public MicrosoftGraphDateTimeZone scheduledEndDateTime() { /** * Set the scheduledEndDateTime property: dateTimeTimeZone. - * + * * @param scheduledEndDateTime the scheduledEndDateTime value to set. * @return the MicrosoftGraphAutomaticRepliesSetting object itself. */ - public MicrosoftGraphAutomaticRepliesSetting withScheduledEndDateTime( - MicrosoftGraphDateTimeZone scheduledEndDateTime) { + public MicrosoftGraphAutomaticRepliesSetting + withScheduledEndDateTime(MicrosoftGraphDateTimeZone scheduledEndDateTime) { this.scheduledEndDateTime = scheduledEndDateTime; return this; } /** * Get the scheduledStartDateTime property: dateTimeTimeZone. - * + * * @return the scheduledStartDateTime value. */ public MicrosoftGraphDateTimeZone scheduledStartDateTime() { @@ -158,19 +158,19 @@ public MicrosoftGraphDateTimeZone scheduledStartDateTime() { /** * Set the scheduledStartDateTime property: dateTimeTimeZone. - * + * * @param scheduledStartDateTime the scheduledStartDateTime value to set. * @return the MicrosoftGraphAutomaticRepliesSetting object itself. */ - public MicrosoftGraphAutomaticRepliesSetting withScheduledStartDateTime( - MicrosoftGraphDateTimeZone scheduledStartDateTime) { + public MicrosoftGraphAutomaticRepliesSetting + withScheduledStartDateTime(MicrosoftGraphDateTimeZone scheduledStartDateTime) { this.scheduledStartDateTime = scheduledStartDateTime; return this; } /** * Get the status property: automaticRepliesStatus. - * + * * @return the status value. */ public MicrosoftGraphAutomaticRepliesStatus status() { @@ -179,7 +179,7 @@ public MicrosoftGraphAutomaticRepliesStatus status() { /** * Set the status property: automaticRepliesStatus. - * + * * @param status the status value to set. * @return the MicrosoftGraphAutomaticRepliesSetting object itself. */ @@ -190,17 +190,16 @@ public MicrosoftGraphAutomaticRepliesSetting withStatus(MicrosoftGraphAutomaticR /** * Get the additionalProperties property: automaticRepliesSetting. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: automaticRepliesSetting. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphAutomaticRepliesSetting object itself. */ @@ -209,17 +208,9 @@ public MicrosoftGraphAutomaticRepliesSetting withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -230,4 +221,72 @@ public void validate() { scheduledStartDateTime().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("externalAudience", + this.externalAudience == null ? null : this.externalAudience.toString()); + jsonWriter.writeStringField("externalReplyMessage", this.externalReplyMessage); + jsonWriter.writeStringField("internalReplyMessage", this.internalReplyMessage); + jsonWriter.writeJsonField("scheduledEndDateTime", this.scheduledEndDateTime); + jsonWriter.writeJsonField("scheduledStartDateTime", this.scheduledStartDateTime); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphAutomaticRepliesSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphAutomaticRepliesSetting 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 MicrosoftGraphAutomaticRepliesSetting. + */ + public static MicrosoftGraphAutomaticRepliesSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphAutomaticRepliesSetting deserializedMicrosoftGraphAutomaticRepliesSetting + = new MicrosoftGraphAutomaticRepliesSetting(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("externalAudience".equals(fieldName)) { + deserializedMicrosoftGraphAutomaticRepliesSetting.externalAudience + = MicrosoftGraphExternalAudienceScope.fromString(reader.getString()); + } else if ("externalReplyMessage".equals(fieldName)) { + deserializedMicrosoftGraphAutomaticRepliesSetting.externalReplyMessage = reader.getString(); + } else if ("internalReplyMessage".equals(fieldName)) { + deserializedMicrosoftGraphAutomaticRepliesSetting.internalReplyMessage = reader.getString(); + } else if ("scheduledEndDateTime".equals(fieldName)) { + deserializedMicrosoftGraphAutomaticRepliesSetting.scheduledEndDateTime + = MicrosoftGraphDateTimeZone.fromJson(reader); + } else if ("scheduledStartDateTime".equals(fieldName)) { + deserializedMicrosoftGraphAutomaticRepliesSetting.scheduledStartDateTime + = MicrosoftGraphDateTimeZone.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedMicrosoftGraphAutomaticRepliesSetting.status + = MicrosoftGraphAutomaticRepliesStatus.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphAutomaticRepliesSetting.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphAutomaticRepliesSetting; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAutomaticRepliesStatus.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAutomaticRepliesStatus.java index 9b8a958ae4e59..edf4f434f2fd5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAutomaticRepliesStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphAutomaticRepliesStatus.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** automaticRepliesStatus. */ +/** + * automaticRepliesStatus. + */ public final class MicrosoftGraphAutomaticRepliesStatus extends ExpandableStringEnum { - /** Static value disabled for MicrosoftGraphAutomaticRepliesStatus. */ + /** + * Static value disabled for MicrosoftGraphAutomaticRepliesStatus. + */ public static final MicrosoftGraphAutomaticRepliesStatus DISABLED = fromString("disabled"); - /** Static value alwaysEnabled for MicrosoftGraphAutomaticRepliesStatus. */ + /** + * Static value alwaysEnabled for MicrosoftGraphAutomaticRepliesStatus. + */ public static final MicrosoftGraphAutomaticRepliesStatus ALWAYS_ENABLED = fromString("alwaysEnabled"); - /** Static value scheduled for MicrosoftGraphAutomaticRepliesStatus. */ + /** + * Static value scheduled for MicrosoftGraphAutomaticRepliesStatus. + */ public static final MicrosoftGraphAutomaticRepliesStatus SCHEDULED = fromString("scheduled"); /** * Creates a new instance of MicrosoftGraphAutomaticRepliesStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +38,17 @@ public MicrosoftGraphAutomaticRepliesStatus() { /** * Creates or finds a MicrosoftGraphAutomaticRepliesStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphAutomaticRepliesStatus. */ - @JsonCreator public static MicrosoftGraphAutomaticRepliesStatus fromString(String name) { return fromString(name, MicrosoftGraphAutomaticRepliesStatus.class); } /** * Gets known MicrosoftGraphAutomaticRepliesStatus values. - * + * * @return known MicrosoftGraphAutomaticRepliesStatus values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBaseItemInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBaseItemInner.java index 1e6508ad06429..faa5f3ecc5286 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBaseItemInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBaseItemInner.java @@ -5,99 +5,90 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** baseItem. */ +/** + * baseItem. + */ @Fluent public class MicrosoftGraphBaseItemInner extends MicrosoftGraphEntity { /* * identitySet */ - @JsonProperty(value = "createdBy") private MicrosoftGraphIdentitySet createdBy; /* * Date and time of item creation. Read-only. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * Provides a user-visible description of the item. Optional. */ - @JsonProperty(value = "description") private String description; /* * ETag for the item. Read-only. */ - @JsonProperty(value = "eTag") private String etag; /* * identitySet */ - @JsonProperty(value = "lastModifiedBy") private MicrosoftGraphIdentitySet lastModifiedBy; /* * Date and time the item was last modified. Read-only. */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * The name of the item. Read-write. */ - @JsonProperty(value = "name") private String name; /* * itemReference */ - @JsonProperty(value = "parentReference") private MicrosoftGraphItemReference parentReference; /* * URL that displays the resource in the browser. Read-only. */ - @JsonProperty(value = "webUrl") private String webUrl; /* - * user - * * Represents an Azure Active Directory user object. */ - @JsonProperty(value = "createdByUser") private MicrosoftGraphUserInner createdByUser; /* - * user - * * Represents an Azure Active Directory user object. */ - @JsonProperty(value = "lastModifiedByUser") private MicrosoftGraphUserInner lastModifiedByUser; /* * baseItem */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphBaseItemInner class. */ + /** + * Creates an instance of MicrosoftGraphBaseItemInner class. + */ public MicrosoftGraphBaseItemInner() { } /** * Get the createdBy property: identitySet. - * + * * @return the createdBy value. */ public MicrosoftGraphIdentitySet createdBy() { @@ -106,7 +97,7 @@ public MicrosoftGraphIdentitySet createdBy() { /** * Set the createdBy property: identitySet. - * + * * @param createdBy the createdBy value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -117,7 +108,7 @@ public MicrosoftGraphBaseItemInner withCreatedBy(MicrosoftGraphIdentitySet creat /** * Get the createdDateTime property: Date and time of item creation. Read-only. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -126,7 +117,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: Date and time of item creation. Read-only. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -137,7 +128,7 @@ public MicrosoftGraphBaseItemInner withCreatedDateTime(OffsetDateTime createdDat /** * Get the description property: Provides a user-visible description of the item. Optional. - * + * * @return the description value. */ public String description() { @@ -146,7 +137,7 @@ public String description() { /** * Set the description property: Provides a user-visible description of the item. Optional. - * + * * @param description the description value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -157,7 +148,7 @@ public MicrosoftGraphBaseItemInner withDescription(String description) { /** * Get the etag property: ETag for the item. Read-only. - * + * * @return the etag value. */ public String etag() { @@ -166,7 +157,7 @@ public String etag() { /** * Set the etag property: ETag for the item. Read-only. - * + * * @param etag the etag value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -177,7 +168,7 @@ public MicrosoftGraphBaseItemInner withEtag(String etag) { /** * Get the lastModifiedBy property: identitySet. - * + * * @return the lastModifiedBy value. */ public MicrosoftGraphIdentitySet lastModifiedBy() { @@ -186,7 +177,7 @@ public MicrosoftGraphIdentitySet lastModifiedBy() { /** * Set the lastModifiedBy property: identitySet. - * + * * @param lastModifiedBy the lastModifiedBy value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -197,7 +188,7 @@ public MicrosoftGraphBaseItemInner withLastModifiedBy(MicrosoftGraphIdentitySet /** * Get the lastModifiedDateTime property: Date and time the item was last modified. Read-only. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -206,7 +197,7 @@ public OffsetDateTime lastModifiedDateTime() { /** * Set the lastModifiedDateTime property: Date and time the item was last modified. Read-only. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -217,7 +208,7 @@ public MicrosoftGraphBaseItemInner withLastModifiedDateTime(OffsetDateTime lastM /** * Get the name property: The name of the item. Read-write. - * + * * @return the name value. */ public String name() { @@ -226,7 +217,7 @@ public String name() { /** * Set the name property: The name of the item. Read-write. - * + * * @param name the name value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -237,7 +228,7 @@ public MicrosoftGraphBaseItemInner withName(String name) { /** * Get the parentReference property: itemReference. - * + * * @return the parentReference value. */ public MicrosoftGraphItemReference parentReference() { @@ -246,7 +237,7 @@ public MicrosoftGraphItemReference parentReference() { /** * Set the parentReference property: itemReference. - * + * * @param parentReference the parentReference value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -257,7 +248,7 @@ public MicrosoftGraphBaseItemInner withParentReference(MicrosoftGraphItemReferen /** * Get the webUrl property: URL that displays the resource in the browser. Read-only. - * + * * @return the webUrl value. */ public String webUrl() { @@ -266,7 +257,7 @@ public String webUrl() { /** * Set the webUrl property: URL that displays the resource in the browser. Read-only. - * + * * @param webUrl the webUrl value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -276,10 +267,8 @@ public MicrosoftGraphBaseItemInner withWebUrl(String webUrl) { } /** - * Get the createdByUser property: user - * - *

Represents an Azure Active Directory user object. - * + * Get the createdByUser property: Represents an Azure Active Directory user object. + * * @return the createdByUser value. */ public MicrosoftGraphUserInner createdByUser() { @@ -287,10 +276,8 @@ public MicrosoftGraphUserInner createdByUser() { } /** - * Set the createdByUser property: user - * - *

Represents an Azure Active Directory user object. - * + * Set the createdByUser property: Represents an Azure Active Directory user object. + * * @param createdByUser the createdByUser value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -300,10 +287,8 @@ public MicrosoftGraphBaseItemInner withCreatedByUser(MicrosoftGraphUserInner cre } /** - * Get the lastModifiedByUser property: user - * - *

Represents an Azure Active Directory user object. - * + * Get the lastModifiedByUser property: Represents an Azure Active Directory user object. + * * @return the lastModifiedByUser value. */ public MicrosoftGraphUserInner lastModifiedByUser() { @@ -311,10 +296,8 @@ public MicrosoftGraphUserInner lastModifiedByUser() { } /** - * Set the lastModifiedByUser property: user - * - *

Represents an Azure Active Directory user object. - * + * Set the lastModifiedByUser property: Represents an Azure Active Directory user object. + * * @param lastModifiedByUser the lastModifiedByUser value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -325,17 +308,16 @@ public MicrosoftGraphBaseItemInner withLastModifiedByUser(MicrosoftGraphUserInne /** * Get the additionalProperties property: baseItem. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: baseItem. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphBaseItemInner object itself. */ @@ -344,15 +326,9 @@ public MicrosoftGraphBaseItemInner withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphBaseItemInner withId(String id) { super.withId(id); @@ -361,7 +337,7 @@ public MicrosoftGraphBaseItemInner withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -383,4 +359,92 @@ public void validate() { lastModifiedByUser().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("createdBy", this.createdBy); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("eTag", this.etag); + jsonWriter.writeJsonField("lastModifiedBy", this.lastModifiedBy); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("parentReference", this.parentReference); + jsonWriter.writeStringField("webUrl", this.webUrl); + jsonWriter.writeJsonField("createdByUser", this.createdByUser); + jsonWriter.writeJsonField("lastModifiedByUser", this.lastModifiedByUser); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphBaseItemInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphBaseItemInner 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 MicrosoftGraphBaseItemInner. + */ + public static MicrosoftGraphBaseItemInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphBaseItemInner deserializedMicrosoftGraphBaseItemInner = new MicrosoftGraphBaseItemInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.withId(reader.getString()); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.createdBy = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.description = reader.getString(); + } else if ("eTag".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.etag = reader.getString(); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.lastModifiedBy = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.name = reader.getString(); + } else if ("parentReference".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.parentReference + = MicrosoftGraphItemReference.fromJson(reader); + } else if ("webUrl".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.webUrl = reader.getString(); + } else if ("createdByUser".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.createdByUser = MicrosoftGraphUserInner.fromJson(reader); + } else if ("lastModifiedByUser".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemInner.lastModifiedByUser + = MicrosoftGraphUserInner.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphBaseItemInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphBaseItemInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBaseItemVersion.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBaseItemVersion.java index 4ff47f153aa58..9023653e53ff8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBaseItemVersion.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBaseItemVersion.java @@ -5,47 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** baseItemVersion. */ +/** + * baseItemVersion. + */ @Fluent public class MicrosoftGraphBaseItemVersion extends MicrosoftGraphEntity { /* * identitySet */ - @JsonProperty(value = "lastModifiedBy") private MicrosoftGraphIdentitySet lastModifiedBy; /* * Date and time the version was last modified. Read-only. */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * publicationFacet */ - @JsonProperty(value = "publication") private MicrosoftGraphPublicationFacet publication; /* * baseItemVersion */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphBaseItemVersion class. */ + /** + * Creates an instance of MicrosoftGraphBaseItemVersion class. + */ public MicrosoftGraphBaseItemVersion() { } /** * Get the lastModifiedBy property: identitySet. - * + * * @return the lastModifiedBy value. */ public MicrosoftGraphIdentitySet lastModifiedBy() { @@ -54,7 +57,7 @@ public MicrosoftGraphIdentitySet lastModifiedBy() { /** * Set the lastModifiedBy property: identitySet. - * + * * @param lastModifiedBy the lastModifiedBy value to set. * @return the MicrosoftGraphBaseItemVersion object itself. */ @@ -65,7 +68,7 @@ public MicrosoftGraphBaseItemVersion withLastModifiedBy(MicrosoftGraphIdentitySe /** * Get the lastModifiedDateTime property: Date and time the version was last modified. Read-only. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -74,7 +77,7 @@ public OffsetDateTime lastModifiedDateTime() { /** * Set the lastModifiedDateTime property: Date and time the version was last modified. Read-only. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphBaseItemVersion object itself. */ @@ -85,7 +88,7 @@ public MicrosoftGraphBaseItemVersion withLastModifiedDateTime(OffsetDateTime las /** * Get the publication property: publicationFacet. - * + * * @return the publication value. */ public MicrosoftGraphPublicationFacet publication() { @@ -94,7 +97,7 @@ public MicrosoftGraphPublicationFacet publication() { /** * Set the publication property: publicationFacet. - * + * * @param publication the publication value to set. * @return the MicrosoftGraphBaseItemVersion object itself. */ @@ -105,17 +108,16 @@ public MicrosoftGraphBaseItemVersion withPublication(MicrosoftGraphPublicationFa /** * Get the additionalProperties property: baseItemVersion. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: baseItemVersion. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphBaseItemVersion object itself. */ @@ -124,15 +126,9 @@ public MicrosoftGraphBaseItemVersion withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphBaseItemVersion withId(String id) { super.withId(id); @@ -141,7 +137,7 @@ public MicrosoftGraphBaseItemVersion withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -154,4 +150,67 @@ public void validate() { publication().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("lastModifiedBy", this.lastModifiedBy); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + jsonWriter.writeJsonField("publication", this.publication); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphBaseItemVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphBaseItemVersion 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 MicrosoftGraphBaseItemVersion. + */ + public static MicrosoftGraphBaseItemVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphBaseItemVersion deserializedMicrosoftGraphBaseItemVersion + = new MicrosoftGraphBaseItemVersion(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemVersion.withId(reader.getString()); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemVersion.lastModifiedBy + = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemVersion.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("publication".equals(fieldName)) { + deserializedMicrosoftGraphBaseItemVersion.publication + = MicrosoftGraphPublicationFacet.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphBaseItemVersion.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphBaseItemVersion; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBodyType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBodyType.java index 7285c80fc3db2..854639a606912 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBodyType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphBodyType.java @@ -5,20 +5,25 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** bodyType. */ +/** + * bodyType. + */ public final class MicrosoftGraphBodyType extends ExpandableStringEnum { - /** Static value text for MicrosoftGraphBodyType. */ + /** + * Static value text for MicrosoftGraphBodyType. + */ public static final MicrosoftGraphBodyType TEXT = fromString("text"); - /** Static value html for MicrosoftGraphBodyType. */ + /** + * Static value html for MicrosoftGraphBodyType. + */ public static final MicrosoftGraphBodyType HTML = fromString("html"); /** * Creates a new instance of MicrosoftGraphBodyType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,18 +32,17 @@ public MicrosoftGraphBodyType() { /** * Creates or finds a MicrosoftGraphBodyType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphBodyType. */ - @JsonCreator public static MicrosoftGraphBodyType fromString(String name) { return fromString(name, MicrosoftGraphBodyType.class); } /** * Gets known MicrosoftGraphBodyType values. - * + * * @return known MicrosoftGraphBodyType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalculatedColumn.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalculatedColumn.java index 53e48f15acdb7..73cd31d6d570f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalculatedColumn.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalculatedColumn.java @@ -5,47 +5,49 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** calculatedColumn. */ +/** + * calculatedColumn. + */ @Fluent -public final class MicrosoftGraphCalculatedColumn { +public final class MicrosoftGraphCalculatedColumn implements JsonSerializable { /* * For dateTime output types, the format of the value. Must be one of dateOnly or dateTime. */ - @JsonProperty(value = "format") private String format; /* * The formula used to compute the value for this column. */ - @JsonProperty(value = "formula") private String formula; /* * The output type used to format values in this column. Must be one of boolean, currency, dateTime, number, or * text. */ - @JsonProperty(value = "outputType") private String outputType; /* * calculatedColumn */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphCalculatedColumn class. */ + /** + * Creates an instance of MicrosoftGraphCalculatedColumn class. + */ public MicrosoftGraphCalculatedColumn() { } /** * Get the format property: For dateTime output types, the format of the value. Must be one of dateOnly or dateTime. - * + * * @return the format value. */ public String format() { @@ -54,7 +56,7 @@ public String format() { /** * Set the format property: For dateTime output types, the format of the value. Must be one of dateOnly or dateTime. - * + * * @param format the format value to set. * @return the MicrosoftGraphCalculatedColumn object itself. */ @@ -65,7 +67,7 @@ public MicrosoftGraphCalculatedColumn withFormat(String format) { /** * Get the formula property: The formula used to compute the value for this column. - * + * * @return the formula value. */ public String formula() { @@ -74,7 +76,7 @@ public String formula() { /** * Set the formula property: The formula used to compute the value for this column. - * + * * @param formula the formula value to set. * @return the MicrosoftGraphCalculatedColumn object itself. */ @@ -86,7 +88,7 @@ public MicrosoftGraphCalculatedColumn withFormula(String formula) { /** * Get the outputType property: The output type used to format values in this column. Must be one of boolean, * currency, dateTime, number, or text. - * + * * @return the outputType value. */ public String outputType() { @@ -96,7 +98,7 @@ public String outputType() { /** * Set the outputType property: The output type used to format values in this column. Must be one of boolean, * currency, dateTime, number, or text. - * + * * @param outputType the outputType value to set. * @return the MicrosoftGraphCalculatedColumn object itself. */ @@ -107,17 +109,16 @@ public MicrosoftGraphCalculatedColumn withOutputType(String outputType) { /** * Get the additionalProperties property: calculatedColumn. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: calculatedColumn. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphCalculatedColumn object itself. */ @@ -126,19 +127,65 @@ public MicrosoftGraphCalculatedColumn withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("format", this.format); + jsonWriter.writeStringField("formula", this.formula); + jsonWriter.writeStringField("outputType", this.outputType); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphCalculatedColumn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphCalculatedColumn 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 MicrosoftGraphCalculatedColumn. + */ + public static MicrosoftGraphCalculatedColumn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphCalculatedColumn deserializedMicrosoftGraphCalculatedColumn + = new MicrosoftGraphCalculatedColumn(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("format".equals(fieldName)) { + deserializedMicrosoftGraphCalculatedColumn.format = reader.getString(); + } else if ("formula".equals(fieldName)) { + deserializedMicrosoftGraphCalculatedColumn.formula = reader.getString(); + } else if ("outputType".equals(fieldName)) { + deserializedMicrosoftGraphCalculatedColumn.outputType = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphCalculatedColumn.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphCalculatedColumn; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendar.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendar.java index accc015b49e93..3153cca76fe27 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendar.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendar.java @@ -5,136 +5,122 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** calendar. */ +/** + * calendar. + */ @Fluent public final class MicrosoftGraphCalendar extends MicrosoftGraphEntity { /* * Represent the online meeting service providers that can be used to create online meetings in this calendar. * Possible values are: unknown, skypeForBusiness, skypeForConsumer, teamsForBusiness. */ - @JsonProperty(value = "allowedOnlineMeetingProviders") private List allowedOnlineMeetingProviders; /* * True if the user can write to the calendar, false otherwise. This property is true for the user who created the * calendar. This property is also true for a user who has been shared a calendar and granted write access. */ - @JsonProperty(value = "canEdit") private Boolean canEdit; /* * True if the user has the permission to share the calendar, false otherwise. Only the user who created the * calendar can share it. */ - @JsonProperty(value = "canShare") private Boolean canShare; /* * True if the user can read calendar items that have been marked private, false otherwise. */ - @JsonProperty(value = "canViewPrivateItems") private Boolean canViewPrivateItems; /* * Identifies the version of the calendar object. Every time the calendar is changed, changeKey changes as well. * This allows Exchange to apply changes to the correct version of the object. Read-only. */ - @JsonProperty(value = "changeKey") private String changeKey; /* * calendarColor */ - @JsonProperty(value = "color") private MicrosoftGraphCalendarColor color; /* * onlineMeetingProviderType */ - @JsonProperty(value = "defaultOnlineMeetingProvider") private MicrosoftGraphOnlineMeetingProviderType defaultOnlineMeetingProvider; /* * The hexColor property. */ - @JsonProperty(value = "hexColor") private String hexColor; /* * The isDefaultCalendar property. */ - @JsonProperty(value = "isDefaultCalendar") private Boolean isDefaultCalendar; /* * Indicates whether this user calendar can be deleted from the user mailbox. */ - @JsonProperty(value = "isRemovable") private Boolean isRemovable; /* * Indicates whether this user calendar supports tracking of meeting responses. Only meeting invites sent from * users' primary calendars support tracking of meeting responses. */ - @JsonProperty(value = "isTallyingResponses") private Boolean isTallyingResponses; /* * The calendar name. */ - @JsonProperty(value = "name") private String name; /* * emailAddress */ - @JsonProperty(value = "owner") private MicrosoftGraphEmailAddress owner; /* * The permissions of the users with whom the calendar is shared. */ - @JsonProperty(value = "calendarPermissions") private List calendarPermissions; /* * The calendar view for the calendar. Navigation property. Read-only. */ - @JsonProperty(value = "calendarView") private List calendarView; /* * The events in the calendar. Navigation property. Read-only. */ - @JsonProperty(value = "events") private List events; /* * The collection of multi-value extended properties defined for the calendar. Read-only. Nullable. */ - @JsonProperty(value = "multiValueExtendedProperties") private List multiValueExtendedProperties; /* * The collection of single-value extended properties defined for the calendar. Read-only. Nullable. */ - @JsonProperty(value = "singleValueExtendedProperties") private List singleValueExtendedProperties; /* * calendar */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphCalendar class. */ + /** + * Creates an instance of MicrosoftGraphCalendar class. + */ public MicrosoftGraphCalendar() { } @@ -142,7 +128,7 @@ public MicrosoftGraphCalendar() { * Get the allowedOnlineMeetingProviders property: Represent the online meeting service providers that can be used * to create online meetings in this calendar. Possible values are: unknown, skypeForBusiness, skypeForConsumer, * teamsForBusiness. - * + * * @return the allowedOnlineMeetingProviders value. */ public List allowedOnlineMeetingProviders() { @@ -153,12 +139,12 @@ public List allowedOnlineMeetingProvide * Set the allowedOnlineMeetingProviders property: Represent the online meeting service providers that can be used * to create online meetings in this calendar. Possible values are: unknown, skypeForBusiness, skypeForConsumer, * teamsForBusiness. - * + * * @param allowedOnlineMeetingProviders the allowedOnlineMeetingProviders value to set. * @return the MicrosoftGraphCalendar object itself. */ - public MicrosoftGraphCalendar withAllowedOnlineMeetingProviders( - List allowedOnlineMeetingProviders) { + public MicrosoftGraphCalendar + withAllowedOnlineMeetingProviders(List allowedOnlineMeetingProviders) { this.allowedOnlineMeetingProviders = allowedOnlineMeetingProviders; return this; } @@ -167,7 +153,7 @@ public MicrosoftGraphCalendar withAllowedOnlineMeetingProviders( * Get the canEdit property: True if the user can write to the calendar, false otherwise. This property is true for * the user who created the calendar. This property is also true for a user who has been shared a calendar and * granted write access. - * + * * @return the canEdit value. */ public Boolean canEdit() { @@ -178,7 +164,7 @@ public Boolean canEdit() { * Set the canEdit property: True if the user can write to the calendar, false otherwise. This property is true for * the user who created the calendar. This property is also true for a user who has been shared a calendar and * granted write access. - * + * * @param canEdit the canEdit value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -190,7 +176,7 @@ public MicrosoftGraphCalendar withCanEdit(Boolean canEdit) { /** * Get the canShare property: True if the user has the permission to share the calendar, false otherwise. Only the * user who created the calendar can share it. - * + * * @return the canShare value. */ public Boolean canShare() { @@ -200,7 +186,7 @@ public Boolean canShare() { /** * Set the canShare property: True if the user has the permission to share the calendar, false otherwise. Only the * user who created the calendar can share it. - * + * * @param canShare the canShare value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -212,7 +198,7 @@ public MicrosoftGraphCalendar withCanShare(Boolean canShare) { /** * Get the canViewPrivateItems property: True if the user can read calendar items that have been marked private, * false otherwise. - * + * * @return the canViewPrivateItems value. */ public Boolean canViewPrivateItems() { @@ -222,7 +208,7 @@ public Boolean canViewPrivateItems() { /** * Set the canViewPrivateItems property: True if the user can read calendar items that have been marked private, * false otherwise. - * + * * @param canViewPrivateItems the canViewPrivateItems value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -234,7 +220,7 @@ public MicrosoftGraphCalendar withCanViewPrivateItems(Boolean canViewPrivateItem /** * Get the changeKey property: Identifies the version of the calendar object. Every time the calendar is changed, * changeKey changes as well. This allows Exchange to apply changes to the correct version of the object. Read-only. - * + * * @return the changeKey value. */ public String changeKey() { @@ -244,7 +230,7 @@ public String changeKey() { /** * Set the changeKey property: Identifies the version of the calendar object. Every time the calendar is changed, * changeKey changes as well. This allows Exchange to apply changes to the correct version of the object. Read-only. - * + * * @param changeKey the changeKey value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -255,7 +241,7 @@ public MicrosoftGraphCalendar withChangeKey(String changeKey) { /** * Get the color property: calendarColor. - * + * * @return the color value. */ public MicrosoftGraphCalendarColor color() { @@ -264,7 +250,7 @@ public MicrosoftGraphCalendarColor color() { /** * Set the color property: calendarColor. - * + * * @param color the color value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -275,7 +261,7 @@ public MicrosoftGraphCalendar withColor(MicrosoftGraphCalendarColor color) { /** * Get the defaultOnlineMeetingProvider property: onlineMeetingProviderType. - * + * * @return the defaultOnlineMeetingProvider value. */ public MicrosoftGraphOnlineMeetingProviderType defaultOnlineMeetingProvider() { @@ -284,19 +270,19 @@ public MicrosoftGraphOnlineMeetingProviderType defaultOnlineMeetingProvider() { /** * Set the defaultOnlineMeetingProvider property: onlineMeetingProviderType. - * + * * @param defaultOnlineMeetingProvider the defaultOnlineMeetingProvider value to set. * @return the MicrosoftGraphCalendar object itself. */ - public MicrosoftGraphCalendar withDefaultOnlineMeetingProvider( - MicrosoftGraphOnlineMeetingProviderType defaultOnlineMeetingProvider) { + public MicrosoftGraphCalendar + withDefaultOnlineMeetingProvider(MicrosoftGraphOnlineMeetingProviderType defaultOnlineMeetingProvider) { this.defaultOnlineMeetingProvider = defaultOnlineMeetingProvider; return this; } /** * Get the hexColor property: The hexColor property. - * + * * @return the hexColor value. */ public String hexColor() { @@ -305,7 +291,7 @@ public String hexColor() { /** * Set the hexColor property: The hexColor property. - * + * * @param hexColor the hexColor value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -316,7 +302,7 @@ public MicrosoftGraphCalendar withHexColor(String hexColor) { /** * Get the isDefaultCalendar property: The isDefaultCalendar property. - * + * * @return the isDefaultCalendar value. */ public Boolean isDefaultCalendar() { @@ -325,7 +311,7 @@ public Boolean isDefaultCalendar() { /** * Set the isDefaultCalendar property: The isDefaultCalendar property. - * + * * @param isDefaultCalendar the isDefaultCalendar value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -336,7 +322,7 @@ public MicrosoftGraphCalendar withIsDefaultCalendar(Boolean isDefaultCalendar) { /** * Get the isRemovable property: Indicates whether this user calendar can be deleted from the user mailbox. - * + * * @return the isRemovable value. */ public Boolean isRemovable() { @@ -345,7 +331,7 @@ public Boolean isRemovable() { /** * Set the isRemovable property: Indicates whether this user calendar can be deleted from the user mailbox. - * + * * @param isRemovable the isRemovable value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -357,7 +343,7 @@ public MicrosoftGraphCalendar withIsRemovable(Boolean isRemovable) { /** * Get the isTallyingResponses property: Indicates whether this user calendar supports tracking of meeting * responses. Only meeting invites sent from users' primary calendars support tracking of meeting responses. - * + * * @return the isTallyingResponses value. */ public Boolean isTallyingResponses() { @@ -367,7 +353,7 @@ public Boolean isTallyingResponses() { /** * Set the isTallyingResponses property: Indicates whether this user calendar supports tracking of meeting * responses. Only meeting invites sent from users' primary calendars support tracking of meeting responses. - * + * * @param isTallyingResponses the isTallyingResponses value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -378,7 +364,7 @@ public MicrosoftGraphCalendar withIsTallyingResponses(Boolean isTallyingResponse /** * Get the name property: The calendar name. - * + * * @return the name value. */ public String name() { @@ -387,7 +373,7 @@ public String name() { /** * Set the name property: The calendar name. - * + * * @param name the name value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -398,7 +384,7 @@ public MicrosoftGraphCalendar withName(String name) { /** * Get the owner property: emailAddress. - * + * * @return the owner value. */ public MicrosoftGraphEmailAddress owner() { @@ -407,7 +393,7 @@ public MicrosoftGraphEmailAddress owner() { /** * Set the owner property: emailAddress. - * + * * @param owner the owner value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -418,7 +404,7 @@ public MicrosoftGraphCalendar withOwner(MicrosoftGraphEmailAddress owner) { /** * Get the calendarPermissions property: The permissions of the users with whom the calendar is shared. - * + * * @return the calendarPermissions value. */ public List calendarPermissions() { @@ -427,7 +413,7 @@ public List calendarPermissions() { /** * Set the calendarPermissions property: The permissions of the users with whom the calendar is shared. - * + * * @param calendarPermissions the calendarPermissions value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -438,7 +424,7 @@ public MicrosoftGraphCalendar withCalendarPermissions(List calendarView() { @@ -447,7 +433,7 @@ public List calendarView() { /** * Set the calendarView property: The calendar view for the calendar. Navigation property. Read-only. - * + * * @param calendarView the calendarView value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -458,7 +444,7 @@ public MicrosoftGraphCalendar withCalendarView(List calenda /** * Get the events property: The events in the calendar. Navigation property. Read-only. - * + * * @return the events value. */ public List events() { @@ -467,7 +453,7 @@ public List events() { /** * Set the events property: The events in the calendar. Navigation property. Read-only. - * + * * @param events the events value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -479,7 +465,7 @@ public MicrosoftGraphCalendar withEvents(List events) { /** * Get the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * calendar. Read-only. Nullable. - * + * * @return the multiValueExtendedProperties value. */ public List multiValueExtendedProperties() { @@ -489,7 +475,7 @@ public List multiValueExtendedPr /** * Set the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * calendar. Read-only. Nullable. - * + * * @param multiValueExtendedProperties the multiValueExtendedProperties value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -502,7 +488,7 @@ public MicrosoftGraphCalendar withMultiValueExtendedProperties( /** * Get the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the calendar. Read-only. Nullable. - * + * * @return the singleValueExtendedProperties value. */ public List singleValueExtendedProperties() { @@ -512,7 +498,7 @@ public List singleValueExtended /** * Set the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the calendar. Read-only. Nullable. - * + * * @param singleValueExtendedProperties the singleValueExtendedProperties value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -524,17 +510,16 @@ public MicrosoftGraphCalendar withSingleValueExtendedProperties( /** * Get the additionalProperties property: calendar. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: calendar. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphCalendar object itself. */ @@ -543,15 +528,9 @@ public MicrosoftGraphCalendar withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphCalendar withId(String id) { super.withId(id); @@ -560,7 +539,7 @@ public MicrosoftGraphCalendar withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -585,4 +564,124 @@ public void validate() { singleValueExtendedProperties().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("allowedOnlineMeetingProviders", this.allowedOnlineMeetingProviders, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeBooleanField("canEdit", this.canEdit); + jsonWriter.writeBooleanField("canShare", this.canShare); + jsonWriter.writeBooleanField("canViewPrivateItems", this.canViewPrivateItems); + jsonWriter.writeStringField("changeKey", this.changeKey); + jsonWriter.writeStringField("color", this.color == null ? null : this.color.toString()); + jsonWriter.writeStringField("defaultOnlineMeetingProvider", + this.defaultOnlineMeetingProvider == null ? null : this.defaultOnlineMeetingProvider.toString()); + jsonWriter.writeStringField("hexColor", this.hexColor); + jsonWriter.writeBooleanField("isDefaultCalendar", this.isDefaultCalendar); + jsonWriter.writeBooleanField("isRemovable", this.isRemovable); + jsonWriter.writeBooleanField("isTallyingResponses", this.isTallyingResponses); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("owner", this.owner); + jsonWriter.writeArrayField("calendarPermissions", this.calendarPermissions, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("calendarView", this.calendarView, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("events", this.events, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("multiValueExtendedProperties", this.multiValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("singleValueExtendedProperties", this.singleValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphCalendar from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphCalendar 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 MicrosoftGraphCalendar. + */ + public static MicrosoftGraphCalendar fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphCalendar deserializedMicrosoftGraphCalendar = new MicrosoftGraphCalendar(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.withId(reader.getString()); + } else if ("allowedOnlineMeetingProviders".equals(fieldName)) { + List allowedOnlineMeetingProviders = reader + .readArray(reader1 -> MicrosoftGraphOnlineMeetingProviderType.fromString(reader1.getString())); + deserializedMicrosoftGraphCalendar.allowedOnlineMeetingProviders = allowedOnlineMeetingProviders; + } else if ("canEdit".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.canEdit = reader.getNullable(JsonReader::getBoolean); + } else if ("canShare".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.canShare = reader.getNullable(JsonReader::getBoolean); + } else if ("canViewPrivateItems".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.canViewPrivateItems = reader.getNullable(JsonReader::getBoolean); + } else if ("changeKey".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.changeKey = reader.getString(); + } else if ("color".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.color + = MicrosoftGraphCalendarColor.fromString(reader.getString()); + } else if ("defaultOnlineMeetingProvider".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.defaultOnlineMeetingProvider + = MicrosoftGraphOnlineMeetingProviderType.fromString(reader.getString()); + } else if ("hexColor".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.hexColor = reader.getString(); + } else if ("isDefaultCalendar".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.isDefaultCalendar = reader.getNullable(JsonReader::getBoolean); + } else if ("isRemovable".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.isRemovable = reader.getNullable(JsonReader::getBoolean); + } else if ("isTallyingResponses".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.isTallyingResponses = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.name = reader.getString(); + } else if ("owner".equals(fieldName)) { + deserializedMicrosoftGraphCalendar.owner = MicrosoftGraphEmailAddress.fromJson(reader); + } else if ("calendarPermissions".equals(fieldName)) { + List calendarPermissions + = reader.readArray(reader1 -> MicrosoftGraphCalendarPermission.fromJson(reader1)); + deserializedMicrosoftGraphCalendar.calendarPermissions = calendarPermissions; + } else if ("calendarView".equals(fieldName)) { + List calendarView + = reader.readArray(reader1 -> MicrosoftGraphEvent.fromJson(reader1)); + deserializedMicrosoftGraphCalendar.calendarView = calendarView; + } else if ("events".equals(fieldName)) { + List events + = reader.readArray(reader1 -> MicrosoftGraphEvent.fromJson(reader1)); + deserializedMicrosoftGraphCalendar.events = events; + } else if ("multiValueExtendedProperties".equals(fieldName)) { + List multiValueExtendedProperties + = reader.readArray(reader1 -> MicrosoftGraphMultiValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphCalendar.multiValueExtendedProperties = multiValueExtendedProperties; + } else if ("singleValueExtendedProperties".equals(fieldName)) { + List singleValueExtendedProperties = reader + .readArray(reader1 -> MicrosoftGraphSingleValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphCalendar.singleValueExtendedProperties = singleValueExtendedProperties; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphCalendar.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphCalendar; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarColor.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarColor.java index 2a1eef105b2d0..1809986590268 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarColor.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarColor.java @@ -5,47 +5,70 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** calendarColor. */ +/** + * calendarColor. + */ public final class MicrosoftGraphCalendarColor extends ExpandableStringEnum { - /** Static value auto for MicrosoftGraphCalendarColor. */ + /** + * Static value auto for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor AUTO = fromString("auto"); - /** Static value lightBlue for MicrosoftGraphCalendarColor. */ + /** + * Static value lightBlue for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor LIGHT_BLUE = fromString("lightBlue"); - /** Static value lightGreen for MicrosoftGraphCalendarColor. */ + /** + * Static value lightGreen for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor LIGHT_GREEN = fromString("lightGreen"); - /** Static value lightOrange for MicrosoftGraphCalendarColor. */ + /** + * Static value lightOrange for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor LIGHT_ORANGE = fromString("lightOrange"); - /** Static value lightGray for MicrosoftGraphCalendarColor. */ + /** + * Static value lightGray for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor LIGHT_GRAY = fromString("lightGray"); - /** Static value lightYellow for MicrosoftGraphCalendarColor. */ + /** + * Static value lightYellow for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor LIGHT_YELLOW = fromString("lightYellow"); - /** Static value lightTeal for MicrosoftGraphCalendarColor. */ + /** + * Static value lightTeal for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor LIGHT_TEAL = fromString("lightTeal"); - /** Static value lightPink for MicrosoftGraphCalendarColor. */ + /** + * Static value lightPink for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor LIGHT_PINK = fromString("lightPink"); - /** Static value lightBrown for MicrosoftGraphCalendarColor. */ + /** + * Static value lightBrown for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor LIGHT_BROWN = fromString("lightBrown"); - /** Static value lightRed for MicrosoftGraphCalendarColor. */ + /** + * Static value lightRed for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor LIGHT_RED = fromString("lightRed"); - /** Static value maxColor for MicrosoftGraphCalendarColor. */ + /** + * Static value maxColor for MicrosoftGraphCalendarColor. + */ public static final MicrosoftGraphCalendarColor MAX_COLOR = fromString("maxColor"); /** * Creates a new instance of MicrosoftGraphCalendarColor value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -54,18 +77,17 @@ public MicrosoftGraphCalendarColor() { /** * Creates or finds a MicrosoftGraphCalendarColor from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphCalendarColor. */ - @JsonCreator public static MicrosoftGraphCalendarColor fromString(String name) { return fromString(name, MicrosoftGraphCalendarColor.class); } /** * Gets known MicrosoftGraphCalendarColor values. - * + * * @return known MicrosoftGraphCalendarColor values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarGroup.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarGroup.java index f3253f6c14af4..7394cb65aa87e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarGroup.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarGroup.java @@ -5,49 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** calendarGroup. */ +/** + * calendarGroup. + */ @Fluent public final class MicrosoftGraphCalendarGroup extends MicrosoftGraphEntity { /* * Identifies the version of the calendar group. Every time the calendar group is changed, ChangeKey changes as * well. This allows Exchange to apply changes to the correct version of the object. Read-only. */ - @JsonProperty(value = "changeKey") private String changeKey; /* * The class identifier. Read-only. */ - @JsonProperty(value = "classId") private UUID classId; /* * The group name. */ - @JsonProperty(value = "name") private String name; /* * The calendars in the calendar group. Navigation property. Read-only. Nullable. */ - @JsonProperty(value = "calendars") private List calendars; /* * calendarGroup */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphCalendarGroup class. */ + /** + * Creates an instance of MicrosoftGraphCalendarGroup class. + */ public MicrosoftGraphCalendarGroup() { } @@ -55,7 +56,7 @@ public MicrosoftGraphCalendarGroup() { * Get the changeKey property: Identifies the version of the calendar group. Every time the calendar group is * changed, ChangeKey changes as well. This allows Exchange to apply changes to the correct version of the object. * Read-only. - * + * * @return the changeKey value. */ public String changeKey() { @@ -66,7 +67,7 @@ public String changeKey() { * Set the changeKey property: Identifies the version of the calendar group. Every time the calendar group is * changed, ChangeKey changes as well. This allows Exchange to apply changes to the correct version of the object. * Read-only. - * + * * @param changeKey the changeKey value to set. * @return the MicrosoftGraphCalendarGroup object itself. */ @@ -77,7 +78,7 @@ public MicrosoftGraphCalendarGroup withChangeKey(String changeKey) { /** * Get the classId property: The class identifier. Read-only. - * + * * @return the classId value. */ public UUID classId() { @@ -86,7 +87,7 @@ public UUID classId() { /** * Set the classId property: The class identifier. Read-only. - * + * * @param classId the classId value to set. * @return the MicrosoftGraphCalendarGroup object itself. */ @@ -97,7 +98,7 @@ public MicrosoftGraphCalendarGroup withClassId(UUID classId) { /** * Get the name property: The group name. - * + * * @return the name value. */ public String name() { @@ -106,7 +107,7 @@ public String name() { /** * Set the name property: The group name. - * + * * @param name the name value to set. * @return the MicrosoftGraphCalendarGroup object itself. */ @@ -117,7 +118,7 @@ public MicrosoftGraphCalendarGroup withName(String name) { /** * Get the calendars property: The calendars in the calendar group. Navigation property. Read-only. Nullable. - * + * * @return the calendars value. */ public List calendars() { @@ -126,7 +127,7 @@ public List calendars() { /** * Set the calendars property: The calendars in the calendar group. Navigation property. Read-only. Nullable. - * + * * @param calendars the calendars value to set. * @return the MicrosoftGraphCalendarGroup object itself. */ @@ -137,17 +138,16 @@ public MicrosoftGraphCalendarGroup withCalendars(List ca /** * Get the additionalProperties property: calendarGroup. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: calendarGroup. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphCalendarGroup object itself. */ @@ -156,15 +156,9 @@ public MicrosoftGraphCalendarGroup withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphCalendarGroup withId(String id) { super.withId(id); @@ -173,7 +167,7 @@ public MicrosoftGraphCalendarGroup withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -183,4 +177,66 @@ public void validate() { calendars().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("changeKey", this.changeKey); + jsonWriter.writeStringField("classId", Objects.toString(this.classId, null)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("calendars", this.calendars, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphCalendarGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphCalendarGroup 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 MicrosoftGraphCalendarGroup. + */ + public static MicrosoftGraphCalendarGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphCalendarGroup deserializedMicrosoftGraphCalendarGroup = new MicrosoftGraphCalendarGroup(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphCalendarGroup.withId(reader.getString()); + } else if ("changeKey".equals(fieldName)) { + deserializedMicrosoftGraphCalendarGroup.changeKey = reader.getString(); + } else if ("classId".equals(fieldName)) { + deserializedMicrosoftGraphCalendarGroup.classId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphCalendarGroup.name = reader.getString(); + } else if ("calendars".equals(fieldName)) { + List calendars + = reader.readArray(reader1 -> MicrosoftGraphCalendar.fromJson(reader1)); + deserializedMicrosoftGraphCalendarGroup.calendars = calendars; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphCalendarGroup.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphCalendarGroup; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarPermission.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarPermission.java index c1f3cd6c897b9..5e46ce3a2a687 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarPermission.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarPermission.java @@ -5,15 +5,17 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** calendarPermission. */ +/** + * calendarPermission. + */ @Fluent public final class MicrosoftGraphCalendarPermission extends MicrosoftGraphEntity { /* @@ -21,19 +23,16 @@ public final class MicrosoftGraphCalendarPermission extends MicrosoftGraphEntity * freeBusyRead, limitedRead, read, write, delegateWithoutPrivateEventAccess, delegateWithPrivateEventAccess, * custom. */ - @JsonProperty(value = "allowedRoles") private List allowedRoles; /* * emailAddress */ - @JsonProperty(value = "emailAddress") private MicrosoftGraphEmailAddress emailAddress; /* * True if the user in context (sharee or delegate) is inside the same organization as the calendar owner. */ - @JsonProperty(value = "isInsideOrganization") private Boolean isInsideOrganization; /* @@ -41,21 +40,21 @@ public final class MicrosoftGraphCalendarPermission extends MicrosoftGraphEntity * otherwise. The 'My organization' user determines the permissions other people within your organization have to * the given calendar. You cannot remove 'My organization' as a sharee to a calendar. */ - @JsonProperty(value = "isRemovable") private Boolean isRemovable; /* * calendarRoleType */ - @JsonProperty(value = "role") private MicrosoftGraphCalendarRoleType role; /* * calendarPermission */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphCalendarPermission class. */ + /** + * Creates an instance of MicrosoftGraphCalendarPermission class. + */ public MicrosoftGraphCalendarPermission() { } @@ -63,7 +62,7 @@ public MicrosoftGraphCalendarPermission() { * Get the allowedRoles property: List of allowed sharing or delegating permission levels for the calendar. Possible * values are: none, freeBusyRead, limitedRead, read, write, delegateWithoutPrivateEventAccess, * delegateWithPrivateEventAccess, custom. - * + * * @return the allowedRoles value. */ public List allowedRoles() { @@ -74,7 +73,7 @@ public List allowedRoles() { * Set the allowedRoles property: List of allowed sharing or delegating permission levels for the calendar. Possible * values are: none, freeBusyRead, limitedRead, read, write, delegateWithoutPrivateEventAccess, * delegateWithPrivateEventAccess, custom. - * + * * @param allowedRoles the allowedRoles value to set. * @return the MicrosoftGraphCalendarPermission object itself. */ @@ -85,7 +84,7 @@ public MicrosoftGraphCalendarPermission withAllowedRoles(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: calendarPermission. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphCalendarPermission object itself. */ @@ -190,15 +188,9 @@ public MicrosoftGraphCalendarPermission withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphCalendarPermission withId(String id) { super.withId(id); @@ -207,7 +199,7 @@ public MicrosoftGraphCalendarPermission withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -217,4 +209,74 @@ public void validate() { emailAddress().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("allowedRoles", this.allowedRoles, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("emailAddress", this.emailAddress); + jsonWriter.writeBooleanField("isInsideOrganization", this.isInsideOrganization); + jsonWriter.writeBooleanField("isRemovable", this.isRemovable); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphCalendarPermission from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphCalendarPermission 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 MicrosoftGraphCalendarPermission. + */ + public static MicrosoftGraphCalendarPermission fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphCalendarPermission deserializedMicrosoftGraphCalendarPermission + = new MicrosoftGraphCalendarPermission(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphCalendarPermission.withId(reader.getString()); + } else if ("allowedRoles".equals(fieldName)) { + List allowedRoles + = reader.readArray(reader1 -> MicrosoftGraphCalendarRoleType.fromString(reader1.getString())); + deserializedMicrosoftGraphCalendarPermission.allowedRoles = allowedRoles; + } else if ("emailAddress".equals(fieldName)) { + deserializedMicrosoftGraphCalendarPermission.emailAddress + = MicrosoftGraphEmailAddress.fromJson(reader); + } else if ("isInsideOrganization".equals(fieldName)) { + deserializedMicrosoftGraphCalendarPermission.isInsideOrganization + = reader.getNullable(JsonReader::getBoolean); + } else if ("isRemovable".equals(fieldName)) { + deserializedMicrosoftGraphCalendarPermission.isRemovable + = reader.getNullable(JsonReader::getBoolean); + } else if ("role".equals(fieldName)) { + deserializedMicrosoftGraphCalendarPermission.role + = MicrosoftGraphCalendarRoleType.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphCalendarPermission.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphCalendarPermission; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarRoleType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarRoleType.java index 849743cfff682..207184ea19f5d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarRoleType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCalendarRoleType.java @@ -5,40 +5,57 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** calendarRoleType. */ +/** + * calendarRoleType. + */ public final class MicrosoftGraphCalendarRoleType extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphCalendarRoleType. */ + /** + * Static value none for MicrosoftGraphCalendarRoleType. + */ public static final MicrosoftGraphCalendarRoleType NONE = fromString("none"); - /** Static value freeBusyRead for MicrosoftGraphCalendarRoleType. */ + /** + * Static value freeBusyRead for MicrosoftGraphCalendarRoleType. + */ public static final MicrosoftGraphCalendarRoleType FREE_BUSY_READ = fromString("freeBusyRead"); - /** Static value limitedRead for MicrosoftGraphCalendarRoleType. */ + /** + * Static value limitedRead for MicrosoftGraphCalendarRoleType. + */ public static final MicrosoftGraphCalendarRoleType LIMITED_READ = fromString("limitedRead"); - /** Static value read for MicrosoftGraphCalendarRoleType. */ + /** + * Static value read for MicrosoftGraphCalendarRoleType. + */ public static final MicrosoftGraphCalendarRoleType READ = fromString("read"); - /** Static value write for MicrosoftGraphCalendarRoleType. */ + /** + * Static value write for MicrosoftGraphCalendarRoleType. + */ public static final MicrosoftGraphCalendarRoleType WRITE = fromString("write"); - /** Static value delegateWithoutPrivateEventAccess for MicrosoftGraphCalendarRoleType. */ - public static final MicrosoftGraphCalendarRoleType DELEGATE_WITHOUT_PRIVATE_EVENT_ACCESS = - fromString("delegateWithoutPrivateEventAccess"); + /** + * Static value delegateWithoutPrivateEventAccess for MicrosoftGraphCalendarRoleType. + */ + public static final MicrosoftGraphCalendarRoleType DELEGATE_WITHOUT_PRIVATE_EVENT_ACCESS + = fromString("delegateWithoutPrivateEventAccess"); - /** Static value delegateWithPrivateEventAccess for MicrosoftGraphCalendarRoleType. */ - public static final MicrosoftGraphCalendarRoleType DELEGATE_WITH_PRIVATE_EVENT_ACCESS = - fromString("delegateWithPrivateEventAccess"); + /** + * Static value delegateWithPrivateEventAccess for MicrosoftGraphCalendarRoleType. + */ + public static final MicrosoftGraphCalendarRoleType DELEGATE_WITH_PRIVATE_EVENT_ACCESS + = fromString("delegateWithPrivateEventAccess"); - /** Static value custom for MicrosoftGraphCalendarRoleType. */ + /** + * Static value custom for MicrosoftGraphCalendarRoleType. + */ public static final MicrosoftGraphCalendarRoleType CUSTOM = fromString("custom"); /** * Creates a new instance of MicrosoftGraphCalendarRoleType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -47,18 +64,17 @@ public MicrosoftGraphCalendarRoleType() { /** * Creates or finds a MicrosoftGraphCalendarRoleType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphCalendarRoleType. */ - @JsonCreator public static MicrosoftGraphCalendarRoleType fromString(String name) { return fromString(name, MicrosoftGraphCalendarRoleType.class); } /** * Gets known MicrosoftGraphCalendarRoleType values. - * + * * @return known MicrosoftGraphCalendarRoleType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCategoryColor.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCategoryColor.java index 4dd18b42345eb..ab9d20d630da8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCategoryColor.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCategoryColor.java @@ -5,92 +5,145 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** categoryColor. */ +/** + * categoryColor. + */ public final class MicrosoftGraphCategoryColor extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphCategoryColor. */ + /** + * Static value none for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor NONE = fromString("none"); - /** Static value preset0 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset0 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET0 = fromString("preset0"); - /** Static value preset1 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset1 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET1 = fromString("preset1"); - /** Static value preset2 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset2 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET2 = fromString("preset2"); - /** Static value preset3 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset3 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET3 = fromString("preset3"); - /** Static value preset4 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset4 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET4 = fromString("preset4"); - /** Static value preset5 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset5 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET5 = fromString("preset5"); - /** Static value preset6 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset6 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET6 = fromString("preset6"); - /** Static value preset7 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset7 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET7 = fromString("preset7"); - /** Static value preset8 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset8 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET8 = fromString("preset8"); - /** Static value preset9 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset9 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET9 = fromString("preset9"); - /** Static value preset10 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset10 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET10 = fromString("preset10"); - /** Static value preset11 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset11 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET11 = fromString("preset11"); - /** Static value preset12 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset12 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET12 = fromString("preset12"); - /** Static value preset13 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset13 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET13 = fromString("preset13"); - /** Static value preset14 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset14 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET14 = fromString("preset14"); - /** Static value preset15 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset15 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET15 = fromString("preset15"); - /** Static value preset16 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset16 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET16 = fromString("preset16"); - /** Static value preset17 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset17 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET17 = fromString("preset17"); - /** Static value preset18 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset18 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET18 = fromString("preset18"); - /** Static value preset19 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset19 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET19 = fromString("preset19"); - /** Static value preset20 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset20 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET20 = fromString("preset20"); - /** Static value preset21 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset21 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET21 = fromString("preset21"); - /** Static value preset22 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset22 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET22 = fromString("preset22"); - /** Static value preset23 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset23 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET23 = fromString("preset23"); - /** Static value preset24 for MicrosoftGraphCategoryColor. */ + /** + * Static value preset24 for MicrosoftGraphCategoryColor. + */ public static final MicrosoftGraphCategoryColor PRESET24 = fromString("preset24"); /** * Creates a new instance of MicrosoftGraphCategoryColor value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -99,18 +152,17 @@ public MicrosoftGraphCategoryColor() { /** * Creates or finds a MicrosoftGraphCategoryColor from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphCategoryColor. */ - @JsonCreator public static MicrosoftGraphCategoryColor fromString(String name) { return fromString(name, MicrosoftGraphCategoryColor.class); } /** * Gets known MicrosoftGraphCategoryColor values. - * + * * @return known MicrosoftGraphCategoryColor values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCertificateAuthority.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCertificateAuthority.java index 1f8815a9eb298..3098d60f82380 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCertificateAuthority.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCertificateAuthority.java @@ -7,68 +7,68 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.Base64Url; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; -/** certificateAuthority. */ +/** + * certificateAuthority. + */ @Fluent -public final class MicrosoftGraphCertificateAuthority { +public final class MicrosoftGraphCertificateAuthority implements JsonSerializable { private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; /* * Required. The base64 encoded string representing the public certificate. */ - @JsonProperty(value = "certificate") private Base64Url certificate; /* * The URL of the certificate revocation list. */ - @JsonProperty(value = "certificateRevocationListUrl") private String certificateRevocationListUrl; /* * The URL contains the list of all revoked certificates since the last time a full certificate revocaton list was * created. */ - @JsonProperty(value = "deltaCertificateRevocationListUrl") private String deltaCertificateRevocationListUrl; /* * Required. true if the trusted certificate is a root authority, false if the trusted certificate is an * intermediate authority. */ - @JsonProperty(value = "isRootAuthority") private Boolean isRootAuthority; /* * The issuer of the certificate, calculated from the certificate value. Read-only. */ - @JsonProperty(value = "issuer") private String issuer; /* * The subject key identifier of the certificate, calculated from the certificate value. Read-only. */ - @JsonProperty(value = "issuerSki") private String issuerSki; /* * certificateAuthority */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphCertificateAuthority class. */ + /** + * Creates an instance of MicrosoftGraphCertificateAuthority class. + */ public MicrosoftGraphCertificateAuthority() { } /** * Get the certificate property: Required. The base64 encoded string representing the public certificate. - * + * * @return the certificate value. */ public byte[] certificate() { @@ -80,7 +80,7 @@ public byte[] certificate() { /** * Set the certificate property: Required. The base64 encoded string representing the public certificate. - * + * * @param certificate the certificate value to set. * @return the MicrosoftGraphCertificateAuthority object itself. */ @@ -95,7 +95,7 @@ public MicrosoftGraphCertificateAuthority withCertificate(byte[] certificate) { /** * Get the certificateRevocationListUrl property: The URL of the certificate revocation list. - * + * * @return the certificateRevocationListUrl value. */ public String certificateRevocationListUrl() { @@ -104,7 +104,7 @@ public String certificateRevocationListUrl() { /** * Set the certificateRevocationListUrl property: The URL of the certificate revocation list. - * + * * @param certificateRevocationListUrl the certificateRevocationListUrl value to set. * @return the MicrosoftGraphCertificateAuthority object itself. */ @@ -116,7 +116,7 @@ public MicrosoftGraphCertificateAuthority withCertificateRevocationListUrl(Strin /** * Get the deltaCertificateRevocationListUrl property: The URL contains the list of all revoked certificates since * the last time a full certificate revocaton list was created. - * + * * @return the deltaCertificateRevocationListUrl value. */ public String deltaCertificateRevocationListUrl() { @@ -126,12 +126,12 @@ public String deltaCertificateRevocationListUrl() { /** * Set the deltaCertificateRevocationListUrl property: The URL contains the list of all revoked certificates since * the last time a full certificate revocaton list was created. - * + * * @param deltaCertificateRevocationListUrl the deltaCertificateRevocationListUrl value to set. * @return the MicrosoftGraphCertificateAuthority object itself. */ - public MicrosoftGraphCertificateAuthority withDeltaCertificateRevocationListUrl( - String deltaCertificateRevocationListUrl) { + public MicrosoftGraphCertificateAuthority + withDeltaCertificateRevocationListUrl(String deltaCertificateRevocationListUrl) { this.deltaCertificateRevocationListUrl = deltaCertificateRevocationListUrl; return this; } @@ -139,7 +139,7 @@ public MicrosoftGraphCertificateAuthority withDeltaCertificateRevocationListUrl( /** * Get the isRootAuthority property: Required. true if the trusted certificate is a root authority, false if the * trusted certificate is an intermediate authority. - * + * * @return the isRootAuthority value. */ public Boolean isRootAuthority() { @@ -149,7 +149,7 @@ public Boolean isRootAuthority() { /** * Set the isRootAuthority property: Required. true if the trusted certificate is a root authority, false if the * trusted certificate is an intermediate authority. - * + * * @param isRootAuthority the isRootAuthority value to set. * @return the MicrosoftGraphCertificateAuthority object itself. */ @@ -160,7 +160,7 @@ public MicrosoftGraphCertificateAuthority withIsRootAuthority(Boolean isRootAuth /** * Get the issuer property: The issuer of the certificate, calculated from the certificate value. Read-only. - * + * * @return the issuer value. */ public String issuer() { @@ -169,7 +169,7 @@ public String issuer() { /** * Set the issuer property: The issuer of the certificate, calculated from the certificate value. Read-only. - * + * * @param issuer the issuer value to set. * @return the MicrosoftGraphCertificateAuthority object itself. */ @@ -181,7 +181,7 @@ public MicrosoftGraphCertificateAuthority withIssuer(String issuer) { /** * Get the issuerSki property: The subject key identifier of the certificate, calculated from the certificate value. * Read-only. - * + * * @return the issuerSki value. */ public String issuerSki() { @@ -191,7 +191,7 @@ public String issuerSki() { /** * Set the issuerSki property: The subject key identifier of the certificate, calculated from the certificate value. * Read-only. - * + * * @param issuerSki the issuerSki value to set. * @return the MicrosoftGraphCertificateAuthority object itself. */ @@ -202,17 +202,16 @@ public MicrosoftGraphCertificateAuthority withIssuerSki(String issuerSki) { /** * Get the additionalProperties property: certificateAuthority. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: certificateAuthority. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphCertificateAuthority object itself. */ @@ -221,19 +220,77 @@ public MicrosoftGraphCertificateAuthority withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("certificate", Objects.toString(this.certificate, null)); + jsonWriter.writeStringField("certificateRevocationListUrl", this.certificateRevocationListUrl); + jsonWriter.writeStringField("deltaCertificateRevocationListUrl", this.deltaCertificateRevocationListUrl); + jsonWriter.writeBooleanField("isRootAuthority", this.isRootAuthority); + jsonWriter.writeStringField("issuer", this.issuer); + jsonWriter.writeStringField("issuerSki", this.issuerSki); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphCertificateAuthority from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphCertificateAuthority 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 MicrosoftGraphCertificateAuthority. + */ + public static MicrosoftGraphCertificateAuthority fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphCertificateAuthority deserializedMicrosoftGraphCertificateAuthority + = new MicrosoftGraphCertificateAuthority(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificate".equals(fieldName)) { + deserializedMicrosoftGraphCertificateAuthority.certificate + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("certificateRevocationListUrl".equals(fieldName)) { + deserializedMicrosoftGraphCertificateAuthority.certificateRevocationListUrl = reader.getString(); + } else if ("deltaCertificateRevocationListUrl".equals(fieldName)) { + deserializedMicrosoftGraphCertificateAuthority.deltaCertificateRevocationListUrl + = reader.getString(); + } else if ("isRootAuthority".equals(fieldName)) { + deserializedMicrosoftGraphCertificateAuthority.isRootAuthority + = reader.getNullable(JsonReader::getBoolean); + } else if ("issuer".equals(fieldName)) { + deserializedMicrosoftGraphCertificateAuthority.issuer = reader.getString(); + } else if ("issuerSki".equals(fieldName)) { + deserializedMicrosoftGraphCertificateAuthority.issuerSki = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphCertificateAuthority.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphCertificateAuthority; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCertificateBasedAuthConfiguration.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCertificateBasedAuthConfiguration.java index 87941b54fe4e7..3840df2ba20fe 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCertificateBasedAuthConfiguration.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCertificateBasedAuthConfiguration.java @@ -5,36 +5,39 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** certificateBasedAuthConfiguration. */ +/** + * certificateBasedAuthConfiguration. + */ @Fluent public final class MicrosoftGraphCertificateBasedAuthConfiguration extends MicrosoftGraphEntity { /* * Collection of certificate authorities which creates a trusted certificate chain. */ - @JsonProperty(value = "certificateAuthorities") private List certificateAuthorities; /* * certificateBasedAuthConfiguration */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphCertificateBasedAuthConfiguration class. */ + /** + * Creates an instance of MicrosoftGraphCertificateBasedAuthConfiguration class. + */ public MicrosoftGraphCertificateBasedAuthConfiguration() { } /** * Get the certificateAuthorities property: Collection of certificate authorities which creates a trusted * certificate chain. - * + * * @return the certificateAuthorities value. */ public List certificateAuthorities() { @@ -44,47 +47,40 @@ public List certificateAuthorities() { /** * Set the certificateAuthorities property: Collection of certificate authorities which creates a trusted * certificate chain. - * + * * @param certificateAuthorities the certificateAuthorities value to set. * @return the MicrosoftGraphCertificateBasedAuthConfiguration object itself. */ - public MicrosoftGraphCertificateBasedAuthConfiguration withCertificateAuthorities( - List certificateAuthorities) { + public MicrosoftGraphCertificateBasedAuthConfiguration + withCertificateAuthorities(List certificateAuthorities) { this.certificateAuthorities = certificateAuthorities; return this; } /** * Get the additionalProperties property: certificateBasedAuthConfiguration. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: certificateBasedAuthConfiguration. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphCertificateBasedAuthConfiguration object itself. */ - public MicrosoftGraphCertificateBasedAuthConfiguration withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphCertificateBasedAuthConfiguration + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphCertificateBasedAuthConfiguration withId(String id) { super.withId(id); @@ -93,7 +89,7 @@ public MicrosoftGraphCertificateBasedAuthConfiguration withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -103,4 +99,59 @@ public void validate() { certificateAuthorities().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("certificateAuthorities", this.certificateAuthorities, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphCertificateBasedAuthConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphCertificateBasedAuthConfiguration 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 MicrosoftGraphCertificateBasedAuthConfiguration. + */ + public static MicrosoftGraphCertificateBasedAuthConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphCertificateBasedAuthConfiguration deserializedMicrosoftGraphCertificateBasedAuthConfiguration + = new MicrosoftGraphCertificateBasedAuthConfiguration(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphCertificateBasedAuthConfiguration.withId(reader.getString()); + } else if ("certificateAuthorities".equals(fieldName)) { + List certificateAuthorities + = reader.readArray(reader1 -> MicrosoftGraphCertificateAuthority.fromJson(reader1)); + deserializedMicrosoftGraphCertificateBasedAuthConfiguration.certificateAuthorities + = certificateAuthorities; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphCertificateBasedAuthConfiguration.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphCertificateBasedAuthConfiguration; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChangeTrackedEntity.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChangeTrackedEntity.java index a9567e9ae5026..8e3e02a362285 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChangeTrackedEntity.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChangeTrackedEntity.java @@ -5,50 +5,53 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** changeTrackedEntity. */ +/** + * changeTrackedEntity. + */ @Fluent public class MicrosoftGraphChangeTrackedEntity extends MicrosoftGraphEntity { /* * The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * identitySet */ - @JsonProperty(value = "lastModifiedBy") private MicrosoftGraphIdentitySet lastModifiedBy; /* * The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * changeTrackedEntity */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChangeTrackedEntity class. */ + /** + * Creates an instance of MicrosoftGraphChangeTrackedEntity class. + */ public MicrosoftGraphChangeTrackedEntity() { } /** * Get the createdDateTime property: The Timestamp type represents date and time information using ISO 8601 format * and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -58,7 +61,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: The Timestamp type represents date and time information using ISO 8601 format * and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphChangeTrackedEntity object itself. */ @@ -69,7 +72,7 @@ public MicrosoftGraphChangeTrackedEntity withCreatedDateTime(OffsetDateTime crea /** * Get the lastModifiedBy property: identitySet. - * + * * @return the lastModifiedBy value. */ public MicrosoftGraphIdentitySet lastModifiedBy() { @@ -78,7 +81,7 @@ public MicrosoftGraphIdentitySet lastModifiedBy() { /** * Set the lastModifiedBy property: identitySet. - * + * * @param lastModifiedBy the lastModifiedBy value to set. * @return the MicrosoftGraphChangeTrackedEntity object itself. */ @@ -91,7 +94,7 @@ public MicrosoftGraphChangeTrackedEntity withLastModifiedBy(MicrosoftGraphIdenti * Get the lastModifiedDateTime property: The Timestamp type represents date and time information using ISO 8601 * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -102,7 +105,7 @@ public OffsetDateTime lastModifiedDateTime() { * Set the lastModifiedDateTime property: The Timestamp type represents date and time information using ISO 8601 * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphChangeTrackedEntity object itself. */ @@ -113,17 +116,16 @@ public MicrosoftGraphChangeTrackedEntity withLastModifiedDateTime(OffsetDateTime /** * Get the additionalProperties property: changeTrackedEntity. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: changeTrackedEntity. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChangeTrackedEntity object itself. */ @@ -132,15 +134,9 @@ public MicrosoftGraphChangeTrackedEntity withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphChangeTrackedEntity withId(String id) { super.withId(id); @@ -149,7 +145,7 @@ public MicrosoftGraphChangeTrackedEntity withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -159,4 +155,68 @@ public void validate() { lastModifiedBy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeJsonField("lastModifiedBy", this.lastModifiedBy); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChangeTrackedEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChangeTrackedEntity 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 MicrosoftGraphChangeTrackedEntity. + */ + public static MicrosoftGraphChangeTrackedEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChangeTrackedEntity deserializedMicrosoftGraphChangeTrackedEntity + = new MicrosoftGraphChangeTrackedEntity(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphChangeTrackedEntity.withId(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphChangeTrackedEntity.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphChangeTrackedEntity.lastModifiedBy + = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphChangeTrackedEntity.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChangeTrackedEntity.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChangeTrackedEntity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChannel.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChannel.java index 967f1115b1792..ec736aa610bd1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChannel.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChannel.java @@ -5,46 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** channel. */ +/** + * channel. + */ @Fluent public final class MicrosoftGraphChannel extends MicrosoftGraphEntity { /* * Optional textual description for the channel. */ - @JsonProperty(value = "description") private String description; /* * Channel name as it will appear to the user in Microsoft Teams. */ - @JsonProperty(value = "displayName") private String displayName; /* * The email address for sending messages to the channel. Read-only. */ - @JsonProperty(value = "email") private String email; /* - * Indicates whether the channel should automatically be marked 'favorite' for all members of the team. Can only be - * set programmatically with Create team. Default: false. + * Indicates whether the channel should be marked 'recommended' for all members of the team to show in their channel + * list. Can only be set programmatically with Create team. Default: false. NOTE: All recommended channels will + * automatically show in channels list for EDU and FLW users. */ - @JsonProperty(value = "isFavoriteByDefault") private Boolean isFavoriteByDefault; /* * channelMembershipType */ - @JsonProperty(value = "membershipType") private MicrosoftGraphChannelMembershipType membershipType; /* @@ -52,45 +50,42 @@ public final class MicrosoftGraphChannel extends MicrosoftGraphEntity { * channel in Microsoft Teams and select Get link to channel. This URL should be treated as an opaque blob, and not * parsed. Read-only. */ - @JsonProperty(value = "webUrl") private String webUrl; /* * driveItem */ - @JsonProperty(value = "filesFolder") private MicrosoftGraphDriveItem filesFolder; /* * A collection of membership records associated with the channel. */ - @JsonProperty(value = "members") private List members; /* * A collection of all the messages in the channel. A navigation property. Nullable. */ - @JsonProperty(value = "messages") private List messages; /* * A collection of all the tabs in the channel. A navigation property. */ - @JsonProperty(value = "tabs") private List tabs; /* * channel */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChannel class. */ + /** + * Creates an instance of MicrosoftGraphChannel class. + */ public MicrosoftGraphChannel() { } /** * Get the description property: Optional textual description for the channel. - * + * * @return the description value. */ public String description() { @@ -99,7 +94,7 @@ public String description() { /** * Set the description property: Optional textual description for the channel. - * + * * @param description the description value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -110,7 +105,7 @@ public MicrosoftGraphChannel withDescription(String description) { /** * Get the displayName property: Channel name as it will appear to the user in Microsoft Teams. - * + * * @return the displayName value. */ public String displayName() { @@ -119,7 +114,7 @@ public String displayName() { /** * Set the displayName property: Channel name as it will appear to the user in Microsoft Teams. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -130,7 +125,7 @@ public MicrosoftGraphChannel withDisplayName(String displayName) { /** * Get the email property: The email address for sending messages to the channel. Read-only. - * + * * @return the email value. */ public String email() { @@ -139,7 +134,7 @@ public String email() { /** * Set the email property: The email address for sending messages to the channel. Read-only. - * + * * @param email the email value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -149,10 +144,10 @@ public MicrosoftGraphChannel withEmail(String email) { } /** - * Get the isFavoriteByDefault property: Indicates if the channel is marked 'recommended' for all - * members of the team to show in their channel list. - * NOTE: All recommended channels will automatically show in channels list for EDU and FLW users. - * + * Get the isFavoriteByDefault property: Indicates whether the channel should be marked 'recommended' for all + * members of the team to show in their channel list. Can only be set programmatically with Create team. Default: + * false. NOTE: All recommended channels will automatically show in channels list for EDU and FLW users. + * * @return the isFavoriteByDefault value. */ public Boolean isFavoriteByDefault() { @@ -161,10 +156,9 @@ public Boolean isFavoriteByDefault() { /** * Set the isFavoriteByDefault property: Indicates whether the channel should be marked 'recommended' for all - * members of the team to show in their channel list. Can only be set programmatically with Create team. - * Default: false. - * NOTE: All recommended channels will automatically show in channels list for EDU and FLW users. - * + * members of the team to show in their channel list. Can only be set programmatically with Create team. Default: + * false. NOTE: All recommended channels will automatically show in channels list for EDU and FLW users. + * * @param isFavoriteByDefault the isFavoriteByDefault value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -175,7 +169,7 @@ public MicrosoftGraphChannel withIsFavoriteByDefault(Boolean isFavoriteByDefault /** * Get the membershipType property: channelMembershipType. - * + * * @return the membershipType value. */ public MicrosoftGraphChannelMembershipType membershipType() { @@ -184,7 +178,7 @@ public MicrosoftGraphChannelMembershipType membershipType() { /** * Set the membershipType property: channelMembershipType. - * + * * @param membershipType the membershipType value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -197,7 +191,7 @@ public MicrosoftGraphChannel withMembershipType(MicrosoftGraphChannelMembershipT * Get the webUrl property: A hyperlink that will go to the channel in Microsoft Teams. This is the URL that you get * when you right-click a channel in Microsoft Teams and select Get link to channel. This URL should be treated as * an opaque blob, and not parsed. Read-only. - * + * * @return the webUrl value. */ public String webUrl() { @@ -208,7 +202,7 @@ public String webUrl() { * Set the webUrl property: A hyperlink that will go to the channel in Microsoft Teams. This is the URL that you get * when you right-click a channel in Microsoft Teams and select Get link to channel. This URL should be treated as * an opaque blob, and not parsed. Read-only. - * + * * @param webUrl the webUrl value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -219,7 +213,7 @@ public MicrosoftGraphChannel withWebUrl(String webUrl) { /** * Get the filesFolder property: driveItem. - * + * * @return the filesFolder value. */ public MicrosoftGraphDriveItem filesFolder() { @@ -228,7 +222,7 @@ public MicrosoftGraphDriveItem filesFolder() { /** * Set the filesFolder property: driveItem. - * + * * @param filesFolder the filesFolder value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -239,7 +233,7 @@ public MicrosoftGraphChannel withFilesFolder(MicrosoftGraphDriveItem filesFolder /** * Get the members property: A collection of membership records associated with the channel. - * + * * @return the members value. */ public List members() { @@ -248,7 +242,7 @@ public List members() { /** * Set the members property: A collection of membership records associated with the channel. - * + * * @param members the members value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -259,7 +253,7 @@ public MicrosoftGraphChannel withMembers(List /** * Get the messages property: A collection of all the messages in the channel. A navigation property. Nullable. - * + * * @return the messages value. */ public List messages() { @@ -268,7 +262,7 @@ public List messages() { /** * Set the messages property: A collection of all the messages in the channel. A navigation property. Nullable. - * + * * @param messages the messages value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -279,7 +273,7 @@ public MicrosoftGraphChannel withMessages(List messag /** * Get the tabs property: A collection of all the tabs in the channel. A navigation property. - * + * * @return the tabs value. */ public List tabs() { @@ -288,7 +282,7 @@ public List tabs() { /** * Set the tabs property: A collection of all the tabs in the channel. A navigation property. - * + * * @param tabs the tabs value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -299,17 +293,16 @@ public MicrosoftGraphChannel withTabs(List tabs) { /** * Get the additionalProperties property: channel. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: channel. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChannel object itself. */ @@ -318,15 +311,9 @@ public MicrosoftGraphChannel withAdditionalProperties(Map additi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphChannel withId(String id) { super.withId(id); @@ -335,7 +322,7 @@ public MicrosoftGraphChannel withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -354,4 +341,89 @@ public void validate() { tabs().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeBooleanField("isFavoriteByDefault", this.isFavoriteByDefault); + jsonWriter.writeStringField("membershipType", + this.membershipType == null ? null : this.membershipType.toString()); + jsonWriter.writeStringField("webUrl", this.webUrl); + jsonWriter.writeJsonField("filesFolder", this.filesFolder); + jsonWriter.writeArrayField("members", this.members, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("messages", this.messages, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tabs", this.tabs, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChannel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChannel 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 MicrosoftGraphChannel. + */ + public static MicrosoftGraphChannel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChannel deserializedMicrosoftGraphChannel = new MicrosoftGraphChannel(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphChannel.withId(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphChannel.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphChannel.displayName = reader.getString(); + } else if ("email".equals(fieldName)) { + deserializedMicrosoftGraphChannel.email = reader.getString(); + } else if ("isFavoriteByDefault".equals(fieldName)) { + deserializedMicrosoftGraphChannel.isFavoriteByDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("membershipType".equals(fieldName)) { + deserializedMicrosoftGraphChannel.membershipType + = MicrosoftGraphChannelMembershipType.fromString(reader.getString()); + } else if ("webUrl".equals(fieldName)) { + deserializedMicrosoftGraphChannel.webUrl = reader.getString(); + } else if ("filesFolder".equals(fieldName)) { + deserializedMicrosoftGraphChannel.filesFolder = MicrosoftGraphDriveItem.fromJson(reader); + } else if ("members".equals(fieldName)) { + List members + = reader.readArray(reader1 -> MicrosoftGraphConversationMember.fromJson(reader1)); + deserializedMicrosoftGraphChannel.members = members; + } else if ("messages".equals(fieldName)) { + List messages + = reader.readArray(reader1 -> MicrosoftGraphChatMessage.fromJson(reader1)); + deserializedMicrosoftGraphChannel.messages = messages; + } else if ("tabs".equals(fieldName)) { + List tabs + = reader.readArray(reader1 -> MicrosoftGraphTeamsTab.fromJson(reader1)); + deserializedMicrosoftGraphChannel.tabs = tabs; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChannel.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChannel; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChannelMembershipType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChannelMembershipType.java index 4909c9716bd5f..26ebfb419ca28 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChannelMembershipType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChannelMembershipType.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** channelMembershipType. */ +/** + * channelMembershipType. + */ public final class MicrosoftGraphChannelMembershipType extends ExpandableStringEnum { - /** Static value standard for MicrosoftGraphChannelMembershipType. */ + /** + * Static value standard for MicrosoftGraphChannelMembershipType. + */ public static final MicrosoftGraphChannelMembershipType STANDARD = fromString("standard"); - /** Static value private for MicrosoftGraphChannelMembershipType. */ + /** + * Static value private for MicrosoftGraphChannelMembershipType. + */ public static final MicrosoftGraphChannelMembershipType PRIVATE = fromString("private"); - /** Static value unknownFutureValue for MicrosoftGraphChannelMembershipType. */ + /** + * Static value unknownFutureValue for MicrosoftGraphChannelMembershipType. + */ public static final MicrosoftGraphChannelMembershipType UNKNOWN_FUTURE_VALUE = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphChannelMembershipType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +38,17 @@ public MicrosoftGraphChannelMembershipType() { /** * Creates or finds a MicrosoftGraphChannelMembershipType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphChannelMembershipType. */ - @JsonCreator public static MicrosoftGraphChannelMembershipType fromString(String name) { return fromString(name, MicrosoftGraphChannelMembershipType.class); } /** * Gets known MicrosoftGraphChannelMembershipType values. - * + * * @return known MicrosoftGraphChannelMembershipType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChat.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChat.java index 8280103f5577d..8fb7ae066f9fc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChat.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChat.java @@ -5,37 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** chat. */ +/** + * chat. + */ @Fluent public final class MicrosoftGraphChat extends MicrosoftGraphEntity { /* * chat */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChat class. */ + /** + * Creates an instance of MicrosoftGraphChat class. + */ public MicrosoftGraphChat() { } /** * Get the additionalProperties property: chat. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: chat. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChat object itself. */ @@ -44,15 +48,9 @@ public MicrosoftGraphChat withAdditionalProperties(Map additiona return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphChat withId(String id) { super.withId(id); @@ -61,11 +59,58 @@ public MicrosoftGraphChat withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChat 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 MicrosoftGraphChat. + */ + public static MicrosoftGraphChat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChat deserializedMicrosoftGraphChat = new MicrosoftGraphChat(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphChat.withId(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChat.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChat; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatInfo.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatInfo.java index bdf6cf055bd86..9c4edb24cda41 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatInfo.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatInfo.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** chatInfo. */ +/** + * chatInfo. + */ @Fluent -public final class MicrosoftGraphChatInfo { +public final class MicrosoftGraphChatInfo implements JsonSerializable { /* * The unique identifier of a message in a Microsoft Teams channel. */ - @JsonProperty(value = "messageId") private String messageId; /* * The ID of the reply message. */ - @JsonProperty(value = "replyChainMessageId") private String replyChainMessageId; /* * The unique identifier for a thread in Microsoft Teams. */ - @JsonProperty(value = "threadId") private String threadId; /* * chatInfo */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChatInfo class. */ + /** + * Creates an instance of MicrosoftGraphChatInfo class. + */ public MicrosoftGraphChatInfo() { } /** * Get the messageId property: The unique identifier of a message in a Microsoft Teams channel. - * + * * @return the messageId value. */ public String messageId() { @@ -53,7 +55,7 @@ public String messageId() { /** * Set the messageId property: The unique identifier of a message in a Microsoft Teams channel. - * + * * @param messageId the messageId value to set. * @return the MicrosoftGraphChatInfo object itself. */ @@ -64,7 +66,7 @@ public MicrosoftGraphChatInfo withMessageId(String messageId) { /** * Get the replyChainMessageId property: The ID of the reply message. - * + * * @return the replyChainMessageId value. */ public String replyChainMessageId() { @@ -73,7 +75,7 @@ public String replyChainMessageId() { /** * Set the replyChainMessageId property: The ID of the reply message. - * + * * @param replyChainMessageId the replyChainMessageId value to set. * @return the MicrosoftGraphChatInfo object itself. */ @@ -84,7 +86,7 @@ public MicrosoftGraphChatInfo withReplyChainMessageId(String replyChainMessageId /** * Get the threadId property: The unique identifier for a thread in Microsoft Teams. - * + * * @return the threadId value. */ public String threadId() { @@ -93,7 +95,7 @@ public String threadId() { /** * Set the threadId property: The unique identifier for a thread in Microsoft Teams. - * + * * @param threadId the threadId value to set. * @return the MicrosoftGraphChatInfo object itself. */ @@ -104,17 +106,16 @@ public MicrosoftGraphChatInfo withThreadId(String threadId) { /** * Get the additionalProperties property: chatInfo. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: chatInfo. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChatInfo object itself. */ @@ -123,19 +124,64 @@ public MicrosoftGraphChatInfo withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("messageId", this.messageId); + jsonWriter.writeStringField("replyChainMessageId", this.replyChainMessageId); + jsonWriter.writeStringField("threadId", this.threadId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChatInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChatInfo 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 MicrosoftGraphChatInfo. + */ + public static MicrosoftGraphChatInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChatInfo deserializedMicrosoftGraphChatInfo = new MicrosoftGraphChatInfo(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("messageId".equals(fieldName)) { + deserializedMicrosoftGraphChatInfo.messageId = reader.getString(); + } else if ("replyChainMessageId".equals(fieldName)) { + deserializedMicrosoftGraphChatInfo.replyChainMessageId = reader.getString(); + } else if ("threadId".equals(fieldName)) { + deserializedMicrosoftGraphChatInfo.threadId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChatInfo.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChatInfo; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessage.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessage.java index 8b88f1f0e5b4a..1f83c9bb49eec 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessage.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessage.java @@ -5,155 +5,141 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** chatMessage. */ +/** + * chatMessage. + */ @Fluent public final class MicrosoftGraphChatMessage extends MicrosoftGraphEntity { /* * Attached files. Attachments are currently read-only – sending attachments is not supported. */ - @JsonProperty(value = "attachments") private List attachments; /* * itemBody */ - @JsonProperty(value = "body") private MicrosoftGraphItemBody body; /* * Read only. Timestamp of when the chat message was created. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * Read only. Timestamp at which the chat message was deleted, or null if not deleted. */ - @JsonProperty(value = "deletedDateTime") private OffsetDateTime deletedDateTime; /* * Read-only. Version number of the chat message. */ - @JsonProperty(value = "etag") private String etag; /* * identitySet */ - @JsonProperty(value = "from") private MicrosoftGraphIdentitySet from; /* * chatMessageImportance */ - @JsonProperty(value = "importance") private MicrosoftGraphChatMessageImportance importance; /* * Read only. Timestamp when edits to the chat message were made. Triggers an 'Edited' flag in the Microsoft Teams * UI. If no edits are made the value is null. */ - @JsonProperty(value = "lastEditedDateTime") private OffsetDateTime lastEditedDateTime; /* * Read only. Timestamp when the chat message is created (initial setting) or edited, including when a reaction is * added or removed. */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * Locale of the chat message set by the client. */ - @JsonProperty(value = "locale") private String locale; /* * List of entities mentioned in the chat message. Currently supports user, bot, team, channel. */ - @JsonProperty(value = "mentions") private List mentions; /* * chatMessageType */ - @JsonProperty(value = "messageType") private MicrosoftGraphChatMessageType messageType; /* * chatMessagePolicyViolation */ - @JsonProperty(value = "policyViolation") private MicrosoftGraphChatMessagePolicyViolation policyViolation; /* * The reactions property. */ - @JsonProperty(value = "reactions") private List reactions; /* * Read-only. Id of the parent chat message or root chat message of the thread. (Only applies to chat messages in * channels not chats) */ - @JsonProperty(value = "replyToId") private String replyToId; /* * The subject of the chat message, in plaintext. */ - @JsonProperty(value = "subject") private String subject; /* * Summary text of the chat message that could be used for push notifications and summary views or fall back views. * Only applies to channel chat messages, not chat messages in a chat. */ - @JsonProperty(value = "summary") private String summary; /* * The webUrl property. */ - @JsonProperty(value = "webUrl") private String webUrl; /* * The hostedContents property. */ - @JsonProperty(value = "hostedContents") private List hostedContents; /* * The replies property. */ - @JsonProperty(value = "replies") private List replies; /* * chatMessage */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChatMessage class. */ + /** + * Creates an instance of MicrosoftGraphChatMessage class. + */ public MicrosoftGraphChatMessage() { } /** * Get the attachments property: Attached files. Attachments are currently read-only – sending attachments is not * supported. - * + * * @return the attachments value. */ public List attachments() { @@ -163,7 +149,7 @@ public List attachments() { /** * Set the attachments property: Attached files. Attachments are currently read-only – sending attachments is not * supported. - * + * * @param attachments the attachments value to set. * @return the MicrosoftGraphChatMessage object itself. */ @@ -174,7 +160,7 @@ public MicrosoftGraphChatMessage withAttachments(List mentions() { @@ -371,7 +357,7 @@ public List mentions() { /** * Set the mentions property: List of entities mentioned in the chat message. Currently supports user, bot, team, * channel. - * + * * @param mentions the mentions value to set. * @return the MicrosoftGraphChatMessage object itself. */ @@ -382,7 +368,7 @@ public MicrosoftGraphChatMessage withMentions(List reactions() { @@ -431,7 +417,7 @@ public List reactions() { /** * Set the reactions property: The reactions property. - * + * * @param reactions the reactions value to set. * @return the MicrosoftGraphChatMessage object itself. */ @@ -443,7 +429,7 @@ public MicrosoftGraphChatMessage withReactions(List hostedContents() { @@ -535,7 +521,7 @@ public List hostedContents() { /** * Set the hostedContents property: The hostedContents property. - * + * * @param hostedContents the hostedContents value to set. * @return the MicrosoftGraphChatMessage object itself. */ @@ -546,7 +532,7 @@ public MicrosoftGraphChatMessage withHostedContents(List replies() { @@ -555,7 +541,7 @@ public List replies() { /** * Set the replies property: The replies property. - * + * * @param replies the replies value to set. * @return the MicrosoftGraphChatMessage object itself. */ @@ -566,17 +552,16 @@ public MicrosoftGraphChatMessage withReplies(List rep /** * Get the additionalProperties property: chatMessage. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: chatMessage. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChatMessage object itself. */ @@ -585,15 +570,9 @@ public MicrosoftGraphChatMessage withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphChatMessage withId(String id) { super.withId(id); @@ -602,7 +581,7 @@ public MicrosoftGraphChatMessage withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -633,4 +612,137 @@ public void validate() { replies().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("attachments", this.attachments, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("body", this.body); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("deletedDateTime", + this.deletedDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.deletedDateTime)); + jsonWriter.writeStringField("etag", this.etag); + jsonWriter.writeJsonField("from", this.from); + jsonWriter.writeStringField("importance", this.importance == null ? null : this.importance.toString()); + jsonWriter.writeStringField("lastEditedDateTime", + this.lastEditedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastEditedDateTime)); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + jsonWriter.writeStringField("locale", this.locale); + jsonWriter.writeArrayField("mentions", this.mentions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("messageType", this.messageType == null ? null : this.messageType.toString()); + jsonWriter.writeJsonField("policyViolation", this.policyViolation); + jsonWriter.writeArrayField("reactions", this.reactions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("replyToId", this.replyToId); + jsonWriter.writeStringField("subject", this.subject); + jsonWriter.writeStringField("summary", this.summary); + jsonWriter.writeStringField("webUrl", this.webUrl); + jsonWriter.writeArrayField("hostedContents", this.hostedContents, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("replies", this.replies, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChatMessage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChatMessage 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 MicrosoftGraphChatMessage. + */ + public static MicrosoftGraphChatMessage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChatMessage deserializedMicrosoftGraphChatMessage = new MicrosoftGraphChatMessage(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.withId(reader.getString()); + } else if ("attachments".equals(fieldName)) { + List attachments + = reader.readArray(reader1 -> MicrosoftGraphChatMessageAttachment.fromJson(reader1)); + deserializedMicrosoftGraphChatMessage.attachments = attachments; + } else if ("body".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.body = MicrosoftGraphItemBody.fromJson(reader); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.deletedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("etag".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.etag = reader.getString(); + } else if ("from".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.from = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("importance".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.importance + = MicrosoftGraphChatMessageImportance.fromString(reader.getString()); + } else if ("lastEditedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.lastEditedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("locale".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.locale = reader.getString(); + } else if ("mentions".equals(fieldName)) { + List mentions + = reader.readArray(reader1 -> MicrosoftGraphChatMessageMention.fromJson(reader1)); + deserializedMicrosoftGraphChatMessage.mentions = mentions; + } else if ("messageType".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.messageType + = MicrosoftGraphChatMessageType.fromString(reader.getString()); + } else if ("policyViolation".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.policyViolation + = MicrosoftGraphChatMessagePolicyViolation.fromJson(reader); + } else if ("reactions".equals(fieldName)) { + List reactions + = reader.readArray(reader1 -> MicrosoftGraphChatMessageReaction.fromJson(reader1)); + deserializedMicrosoftGraphChatMessage.reactions = reactions; + } else if ("replyToId".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.replyToId = reader.getString(); + } else if ("subject".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.subject = reader.getString(); + } else if ("summary".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.summary = reader.getString(); + } else if ("webUrl".equals(fieldName)) { + deserializedMicrosoftGraphChatMessage.webUrl = reader.getString(); + } else if ("hostedContents".equals(fieldName)) { + List hostedContents + = reader.readArray(reader1 -> MicrosoftGraphChatMessageHostedContent.fromJson(reader1)); + deserializedMicrosoftGraphChatMessage.hostedContents = hostedContents; + } else if ("replies".equals(fieldName)) { + List replies + = reader.readArray(reader1 -> MicrosoftGraphChatMessage.fromJson(reader1)); + deserializedMicrosoftGraphChatMessage.replies = replies; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChatMessage.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChatMessage; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageAttachment.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageAttachment.java index 190809d14b4bb..270ac3b4ee365 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageAttachment.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageAttachment.java @@ -5,21 +5,24 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** chatMessageAttachment. */ +/** + * chatMessageAttachment. + */ @Fluent -public final class MicrosoftGraphChatMessageAttachment { +public final class MicrosoftGraphChatMessageAttachment + implements JsonSerializable { /* * The content of the attachment. If the attachment is a rich card, set the property to the rich card object. This * property and contentUrl are mutually exclusive. */ - @JsonProperty(value = "content") private String content; /* @@ -42,49 +45,46 @@ public final class MicrosoftGraphChatMessageAttachment { * Set the content property to a ReceiptCard object.application/vnd.microsoft.com.card.signin: A user Sign In card. * Set the content property to a SignInCard object. */ - @JsonProperty(value = "contentType") private String contentType; /* * URL for the content of the attachment. Supported protocols: http, https, file and data. */ - @JsonProperty(value = "contentUrl") private String contentUrl; /* * Read-only. Unique id of the attachment. */ - @JsonProperty(value = "id") private String id; /* * Name of the attachment. */ - @JsonProperty(value = "name") private String name; /* - * URL to a thumbnail image that the channel can use if it supports using an alternative, smaller form of content - * or contentUrl. For example, if you set contentType to application/word and set contentUrl to the location of the + * URL to a thumbnail image that the channel can use if it supports using an alternative, smaller form of content or + * contentUrl. For example, if you set contentType to application/word and set contentUrl to the location of the * Word document, you might include a thumbnail image that represents the document. The channel could display the * thumbnail image instead of the document. When the user clicks the image, the channel would open the document. */ - @JsonProperty(value = "thumbnailUrl") private String thumbnailUrl; /* * chatMessageAttachment */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChatMessageAttachment class. */ + /** + * Creates an instance of MicrosoftGraphChatMessageAttachment class. + */ public MicrosoftGraphChatMessageAttachment() { } /** * Get the content property: The content of the attachment. If the attachment is a rich card, set the property to * the rich card object. This property and contentUrl are mutually exclusive. - * + * * @return the content value. */ public String content() { @@ -94,7 +94,7 @@ public String content() { /** * Set the content property: The content of the attachment. If the attachment is a rich card, set the property to * the rich card object. This property and contentUrl are mutually exclusive. - * + * * @param content the content value to set. * @return the MicrosoftGraphChatMessageAttachment object itself. */ @@ -123,7 +123,7 @@ public MicrosoftGraphChatMessageAttachment withContent(String content) { * ThumbnailCard object.application/vnd.microsoft.com.card.receipt: A Receipt card. Set the content property to a * ReceiptCard object.application/vnd.microsoft.com.card.signin: A user Sign In card. Set the content property to a * SignInCard object. - * + * * @return the contentType value. */ public String contentType() { @@ -150,7 +150,7 @@ public String contentType() { * ThumbnailCard object.application/vnd.microsoft.com.card.receipt: A Receipt card. Set the content property to a * ReceiptCard object.application/vnd.microsoft.com.card.signin: A user Sign In card. Set the content property to a * SignInCard object. - * + * * @param contentType the contentType value to set. * @return the MicrosoftGraphChatMessageAttachment object itself. */ @@ -162,7 +162,7 @@ public MicrosoftGraphChatMessageAttachment withContentType(String contentType) { /** * Get the contentUrl property: URL for the content of the attachment. Supported protocols: http, https, file and * data. - * + * * @return the contentUrl value. */ public String contentUrl() { @@ -172,7 +172,7 @@ public String contentUrl() { /** * Set the contentUrl property: URL for the content of the attachment. Supported protocols: http, https, file and * data. - * + * * @param contentUrl the contentUrl value to set. * @return the MicrosoftGraphChatMessageAttachment object itself. */ @@ -183,7 +183,7 @@ public MicrosoftGraphChatMessageAttachment withContentUrl(String contentUrl) { /** * Get the id property: Read-only. Unique id of the attachment. - * + * * @return the id value. */ public String id() { @@ -192,7 +192,7 @@ public String id() { /** * Set the id property: Read-only. Unique id of the attachment. - * + * * @param id the id value to set. * @return the MicrosoftGraphChatMessageAttachment object itself. */ @@ -203,7 +203,7 @@ public MicrosoftGraphChatMessageAttachment withId(String id) { /** * Get the name property: Name of the attachment. - * + * * @return the name value. */ public String name() { @@ -212,7 +212,7 @@ public String name() { /** * Set the name property: Name of the attachment. - * + * * @param name the name value to set. * @return the MicrosoftGraphChatMessageAttachment object itself. */ @@ -227,7 +227,7 @@ public MicrosoftGraphChatMessageAttachment withName(String name) { * set contentUrl to the location of the Word document, you might include a thumbnail image that represents the * document. The channel could display the thumbnail image instead of the document. When the user clicks the image, * the channel would open the document. - * + * * @return the thumbnailUrl value. */ public String thumbnailUrl() { @@ -240,7 +240,7 @@ public String thumbnailUrl() { * set contentUrl to the location of the Word document, you might include a thumbnail image that represents the * document. The channel could display the thumbnail image instead of the document. When the user clicks the image, * the channel would open the document. - * + * * @param thumbnailUrl the thumbnailUrl value to set. * @return the MicrosoftGraphChatMessageAttachment object itself. */ @@ -251,17 +251,16 @@ public MicrosoftGraphChatMessageAttachment withThumbnailUrl(String thumbnailUrl) /** * Get the additionalProperties property: chatMessageAttachment. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: chatMessageAttachment. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChatMessageAttachment object itself. */ @@ -270,19 +269,74 @@ public MicrosoftGraphChatMessageAttachment withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("contentType", this.contentType); + jsonWriter.writeStringField("contentUrl", this.contentUrl); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("thumbnailUrl", this.thumbnailUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChatMessageAttachment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChatMessageAttachment 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 MicrosoftGraphChatMessageAttachment. + */ + public static MicrosoftGraphChatMessageAttachment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChatMessageAttachment deserializedMicrosoftGraphChatMessageAttachment + = new MicrosoftGraphChatMessageAttachment(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageAttachment.content = reader.getString(); + } else if ("contentType".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageAttachment.contentType = reader.getString(); + } else if ("contentUrl".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageAttachment.contentUrl = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageAttachment.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageAttachment.name = reader.getString(); + } else if ("thumbnailUrl".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageAttachment.thumbnailUrl = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChatMessageAttachment.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChatMessageAttachment; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageHostedContent.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageHostedContent.java index ec964bb7ad2fd..25d26d0d94ff1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageHostedContent.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageHostedContent.java @@ -5,37 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** chatMessageHostedContent. */ +/** + * chatMessageHostedContent. + */ @Fluent public final class MicrosoftGraphChatMessageHostedContent extends MicrosoftGraphEntity { /* * chatMessageHostedContent */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChatMessageHostedContent class. */ + /** + * Creates an instance of MicrosoftGraphChatMessageHostedContent class. + */ public MicrosoftGraphChatMessageHostedContent() { } /** * Get the additionalProperties property: chatMessageHostedContent. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: chatMessageHostedContent. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChatMessageHostedContent object itself. */ @@ -44,15 +48,9 @@ public MicrosoftGraphChatMessageHostedContent withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphChatMessageHostedContent withId(String id) { super.withId(id); @@ -61,11 +59,59 @@ public MicrosoftGraphChatMessageHostedContent withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChatMessageHostedContent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChatMessageHostedContent 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 MicrosoftGraphChatMessageHostedContent. + */ + public static MicrosoftGraphChatMessageHostedContent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChatMessageHostedContent deserializedMicrosoftGraphChatMessageHostedContent + = new MicrosoftGraphChatMessageHostedContent(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageHostedContent.withId(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChatMessageHostedContent.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChatMessageHostedContent; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageImportance.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageImportance.java index d466d29aa7c72..55c8b6c2fe4b5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageImportance.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageImportance.java @@ -5,27 +5,36 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** chatMessageImportance. */ +/** + * chatMessageImportance. + */ public final class MicrosoftGraphChatMessageImportance extends ExpandableStringEnum { - /** Static value normal for MicrosoftGraphChatMessageImportance. */ + /** + * Static value normal for MicrosoftGraphChatMessageImportance. + */ public static final MicrosoftGraphChatMessageImportance NORMAL = fromString("normal"); - /** Static value high for MicrosoftGraphChatMessageImportance. */ + /** + * Static value high for MicrosoftGraphChatMessageImportance. + */ public static final MicrosoftGraphChatMessageImportance HIGH = fromString("high"); - /** Static value urgent for MicrosoftGraphChatMessageImportance. */ + /** + * Static value urgent for MicrosoftGraphChatMessageImportance. + */ public static final MicrosoftGraphChatMessageImportance URGENT = fromString("urgent"); - /** Static value unknownFutureValue for MicrosoftGraphChatMessageImportance. */ + /** + * Static value unknownFutureValue for MicrosoftGraphChatMessageImportance. + */ public static final MicrosoftGraphChatMessageImportance UNKNOWN_FUTURE_VALUE = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphChatMessageImportance value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +43,17 @@ public MicrosoftGraphChatMessageImportance() { /** * Creates or finds a MicrosoftGraphChatMessageImportance from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphChatMessageImportance. */ - @JsonCreator public static MicrosoftGraphChatMessageImportance fromString(String name) { return fromString(name, MicrosoftGraphChatMessageImportance.class); } /** * Gets known MicrosoftGraphChatMessageImportance values. - * + * * @return known MicrosoftGraphChatMessageImportance values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageMention.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageMention.java index 4a37102066cd6..442c409ceb432 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageMention.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageMention.java @@ -5,48 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** chatMessageMention. */ +/** + * chatMessageMention. + */ @Fluent -public final class MicrosoftGraphChatMessageMention { +public final class MicrosoftGraphChatMessageMention implements JsonSerializable { /* * Index of an entity being mentioned in the specified chatMessage. Matches the {index} value in the corresponding * tag in the message body. */ - @JsonProperty(value = "id") private Integer id; /* * identitySet */ - @JsonProperty(value = "mentioned") private MicrosoftGraphIdentitySet mentioned; /* * String used to represent the mention. For example, a user's display name, a team name. */ - @JsonProperty(value = "mentionText") private String mentionText; /* * chatMessageMention */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChatMessageMention class. */ + /** + * Creates an instance of MicrosoftGraphChatMessageMention class. + */ public MicrosoftGraphChatMessageMention() { } /** * Get the id property: Index of an entity being mentioned in the specified chatMessage. Matches the {index} value * in the corresponding <at id='{index}'> tag in the message body. - * + * * @return the id value. */ public Integer id() { @@ -56,7 +58,7 @@ public Integer id() { /** * Set the id property: Index of an entity being mentioned in the specified chatMessage. Matches the {index} value * in the corresponding <at id='{index}'> tag in the message body. - * + * * @param id the id value to set. * @return the MicrosoftGraphChatMessageMention object itself. */ @@ -67,7 +69,7 @@ public MicrosoftGraphChatMessageMention withId(Integer id) { /** * Get the mentioned property: identitySet. - * + * * @return the mentioned value. */ public MicrosoftGraphIdentitySet mentioned() { @@ -76,7 +78,7 @@ public MicrosoftGraphIdentitySet mentioned() { /** * Set the mentioned property: identitySet. - * + * * @param mentioned the mentioned value to set. * @return the MicrosoftGraphChatMessageMention object itself. */ @@ -88,7 +90,7 @@ public MicrosoftGraphChatMessageMention withMentioned(MicrosoftGraphIdentitySet /** * Get the mentionText property: String used to represent the mention. For example, a user's display name, a team * name. - * + * * @return the mentionText value. */ public String mentionText() { @@ -98,7 +100,7 @@ public String mentionText() { /** * Set the mentionText property: String used to represent the mention. For example, a user's display name, a team * name. - * + * * @param mentionText the mentionText value to set. * @return the MicrosoftGraphChatMessageMention object itself. */ @@ -109,17 +111,16 @@ public MicrosoftGraphChatMessageMention withMentionText(String mentionText) { /** * Get the additionalProperties property: chatMessageMention. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: chatMessageMention. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChatMessageMention object itself. */ @@ -128,17 +129,9 @@ public MicrosoftGraphChatMessageMention withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -146,4 +139,58 @@ public void validate() { mentioned().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("id", this.id); + jsonWriter.writeJsonField("mentioned", this.mentioned); + jsonWriter.writeStringField("mentionText", this.mentionText); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChatMessageMention from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChatMessageMention 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 MicrosoftGraphChatMessageMention. + */ + public static MicrosoftGraphChatMessageMention fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChatMessageMention deserializedMicrosoftGraphChatMessageMention + = new MicrosoftGraphChatMessageMention(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageMention.id = reader.getNullable(JsonReader::getInt); + } else if ("mentioned".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageMention.mentioned = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("mentionText".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageMention.mentionText = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChatMessageMention.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChatMessageMention; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolation.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolation.java index 214e214034265..7b073c3a60cb6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolation.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolation.java @@ -5,58 +5,59 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** chatMessagePolicyViolation. */ +/** + * chatMessagePolicyViolation. + */ @Fluent -public final class MicrosoftGraphChatMessagePolicyViolation { +public final class MicrosoftGraphChatMessagePolicyViolation + implements JsonSerializable { /* * chatMessagePolicyViolationDlpActionTypes */ - @JsonProperty(value = "dlpAction") private MicrosoftGraphChatMessagePolicyViolationDlpActionTypes dlpAction; /* * Justification text provided by the sender of the message when overriding a policy violation. */ - @JsonProperty(value = "justificationText") private String justificationText; /* * chatMessagePolicyViolationPolicyTip */ - @JsonProperty(value = "policyTip") private MicrosoftGraphChatMessagePolicyViolationPolicyTip policyTip; /* * chatMessagePolicyViolationUserActionTypes */ - @JsonProperty(value = "userAction") private MicrosoftGraphChatMessagePolicyViolationUserActionTypes userAction; /* * chatMessagePolicyViolationVerdictDetailsTypes */ - @JsonProperty(value = "verdictDetails") private MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes verdictDetails; /* * chatMessagePolicyViolation */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChatMessagePolicyViolation class. */ + /** + * Creates an instance of MicrosoftGraphChatMessagePolicyViolation class. + */ public MicrosoftGraphChatMessagePolicyViolation() { } /** * Get the dlpAction property: chatMessagePolicyViolationDlpActionTypes. - * + * * @return the dlpAction value. */ public MicrosoftGraphChatMessagePolicyViolationDlpActionTypes dlpAction() { @@ -65,12 +66,12 @@ public MicrosoftGraphChatMessagePolicyViolationDlpActionTypes dlpAction() { /** * Set the dlpAction property: chatMessagePolicyViolationDlpActionTypes. - * + * * @param dlpAction the dlpAction value to set. * @return the MicrosoftGraphChatMessagePolicyViolation object itself. */ - public MicrosoftGraphChatMessagePolicyViolation withDlpAction( - MicrosoftGraphChatMessagePolicyViolationDlpActionTypes dlpAction) { + public MicrosoftGraphChatMessagePolicyViolation + withDlpAction(MicrosoftGraphChatMessagePolicyViolationDlpActionTypes dlpAction) { this.dlpAction = dlpAction; return this; } @@ -78,7 +79,7 @@ public MicrosoftGraphChatMessagePolicyViolation withDlpAction( /** * Get the justificationText property: Justification text provided by the sender of the message when overriding a * policy violation. - * + * * @return the justificationText value. */ public String justificationText() { @@ -88,7 +89,7 @@ public String justificationText() { /** * Set the justificationText property: Justification text provided by the sender of the message when overriding a * policy violation. - * + * * @param justificationText the justificationText value to set. * @return the MicrosoftGraphChatMessagePolicyViolation object itself. */ @@ -99,7 +100,7 @@ public MicrosoftGraphChatMessagePolicyViolation withJustificationText(String jus /** * Get the policyTip property: chatMessagePolicyViolationPolicyTip. - * + * * @return the policyTip value. */ public MicrosoftGraphChatMessagePolicyViolationPolicyTip policyTip() { @@ -108,19 +109,19 @@ public MicrosoftGraphChatMessagePolicyViolationPolicyTip policyTip() { /** * Set the policyTip property: chatMessagePolicyViolationPolicyTip. - * + * * @param policyTip the policyTip value to set. * @return the MicrosoftGraphChatMessagePolicyViolation object itself. */ - public MicrosoftGraphChatMessagePolicyViolation withPolicyTip( - MicrosoftGraphChatMessagePolicyViolationPolicyTip policyTip) { + public MicrosoftGraphChatMessagePolicyViolation + withPolicyTip(MicrosoftGraphChatMessagePolicyViolationPolicyTip policyTip) { this.policyTip = policyTip; return this; } /** * Get the userAction property: chatMessagePolicyViolationUserActionTypes. - * + * * @return the userAction value. */ public MicrosoftGraphChatMessagePolicyViolationUserActionTypes userAction() { @@ -129,19 +130,19 @@ public MicrosoftGraphChatMessagePolicyViolationUserActionTypes userAction() { /** * Set the userAction property: chatMessagePolicyViolationUserActionTypes. - * + * * @param userAction the userAction value to set. * @return the MicrosoftGraphChatMessagePolicyViolation object itself. */ - public MicrosoftGraphChatMessagePolicyViolation withUserAction( - MicrosoftGraphChatMessagePolicyViolationUserActionTypes userAction) { + public MicrosoftGraphChatMessagePolicyViolation + withUserAction(MicrosoftGraphChatMessagePolicyViolationUserActionTypes userAction) { this.userAction = userAction; return this; } /** * Get the verdictDetails property: chatMessagePolicyViolationVerdictDetailsTypes. - * + * * @return the verdictDetails value. */ public MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes verdictDetails() { @@ -150,29 +151,28 @@ public MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes verdictDetail /** * Set the verdictDetails property: chatMessagePolicyViolationVerdictDetailsTypes. - * + * * @param verdictDetails the verdictDetails value to set. * @return the MicrosoftGraphChatMessagePolicyViolation object itself. */ - public MicrosoftGraphChatMessagePolicyViolation withVerdictDetails( - MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes verdictDetails) { + public MicrosoftGraphChatMessagePolicyViolation + withVerdictDetails(MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes verdictDetails) { this.verdictDetails = verdictDetails; return this; } /** * Get the additionalProperties property: chatMessagePolicyViolation. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: chatMessagePolicyViolation. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChatMessagePolicyViolation object itself. */ @@ -181,17 +181,9 @@ public MicrosoftGraphChatMessagePolicyViolation withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -199,4 +191,69 @@ public void validate() { policyTip().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dlpAction", this.dlpAction == null ? null : this.dlpAction.toString()); + jsonWriter.writeStringField("justificationText", this.justificationText); + jsonWriter.writeJsonField("policyTip", this.policyTip); + jsonWriter.writeStringField("userAction", this.userAction == null ? null : this.userAction.toString()); + jsonWriter.writeStringField("verdictDetails", + this.verdictDetails == null ? null : this.verdictDetails.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChatMessagePolicyViolation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChatMessagePolicyViolation 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 MicrosoftGraphChatMessagePolicyViolation. + */ + public static MicrosoftGraphChatMessagePolicyViolation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChatMessagePolicyViolation deserializedMicrosoftGraphChatMessagePolicyViolation + = new MicrosoftGraphChatMessagePolicyViolation(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dlpAction".equals(fieldName)) { + deserializedMicrosoftGraphChatMessagePolicyViolation.dlpAction + = MicrosoftGraphChatMessagePolicyViolationDlpActionTypes.fromString(reader.getString()); + } else if ("justificationText".equals(fieldName)) { + deserializedMicrosoftGraphChatMessagePolicyViolation.justificationText = reader.getString(); + } else if ("policyTip".equals(fieldName)) { + deserializedMicrosoftGraphChatMessagePolicyViolation.policyTip + = MicrosoftGraphChatMessagePolicyViolationPolicyTip.fromJson(reader); + } else if ("userAction".equals(fieldName)) { + deserializedMicrosoftGraphChatMessagePolicyViolation.userAction + = MicrosoftGraphChatMessagePolicyViolationUserActionTypes.fromString(reader.getString()); + } else if ("verdictDetails".equals(fieldName)) { + deserializedMicrosoftGraphChatMessagePolicyViolation.verdictDetails + = MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChatMessagePolicyViolation.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChatMessagePolicyViolation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationDlpActionTypes.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationDlpActionTypes.java index 6ff44683076d8..b376d3aea2c2e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationDlpActionTypes.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationDlpActionTypes.java @@ -5,29 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** chatMessagePolicyViolationDlpActionTypes. */ +/** + * chatMessagePolicyViolationDlpActionTypes. + */ public final class MicrosoftGraphChatMessagePolicyViolationDlpActionTypes extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphChatMessagePolicyViolationDlpActionTypes. */ + /** + * Static value none for MicrosoftGraphChatMessagePolicyViolationDlpActionTypes. + */ public static final MicrosoftGraphChatMessagePolicyViolationDlpActionTypes NONE = fromString("none"); - /** Static value notifySender for MicrosoftGraphChatMessagePolicyViolationDlpActionTypes. */ - public static final MicrosoftGraphChatMessagePolicyViolationDlpActionTypes NOTIFY_SENDER = - fromString("notifySender"); + /** + * Static value notifySender for MicrosoftGraphChatMessagePolicyViolationDlpActionTypes. + */ + public static final MicrosoftGraphChatMessagePolicyViolationDlpActionTypes NOTIFY_SENDER + = fromString("notifySender"); - /** Static value blockAccess for MicrosoftGraphChatMessagePolicyViolationDlpActionTypes. */ + /** + * Static value blockAccess for MicrosoftGraphChatMessagePolicyViolationDlpActionTypes. + */ public static final MicrosoftGraphChatMessagePolicyViolationDlpActionTypes BLOCK_ACCESS = fromString("blockAccess"); - /** Static value blockAccessExternal for MicrosoftGraphChatMessagePolicyViolationDlpActionTypes. */ - public static final MicrosoftGraphChatMessagePolicyViolationDlpActionTypes BLOCK_ACCESS_EXTERNAL = - fromString("blockAccessExternal"); + /** + * Static value blockAccessExternal for MicrosoftGraphChatMessagePolicyViolationDlpActionTypes. + */ + public static final MicrosoftGraphChatMessagePolicyViolationDlpActionTypes BLOCK_ACCESS_EXTERNAL + = fromString("blockAccessExternal"); /** * Creates a new instance of MicrosoftGraphChatMessagePolicyViolationDlpActionTypes value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +45,17 @@ public MicrosoftGraphChatMessagePolicyViolationDlpActionTypes() { /** * Creates or finds a MicrosoftGraphChatMessagePolicyViolationDlpActionTypes from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphChatMessagePolicyViolationDlpActionTypes. */ - @JsonCreator public static MicrosoftGraphChatMessagePolicyViolationDlpActionTypes fromString(String name) { return fromString(name, MicrosoftGraphChatMessagePolicyViolationDlpActionTypes.class); } /** * Gets known MicrosoftGraphChatMessagePolicyViolationDlpActionTypes values. - * + * * @return known MicrosoftGraphChatMessagePolicyViolationDlpActionTypes values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationPolicyTip.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationPolicyTip.java index a087e4a5e43d7..6bd3e9f142d8a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationPolicyTip.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationPolicyTip.java @@ -5,50 +5,53 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** chatMessagePolicyViolationPolicyTip. */ +/** + * chatMessagePolicyViolationPolicyTip. + */ @Fluent -public final class MicrosoftGraphChatMessagePolicyViolationPolicyTip { +public final class MicrosoftGraphChatMessagePolicyViolationPolicyTip + implements JsonSerializable { /* * The URL a user can visit to read about the data loss prevention policies for the organization. (ie, policies * about what users shouldn't say in chats) */ - @JsonProperty(value = "complianceUrl") private String complianceUrl; /* * Explanatory text shown to the sender of the message. */ - @JsonProperty(value = "generalText") private String generalText; /* * The list of improper data in the message that was detected by the data loss prevention app. Each DLP app defines * its own conditions, examples include 'Credit Card Number' and 'Social Security Number'. */ - @JsonProperty(value = "matchedConditionDescriptions") private List matchedConditionDescriptions; /* * chatMessagePolicyViolationPolicyTip */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChatMessagePolicyViolationPolicyTip class. */ + /** + * Creates an instance of MicrosoftGraphChatMessagePolicyViolationPolicyTip class. + */ public MicrosoftGraphChatMessagePolicyViolationPolicyTip() { } /** * Get the complianceUrl property: The URL a user can visit to read about the data loss prevention policies for the * organization. (ie, policies about what users shouldn't say in chats). - * + * * @return the complianceUrl value. */ public String complianceUrl() { @@ -58,7 +61,7 @@ public String complianceUrl() { /** * Set the complianceUrl property: The URL a user can visit to read about the data loss prevention policies for the * organization. (ie, policies about what users shouldn't say in chats). - * + * * @param complianceUrl the complianceUrl value to set. * @return the MicrosoftGraphChatMessagePolicyViolationPolicyTip object itself. */ @@ -69,7 +72,7 @@ public MicrosoftGraphChatMessagePolicyViolationPolicyTip withComplianceUrl(Strin /** * Get the generalText property: Explanatory text shown to the sender of the message. - * + * * @return the generalText value. */ public String generalText() { @@ -78,7 +81,7 @@ public String generalText() { /** * Set the generalText property: Explanatory text shown to the sender of the message. - * + * * @param generalText the generalText value to set. * @return the MicrosoftGraphChatMessagePolicyViolationPolicyTip object itself. */ @@ -91,7 +94,7 @@ public MicrosoftGraphChatMessagePolicyViolationPolicyTip withGeneralText(String * Get the matchedConditionDescriptions property: The list of improper data in the message that was detected by the * data loss prevention app. Each DLP app defines its own conditions, examples include 'Credit Card Number' and * 'Social Security Number'. - * + * * @return the matchedConditionDescriptions value. */ public List matchedConditionDescriptions() { @@ -102,51 +105,99 @@ public List matchedConditionDescriptions() { * Set the matchedConditionDescriptions property: The list of improper data in the message that was detected by the * data loss prevention app. Each DLP app defines its own conditions, examples include 'Credit Card Number' and * 'Social Security Number'. - * + * * @param matchedConditionDescriptions the matchedConditionDescriptions value to set. * @return the MicrosoftGraphChatMessagePolicyViolationPolicyTip object itself. */ - public MicrosoftGraphChatMessagePolicyViolationPolicyTip withMatchedConditionDescriptions( - List matchedConditionDescriptions) { + public MicrosoftGraphChatMessagePolicyViolationPolicyTip + withMatchedConditionDescriptions(List matchedConditionDescriptions) { this.matchedConditionDescriptions = matchedConditionDescriptions; return this; } /** * Get the additionalProperties property: chatMessagePolicyViolationPolicyTip. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: chatMessagePolicyViolationPolicyTip. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChatMessagePolicyViolationPolicyTip object itself. */ - public MicrosoftGraphChatMessagePolicyViolationPolicyTip withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphChatMessagePolicyViolationPolicyTip + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("complianceUrl", this.complianceUrl); + jsonWriter.writeStringField("generalText", this.generalText); + jsonWriter.writeArrayField("matchedConditionDescriptions", this.matchedConditionDescriptions, + (writer, element) -> writer.writeString(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChatMessagePolicyViolationPolicyTip from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChatMessagePolicyViolationPolicyTip 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 MicrosoftGraphChatMessagePolicyViolationPolicyTip. + */ + public static MicrosoftGraphChatMessagePolicyViolationPolicyTip fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChatMessagePolicyViolationPolicyTip deserializedMicrosoftGraphChatMessagePolicyViolationPolicyTip + = new MicrosoftGraphChatMessagePolicyViolationPolicyTip(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("complianceUrl".equals(fieldName)) { + deserializedMicrosoftGraphChatMessagePolicyViolationPolicyTip.complianceUrl = reader.getString(); + } else if ("generalText".equals(fieldName)) { + deserializedMicrosoftGraphChatMessagePolicyViolationPolicyTip.generalText = reader.getString(); + } else if ("matchedConditionDescriptions".equals(fieldName)) { + List matchedConditionDescriptions = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphChatMessagePolicyViolationPolicyTip.matchedConditionDescriptions + = matchedConditionDescriptions; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChatMessagePolicyViolationPolicyTip.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChatMessagePolicyViolationPolicyTip; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationUserActionTypes.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationUserActionTypes.java index a4378ac31f97a..4a7f024926ea9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationUserActionTypes.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationUserActionTypes.java @@ -5,25 +5,32 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** chatMessagePolicyViolationUserActionTypes. */ +/** + * chatMessagePolicyViolationUserActionTypes. + */ public final class MicrosoftGraphChatMessagePolicyViolationUserActionTypes extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphChatMessagePolicyViolationUserActionTypes. */ + /** + * Static value none for MicrosoftGraphChatMessagePolicyViolationUserActionTypes. + */ public static final MicrosoftGraphChatMessagePolicyViolationUserActionTypes NONE = fromString("none"); - /** Static value override for MicrosoftGraphChatMessagePolicyViolationUserActionTypes. */ + /** + * Static value override for MicrosoftGraphChatMessagePolicyViolationUserActionTypes. + */ public static final MicrosoftGraphChatMessagePolicyViolationUserActionTypes OVERRIDE = fromString("override"); - /** Static value reportFalsePositive for MicrosoftGraphChatMessagePolicyViolationUserActionTypes. */ - public static final MicrosoftGraphChatMessagePolicyViolationUserActionTypes REPORT_FALSE_POSITIVE = - fromString("reportFalsePositive"); + /** + * Static value reportFalsePositive for MicrosoftGraphChatMessagePolicyViolationUserActionTypes. + */ + public static final MicrosoftGraphChatMessagePolicyViolationUserActionTypes REPORT_FALSE_POSITIVE + = fromString("reportFalsePositive"); /** * Creates a new instance of MicrosoftGraphChatMessagePolicyViolationUserActionTypes value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -32,18 +39,17 @@ public MicrosoftGraphChatMessagePolicyViolationUserActionTypes() { /** * Creates or finds a MicrosoftGraphChatMessagePolicyViolationUserActionTypes from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphChatMessagePolicyViolationUserActionTypes. */ - @JsonCreator public static MicrosoftGraphChatMessagePolicyViolationUserActionTypes fromString(String name) { return fromString(name, MicrosoftGraphChatMessagePolicyViolationUserActionTypes.class); } /** * Gets known MicrosoftGraphChatMessagePolicyViolationUserActionTypes values. - * + * * @return known MicrosoftGraphChatMessagePolicyViolationUserActionTypes values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes.java index 57233a2cdd305..14e31b29717cf 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes.java @@ -5,32 +5,39 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** chatMessagePolicyViolationVerdictDetailsTypes. */ +/** + * chatMessagePolicyViolationVerdictDetailsTypes. + */ public final class MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes. */ + /** + * Static value none for MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes. + */ public static final MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes NONE = fromString("none"); - /** Static value allowFalsePositiveOverride for MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes. */ - public static final MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes ALLOW_FALSE_POSITIVE_OVERRIDE = - fromString("allowFalsePositiveOverride"); + /** + * Static value allowFalsePositiveOverride for MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes. + */ + public static final MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes ALLOW_FALSE_POSITIVE_OVERRIDE + = fromString("allowFalsePositiveOverride"); /** * Static value allowOverrideWithoutJustification for MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes. */ - public static final MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes - ALLOW_OVERRIDE_WITHOUT_JUSTIFICATION = fromString("allowOverrideWithoutJustification"); + public static final MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes ALLOW_OVERRIDE_WITHOUT_JUSTIFICATION + = fromString("allowOverrideWithoutJustification"); - /** Static value allowOverrideWithJustification for MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes. */ - public static final MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes ALLOW_OVERRIDE_WITH_JUSTIFICATION = - fromString("allowOverrideWithJustification"); + /** + * Static value allowOverrideWithJustification for MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes. + */ + public static final MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes ALLOW_OVERRIDE_WITH_JUSTIFICATION + = fromString("allowOverrideWithJustification"); /** * Creates a new instance of MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +46,17 @@ public MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes() { /** * Creates or finds a MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes. */ - @JsonCreator public static MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes fromString(String name) { return fromString(name, MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes.class); } /** * Gets known MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes values. - * + * * @return known MicrosoftGraphChatMessagePolicyViolationVerdictDetailsTypes values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageReaction.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageReaction.java index 74548c7fa7ce7..040a1d8d6a631 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageReaction.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageReaction.java @@ -5,47 +5,51 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** chatMessageReaction. */ +/** + * chatMessageReaction. + */ @Fluent -public final class MicrosoftGraphChatMessageReaction { +public final class MicrosoftGraphChatMessageReaction implements JsonSerializable { /* * The createdDateTime property. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * The reactionType property. */ - @JsonProperty(value = "reactionType") private String reactionType; /* * identitySet */ - @JsonProperty(value = "user") private MicrosoftGraphIdentitySet user; /* * chatMessageReaction */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChatMessageReaction class. */ + /** + * Creates an instance of MicrosoftGraphChatMessageReaction class. + */ public MicrosoftGraphChatMessageReaction() { } /** * Get the createdDateTime property: The createdDateTime property. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -54,7 +58,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: The createdDateTime property. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphChatMessageReaction object itself. */ @@ -65,7 +69,7 @@ public MicrosoftGraphChatMessageReaction withCreatedDateTime(OffsetDateTime crea /** * Get the reactionType property: The reactionType property. - * + * * @return the reactionType value. */ public String reactionType() { @@ -74,7 +78,7 @@ public String reactionType() { /** * Set the reactionType property: The reactionType property. - * + * * @param reactionType the reactionType value to set. * @return the MicrosoftGraphChatMessageReaction object itself. */ @@ -85,7 +89,7 @@ public MicrosoftGraphChatMessageReaction withReactionType(String reactionType) { /** * Get the user property: identitySet. - * + * * @return the user value. */ public MicrosoftGraphIdentitySet user() { @@ -94,7 +98,7 @@ public MicrosoftGraphIdentitySet user() { /** * Set the user property: identitySet. - * + * * @param user the user value to set. * @return the MicrosoftGraphChatMessageReaction object itself. */ @@ -105,17 +109,16 @@ public MicrosoftGraphChatMessageReaction withUser(MicrosoftGraphIdentitySet user /** * Get the additionalProperties property: chatMessageReaction. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: chatMessageReaction. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChatMessageReaction object itself. */ @@ -124,17 +127,9 @@ public MicrosoftGraphChatMessageReaction withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -142,4 +137,60 @@ public void validate() { user().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("reactionType", this.reactionType); + jsonWriter.writeJsonField("user", this.user); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChatMessageReaction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChatMessageReaction 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 MicrosoftGraphChatMessageReaction. + */ + public static MicrosoftGraphChatMessageReaction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChatMessageReaction deserializedMicrosoftGraphChatMessageReaction + = new MicrosoftGraphChatMessageReaction(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageReaction.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("reactionType".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageReaction.reactionType = reader.getString(); + } else if ("user".equals(fieldName)) { + deserializedMicrosoftGraphChatMessageReaction.user = MicrosoftGraphIdentitySet.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChatMessageReaction.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChatMessageReaction; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageType.java index 261c9c91b95fd..ff2661416386c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChatMessageType.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** chatMessageType. */ +/** + * chatMessageType. + */ public final class MicrosoftGraphChatMessageType extends ExpandableStringEnum { - /** Static value message for MicrosoftGraphChatMessageType. */ + /** + * Static value message for MicrosoftGraphChatMessageType. + */ public static final MicrosoftGraphChatMessageType MESSAGE = fromString("message"); - /** Static value chatEvent for MicrosoftGraphChatMessageType. */ + /** + * Static value chatEvent for MicrosoftGraphChatMessageType. + */ public static final MicrosoftGraphChatMessageType CHAT_EVENT = fromString("chatEvent"); - /** Static value typing for MicrosoftGraphChatMessageType. */ + /** + * Static value typing for MicrosoftGraphChatMessageType. + */ public static final MicrosoftGraphChatMessageType TYPING = fromString("typing"); - /** Static value unknownFutureValue for MicrosoftGraphChatMessageType. */ + /** + * Static value unknownFutureValue for MicrosoftGraphChatMessageType. + */ public static final MicrosoftGraphChatMessageType UNKNOWN_FUTURE_VALUE = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphChatMessageType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public MicrosoftGraphChatMessageType() { /** * Creates or finds a MicrosoftGraphChatMessageType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphChatMessageType. */ - @JsonCreator public static MicrosoftGraphChatMessageType fromString(String name) { return fromString(name, MicrosoftGraphChatMessageType.class); } /** * Gets known MicrosoftGraphChatMessageType values. - * + * * @return known MicrosoftGraphChatMessageType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChoiceColumn.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChoiceColumn.java index 9b320715bb535..676b531d5de00 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChoiceColumn.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphChoiceColumn.java @@ -5,47 +5,49 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** choiceColumn. */ +/** + * choiceColumn. + */ @Fluent -public final class MicrosoftGraphChoiceColumn { +public final class MicrosoftGraphChoiceColumn implements JsonSerializable { /* * If true, allows custom values that aren't in the configured choices. */ - @JsonProperty(value = "allowTextEntry") private Boolean allowTextEntry; /* * The list of values available for this column. */ - @JsonProperty(value = "choices") private List choices; /* * How the choices are to be presented in the UX. Must be one of checkBoxes, dropDownMenu, or radioButtons */ - @JsonProperty(value = "displayAs") private String displayAs; /* * choiceColumn */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphChoiceColumn class. */ + /** + * Creates an instance of MicrosoftGraphChoiceColumn class. + */ public MicrosoftGraphChoiceColumn() { } /** * Get the allowTextEntry property: If true, allows custom values that aren't in the configured choices. - * + * * @return the allowTextEntry value. */ public Boolean allowTextEntry() { @@ -54,7 +56,7 @@ public Boolean allowTextEntry() { /** * Set the allowTextEntry property: If true, allows custom values that aren't in the configured choices. - * + * * @param allowTextEntry the allowTextEntry value to set. * @return the MicrosoftGraphChoiceColumn object itself. */ @@ -65,7 +67,7 @@ public MicrosoftGraphChoiceColumn withAllowTextEntry(Boolean allowTextEntry) { /** * Get the choices property: The list of values available for this column. - * + * * @return the choices value. */ public List choices() { @@ -74,7 +76,7 @@ public List choices() { /** * Set the choices property: The list of values available for this column. - * + * * @param choices the choices value to set. * @return the MicrosoftGraphChoiceColumn object itself. */ @@ -86,7 +88,7 @@ public MicrosoftGraphChoiceColumn withChoices(List choices) { /** * Get the displayAs property: How the choices are to be presented in the UX. Must be one of checkBoxes, * dropDownMenu, or radioButtons. - * + * * @return the displayAs value. */ public String displayAs() { @@ -96,7 +98,7 @@ public String displayAs() { /** * Set the displayAs property: How the choices are to be presented in the UX. Must be one of checkBoxes, * dropDownMenu, or radioButtons. - * + * * @param displayAs the displayAs value to set. * @return the MicrosoftGraphChoiceColumn object itself. */ @@ -107,17 +109,16 @@ public MicrosoftGraphChoiceColumn withDisplayAs(String displayAs) { /** * Get the additionalProperties property: choiceColumn. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: choiceColumn. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphChoiceColumn object itself. */ @@ -126,19 +127,65 @@ public MicrosoftGraphChoiceColumn withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowTextEntry", this.allowTextEntry); + jsonWriter.writeArrayField("choices", this.choices, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("displayAs", this.displayAs); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphChoiceColumn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphChoiceColumn 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 MicrosoftGraphChoiceColumn. + */ + public static MicrosoftGraphChoiceColumn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphChoiceColumn deserializedMicrosoftGraphChoiceColumn = new MicrosoftGraphChoiceColumn(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowTextEntry".equals(fieldName)) { + deserializedMicrosoftGraphChoiceColumn.allowTextEntry = reader.getNullable(JsonReader::getBoolean); + } else if ("choices".equals(fieldName)) { + List choices = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphChoiceColumn.choices = choices; + } else if ("displayAs".equals(fieldName)) { + deserializedMicrosoftGraphChoiceColumn.displayAs = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphChoiceColumn.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphChoiceColumn; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphClaimsMappingPolicy.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphClaimsMappingPolicy.java index f4de49d91c265..f779b90a3d95c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphClaimsMappingPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphClaimsMappingPolicy.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * claimsMappingPolicy - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -25,19 +28,20 @@ public final class MicrosoftGraphClaimsMappingPolicy extends MicrosoftGraphStsPo * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphClaimsMappingPolicy class. */ + /** + * Creates an instance of MicrosoftGraphClaimsMappingPolicy class. + */ public MicrosoftGraphClaimsMappingPolicy() { } /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -45,7 +49,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphClaimsMappingPolicy object itself. */ @@ -54,57 +58,63 @@ public MicrosoftGraphClaimsMappingPolicy withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphClaimsMappingPolicy withDefinition(List definition) { super.withDefinition(definition); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphClaimsMappingPolicy withIsOrganizationDefault(Boolean isOrganizationDefault) { super.withIsOrganizationDefault(isOrganizationDefault); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphClaimsMappingPolicy withAppliesTo(List appliesTo) { super.withAppliesTo(appliesTo); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphClaimsMappingPolicy withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphClaimsMappingPolicy withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphClaimsMappingPolicy withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphClaimsMappingPolicy withId(String id) { super.withId(id); @@ -113,11 +123,83 @@ public MicrosoftGraphClaimsMappingPolicy withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeArrayField("definition", definition(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isOrganizationDefault", isOrganizationDefault()); + jsonWriter.writeArrayField("appliesTo", appliesTo(), (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphClaimsMappingPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphClaimsMappingPolicy 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 MicrosoftGraphClaimsMappingPolicy. + */ + public static MicrosoftGraphClaimsMappingPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphClaimsMappingPolicy deserializedMicrosoftGraphClaimsMappingPolicy + = new MicrosoftGraphClaimsMappingPolicy(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphClaimsMappingPolicy.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphClaimsMappingPolicy.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphClaimsMappingPolicy.withDescription(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphClaimsMappingPolicy.withDisplayName(reader.getString()); + } else if ("definition".equals(fieldName)) { + List definition = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphClaimsMappingPolicy.withDefinition(definition); + } else if ("isOrganizationDefault".equals(fieldName)) { + deserializedMicrosoftGraphClaimsMappingPolicy + .withIsOrganizationDefault(reader.getNullable(JsonReader::getBoolean)); + } else if ("appliesTo".equals(fieldName)) { + List appliesTo + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphClaimsMappingPolicy.withAppliesTo(appliesTo); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphClaimsMappingPolicy.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphClaimsMappingPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphColumnDefinition.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphColumnDefinition.java index 8e76e75d41342..026e1dae7f768 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphColumnDefinition.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphColumnDefinition.java @@ -5,152 +5,133 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** columnDefinition. */ +/** + * columnDefinition. + */ @Fluent public final class MicrosoftGraphColumnDefinition extends MicrosoftGraphEntity { /* * booleanColumn */ - @JsonProperty(value = "boolean") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map booleanProperty; /* * calculatedColumn */ - @JsonProperty(value = "calculated") private MicrosoftGraphCalculatedColumn calculated; /* * choiceColumn */ - @JsonProperty(value = "choice") private MicrosoftGraphChoiceColumn choice; /* * For site columns, the name of the group this column belongs to. Helps organize related columns. */ - @JsonProperty(value = "columnGroup") private String columnGroup; /* * currencyColumn */ - @JsonProperty(value = "currency") private MicrosoftGraphCurrencyColumn currency; /* * dateTimeColumn */ - @JsonProperty(value = "dateTime") private MicrosoftGraphDateTimeColumn dateTime; /* * defaultColumnValue */ - @JsonProperty(value = "defaultValue") private MicrosoftGraphDefaultColumnValue defaultValue; /* * The user-facing description of the column. */ - @JsonProperty(value = "description") private String description; /* * The user-facing name of the column. */ - @JsonProperty(value = "displayName") private String displayName; /* * If true, no two list items may have the same value for this column. */ - @JsonProperty(value = "enforceUniqueValues") private Boolean enforceUniqueValues; /* * geolocationColumn */ - @JsonProperty(value = "geolocation") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map geolocation; /* * Specifies whether the column is displayed in the user interface. */ - @JsonProperty(value = "hidden") private Boolean hidden; /* * Specifies whether the column values can used for sorting and searching. */ - @JsonProperty(value = "indexed") private Boolean indexed; /* * lookupColumn */ - @JsonProperty(value = "lookup") private MicrosoftGraphLookupColumn lookup; /* * The API-facing name of the column as it appears in the [fields][] on a [listItem][]. For the user-facing name, * see displayName. */ - @JsonProperty(value = "name") private String name; /* * numberColumn */ - @JsonProperty(value = "number") private MicrosoftGraphNumberColumn number; /* * personOrGroupColumn */ - @JsonProperty(value = "personOrGroup") private MicrosoftGraphPersonOrGroupColumn personOrGroup; /* * Specifies whether the column values can be modified. */ - @JsonProperty(value = "readOnly") private Boolean readOnly; /* * Specifies whether the column value is not optional. */ - @JsonProperty(value = "required") private Boolean required; /* * textColumn */ - @JsonProperty(value = "text") private MicrosoftGraphTextColumn text; /* * columnDefinition */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphColumnDefinition class. */ + /** + * Creates an instance of MicrosoftGraphColumnDefinition class. + */ public MicrosoftGraphColumnDefinition() { } /** * Get the booleanProperty property: booleanColumn. - * + * * @return the booleanProperty value. */ public Map booleanProperty() { @@ -159,7 +140,7 @@ public Map booleanProperty() { /** * Set the booleanProperty property: booleanColumn. - * + * * @param booleanProperty the booleanProperty value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -170,7 +151,7 @@ public MicrosoftGraphColumnDefinition withBooleanProperty(Map bo /** * Get the calculated property: calculatedColumn. - * + * * @return the calculated value. */ public MicrosoftGraphCalculatedColumn calculated() { @@ -179,7 +160,7 @@ public MicrosoftGraphCalculatedColumn calculated() { /** * Set the calculated property: calculatedColumn. - * + * * @param calculated the calculated value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -190,7 +171,7 @@ public MicrosoftGraphColumnDefinition withCalculated(MicrosoftGraphCalculatedCol /** * Get the choice property: choiceColumn. - * + * * @return the choice value. */ public MicrosoftGraphChoiceColumn choice() { @@ -199,7 +180,7 @@ public MicrosoftGraphChoiceColumn choice() { /** * Set the choice property: choiceColumn. - * + * * @param choice the choice value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -211,7 +192,7 @@ public MicrosoftGraphColumnDefinition withChoice(MicrosoftGraphChoiceColumn choi /** * Get the columnGroup property: For site columns, the name of the group this column belongs to. Helps organize * related columns. - * + * * @return the columnGroup value. */ public String columnGroup() { @@ -221,7 +202,7 @@ public String columnGroup() { /** * Set the columnGroup property: For site columns, the name of the group this column belongs to. Helps organize * related columns. - * + * * @param columnGroup the columnGroup value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -232,7 +213,7 @@ public MicrosoftGraphColumnDefinition withColumnGroup(String columnGroup) { /** * Get the currency property: currencyColumn. - * + * * @return the currency value. */ public MicrosoftGraphCurrencyColumn currency() { @@ -241,7 +222,7 @@ public MicrosoftGraphCurrencyColumn currency() { /** * Set the currency property: currencyColumn. - * + * * @param currency the currency value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -252,7 +233,7 @@ public MicrosoftGraphColumnDefinition withCurrency(MicrosoftGraphCurrencyColumn /** * Get the dateTime property: dateTimeColumn. - * + * * @return the dateTime value. */ public MicrosoftGraphDateTimeColumn dateTime() { @@ -261,7 +242,7 @@ public MicrosoftGraphDateTimeColumn dateTime() { /** * Set the dateTime property: dateTimeColumn. - * + * * @param dateTime the dateTime value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -272,7 +253,7 @@ public MicrosoftGraphColumnDefinition withDateTime(MicrosoftGraphDateTimeColumn /** * Get the defaultValue property: defaultColumnValue. - * + * * @return the defaultValue value. */ public MicrosoftGraphDefaultColumnValue defaultValue() { @@ -281,7 +262,7 @@ public MicrosoftGraphDefaultColumnValue defaultValue() { /** * Set the defaultValue property: defaultColumnValue. - * + * * @param defaultValue the defaultValue value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -292,7 +273,7 @@ public MicrosoftGraphColumnDefinition withDefaultValue(MicrosoftGraphDefaultColu /** * Get the description property: The user-facing description of the column. - * + * * @return the description value. */ public String description() { @@ -301,7 +282,7 @@ public String description() { /** * Set the description property: The user-facing description of the column. - * + * * @param description the description value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -312,7 +293,7 @@ public MicrosoftGraphColumnDefinition withDescription(String description) { /** * Get the displayName property: The user-facing name of the column. - * + * * @return the displayName value. */ public String displayName() { @@ -321,7 +302,7 @@ public String displayName() { /** * Set the displayName property: The user-facing name of the column. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -332,7 +313,7 @@ public MicrosoftGraphColumnDefinition withDisplayName(String displayName) { /** * Get the enforceUniqueValues property: If true, no two list items may have the same value for this column. - * + * * @return the enforceUniqueValues value. */ public Boolean enforceUniqueValues() { @@ -341,7 +322,7 @@ public Boolean enforceUniqueValues() { /** * Set the enforceUniqueValues property: If true, no two list items may have the same value for this column. - * + * * @param enforceUniqueValues the enforceUniqueValues value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -352,7 +333,7 @@ public MicrosoftGraphColumnDefinition withEnforceUniqueValues(Boolean enforceUni /** * Get the geolocation property: geolocationColumn. - * + * * @return the geolocation value. */ public Map geolocation() { @@ -361,7 +342,7 @@ public Map geolocation() { /** * Set the geolocation property: geolocationColumn. - * + * * @param geolocation the geolocation value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -372,7 +353,7 @@ public MicrosoftGraphColumnDefinition withGeolocation(Map geoloc /** * Get the hidden property: Specifies whether the column is displayed in the user interface. - * + * * @return the hidden value. */ public Boolean hidden() { @@ -381,7 +362,7 @@ public Boolean hidden() { /** * Set the hidden property: Specifies whether the column is displayed in the user interface. - * + * * @param hidden the hidden value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -392,7 +373,7 @@ public MicrosoftGraphColumnDefinition withHidden(Boolean hidden) { /** * Get the indexed property: Specifies whether the column values can used for sorting and searching. - * + * * @return the indexed value. */ public Boolean indexed() { @@ -401,7 +382,7 @@ public Boolean indexed() { /** * Set the indexed property: Specifies whether the column values can used for sorting and searching. - * + * * @param indexed the indexed value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -412,7 +393,7 @@ public MicrosoftGraphColumnDefinition withIndexed(Boolean indexed) { /** * Get the lookup property: lookupColumn. - * + * * @return the lookup value. */ public MicrosoftGraphLookupColumn lookup() { @@ -421,7 +402,7 @@ public MicrosoftGraphLookupColumn lookup() { /** * Set the lookup property: lookupColumn. - * + * * @param lookup the lookup value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -433,7 +414,7 @@ public MicrosoftGraphColumnDefinition withLookup(MicrosoftGraphLookupColumn look /** * Get the name property: The API-facing name of the column as it appears in the [fields][] on a [listItem][]. For * the user-facing name, see displayName. - * + * * @return the name value. */ public String name() { @@ -443,7 +424,7 @@ public String name() { /** * Set the name property: The API-facing name of the column as it appears in the [fields][] on a [listItem][]. For * the user-facing name, see displayName. - * + * * @param name the name value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -454,7 +435,7 @@ public MicrosoftGraphColumnDefinition withName(String name) { /** * Get the number property: numberColumn. - * + * * @return the number value. */ public MicrosoftGraphNumberColumn number() { @@ -463,7 +444,7 @@ public MicrosoftGraphNumberColumn number() { /** * Set the number property: numberColumn. - * + * * @param number the number value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -474,7 +455,7 @@ public MicrosoftGraphColumnDefinition withNumber(MicrosoftGraphNumberColumn numb /** * Get the personOrGroup property: personOrGroupColumn. - * + * * @return the personOrGroup value. */ public MicrosoftGraphPersonOrGroupColumn personOrGroup() { @@ -483,7 +464,7 @@ public MicrosoftGraphPersonOrGroupColumn personOrGroup() { /** * Set the personOrGroup property: personOrGroupColumn. - * + * * @param personOrGroup the personOrGroup value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -494,7 +475,7 @@ public MicrosoftGraphColumnDefinition withPersonOrGroup(MicrosoftGraphPersonOrGr /** * Get the readOnly property: Specifies whether the column values can be modified. - * + * * @return the readOnly value. */ public Boolean readOnly() { @@ -503,7 +484,7 @@ public Boolean readOnly() { /** * Set the readOnly property: Specifies whether the column values can be modified. - * + * * @param readOnly the readOnly value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -514,7 +495,7 @@ public MicrosoftGraphColumnDefinition withReadOnly(Boolean readOnly) { /** * Get the required property: Specifies whether the column value is not optional. - * + * * @return the required value. */ public Boolean required() { @@ -523,7 +504,7 @@ public Boolean required() { /** * Set the required property: Specifies whether the column value is not optional. - * + * * @param required the required value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -534,7 +515,7 @@ public MicrosoftGraphColumnDefinition withRequired(Boolean required) { /** * Get the text property: textColumn. - * + * * @return the text value. */ public MicrosoftGraphTextColumn text() { @@ -543,7 +524,7 @@ public MicrosoftGraphTextColumn text() { /** * Set the text property: textColumn. - * + * * @param text the text value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -554,17 +535,16 @@ public MicrosoftGraphColumnDefinition withText(MicrosoftGraphTextColumn text) { /** * Get the additionalProperties property: columnDefinition. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: columnDefinition. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphColumnDefinition object itself. */ @@ -573,15 +553,9 @@ public MicrosoftGraphColumnDefinition withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphColumnDefinition withId(String id) { super.withId(id); @@ -590,7 +564,7 @@ public MicrosoftGraphColumnDefinition withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -624,4 +598,118 @@ public void validate() { text().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeMapField("boolean", this.booleanProperty, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeJsonField("calculated", this.calculated); + jsonWriter.writeJsonField("choice", this.choice); + jsonWriter.writeStringField("columnGroup", this.columnGroup); + jsonWriter.writeJsonField("currency", this.currency); + jsonWriter.writeJsonField("dateTime", this.dateTime); + jsonWriter.writeJsonField("defaultValue", this.defaultValue); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeBooleanField("enforceUniqueValues", this.enforceUniqueValues); + jsonWriter.writeMapField("geolocation", this.geolocation, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeBooleanField("hidden", this.hidden); + jsonWriter.writeBooleanField("indexed", this.indexed); + jsonWriter.writeJsonField("lookup", this.lookup); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("number", this.number); + jsonWriter.writeJsonField("personOrGroup", this.personOrGroup); + jsonWriter.writeBooleanField("readOnly", this.readOnly); + jsonWriter.writeBooleanField("required", this.required); + jsonWriter.writeJsonField("text", this.text); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphColumnDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphColumnDefinition 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 MicrosoftGraphColumnDefinition. + */ + public static MicrosoftGraphColumnDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphColumnDefinition deserializedMicrosoftGraphColumnDefinition + = new MicrosoftGraphColumnDefinition(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.withId(reader.getString()); + } else if ("boolean".equals(fieldName)) { + Map booleanProperty = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphColumnDefinition.booleanProperty = booleanProperty; + } else if ("calculated".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.calculated + = MicrosoftGraphCalculatedColumn.fromJson(reader); + } else if ("choice".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.choice = MicrosoftGraphChoiceColumn.fromJson(reader); + } else if ("columnGroup".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.columnGroup = reader.getString(); + } else if ("currency".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.currency = MicrosoftGraphCurrencyColumn.fromJson(reader); + } else if ("dateTime".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.dateTime = MicrosoftGraphDateTimeColumn.fromJson(reader); + } else if ("defaultValue".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.defaultValue + = MicrosoftGraphDefaultColumnValue.fromJson(reader); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.displayName = reader.getString(); + } else if ("enforceUniqueValues".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.enforceUniqueValues + = reader.getNullable(JsonReader::getBoolean); + } else if ("geolocation".equals(fieldName)) { + Map geolocation = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphColumnDefinition.geolocation = geolocation; + } else if ("hidden".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.hidden = reader.getNullable(JsonReader::getBoolean); + } else if ("indexed".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.indexed = reader.getNullable(JsonReader::getBoolean); + } else if ("lookup".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.lookup = MicrosoftGraphLookupColumn.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.name = reader.getString(); + } else if ("number".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.number = MicrosoftGraphNumberColumn.fromJson(reader); + } else if ("personOrGroup".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.personOrGroup + = MicrosoftGraphPersonOrGroupColumn.fromJson(reader); + } else if ("readOnly".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.readOnly = reader.getNullable(JsonReader::getBoolean); + } else if ("required".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.required = reader.getNullable(JsonReader::getBoolean); + } else if ("text".equals(fieldName)) { + deserializedMicrosoftGraphColumnDefinition.text = MicrosoftGraphTextColumn.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphColumnDefinition.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphColumnDefinition; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphColumnLink.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphColumnLink.java index d0159d49c2f63..86b477b56d195 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphColumnLink.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphColumnLink.java @@ -5,34 +5,37 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** columnLink. */ +/** + * columnLink. + */ @Fluent public final class MicrosoftGraphColumnLink extends MicrosoftGraphEntity { /* - * The name of the column in this content type. + * The name of the column in this content type. */ - @JsonProperty(value = "name") private String name; /* * columnLink */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphColumnLink class. */ + /** + * Creates an instance of MicrosoftGraphColumnLink class. + */ public MicrosoftGraphColumnLink() { } /** * Get the name property: The name of the column in this content type. - * + * * @return the name value. */ public String name() { @@ -41,7 +44,7 @@ public String name() { /** * Set the name property: The name of the column in this content type. - * + * * @param name the name value to set. * @return the MicrosoftGraphColumnLink object itself. */ @@ -52,17 +55,16 @@ public MicrosoftGraphColumnLink withName(String name) { /** * Get the additionalProperties property: columnLink. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: columnLink. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphColumnLink object itself. */ @@ -71,15 +73,9 @@ public MicrosoftGraphColumnLink withAdditionalProperties(Map add return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphColumnLink withId(String id) { super.withId(id); @@ -88,11 +84,61 @@ public MicrosoftGraphColumnLink withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("name", this.name); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphColumnLink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphColumnLink 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 MicrosoftGraphColumnLink. + */ + public static MicrosoftGraphColumnLink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphColumnLink deserializedMicrosoftGraphColumnLink = new MicrosoftGraphColumnLink(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphColumnLink.withId(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphColumnLink.name = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphColumnLink.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphColumnLink; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphComplianceState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphComplianceState.java index a2ee147ab910e..63cdef199910c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphComplianceState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphComplianceState.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** complianceState. */ +/** + * complianceState. + */ public final class MicrosoftGraphComplianceState extends ExpandableStringEnum { - /** Static value unknown for MicrosoftGraphComplianceState. */ + /** + * Static value unknown for MicrosoftGraphComplianceState. + */ public static final MicrosoftGraphComplianceState UNKNOWN = fromString("unknown"); - /** Static value compliant for MicrosoftGraphComplianceState. */ + /** + * Static value compliant for MicrosoftGraphComplianceState. + */ public static final MicrosoftGraphComplianceState COMPLIANT = fromString("compliant"); - /** Static value noncompliant for MicrosoftGraphComplianceState. */ + /** + * Static value noncompliant for MicrosoftGraphComplianceState. + */ public static final MicrosoftGraphComplianceState NONCOMPLIANT = fromString("noncompliant"); - /** Static value conflict for MicrosoftGraphComplianceState. */ + /** + * Static value conflict for MicrosoftGraphComplianceState. + */ public static final MicrosoftGraphComplianceState CONFLICT = fromString("conflict"); - /** Static value error for MicrosoftGraphComplianceState. */ + /** + * Static value error for MicrosoftGraphComplianceState. + */ public static final MicrosoftGraphComplianceState ERROR = fromString("error"); - /** Static value inGracePeriod for MicrosoftGraphComplianceState. */ + /** + * Static value inGracePeriod for MicrosoftGraphComplianceState. + */ public static final MicrosoftGraphComplianceState IN_GRACE_PERIOD = fromString("inGracePeriod"); - /** Static value configManager for MicrosoftGraphComplianceState. */ + /** + * Static value configManager for MicrosoftGraphComplianceState. + */ public static final MicrosoftGraphComplianceState CONFIG_MANAGER = fromString("configManager"); /** * Creates a new instance of MicrosoftGraphComplianceState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public MicrosoftGraphComplianceState() { /** * Creates or finds a MicrosoftGraphComplianceState from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphComplianceState. */ - @JsonCreator public static MicrosoftGraphComplianceState fromString(String name) { return fromString(name, MicrosoftGraphComplianceState.class); } /** * Gets known MicrosoftGraphComplianceState values. - * + * * @return known MicrosoftGraphComplianceState values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphComplianceStatus.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphComplianceStatus.java index 0703be11f0c6d..ff28e7ea87359 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphComplianceStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphComplianceStatus.java @@ -5,38 +5,55 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** complianceStatus. */ +/** + * complianceStatus. + */ public final class MicrosoftGraphComplianceStatus extends ExpandableStringEnum { - /** Static value unknown for MicrosoftGraphComplianceStatus. */ + /** + * Static value unknown for MicrosoftGraphComplianceStatus. + */ public static final MicrosoftGraphComplianceStatus UNKNOWN = fromString("unknown"); - /** Static value notApplicable for MicrosoftGraphComplianceStatus. */ + /** + * Static value notApplicable for MicrosoftGraphComplianceStatus. + */ public static final MicrosoftGraphComplianceStatus NOT_APPLICABLE = fromString("notApplicable"); - /** Static value compliant for MicrosoftGraphComplianceStatus. */ + /** + * Static value compliant for MicrosoftGraphComplianceStatus. + */ public static final MicrosoftGraphComplianceStatus COMPLIANT = fromString("compliant"); - /** Static value remediated for MicrosoftGraphComplianceStatus. */ + /** + * Static value remediated for MicrosoftGraphComplianceStatus. + */ public static final MicrosoftGraphComplianceStatus REMEDIATED = fromString("remediated"); - /** Static value nonCompliant for MicrosoftGraphComplianceStatus. */ + /** + * Static value nonCompliant for MicrosoftGraphComplianceStatus. + */ public static final MicrosoftGraphComplianceStatus NON_COMPLIANT = fromString("nonCompliant"); - /** Static value error for MicrosoftGraphComplianceStatus. */ + /** + * Static value error for MicrosoftGraphComplianceStatus. + */ public static final MicrosoftGraphComplianceStatus ERROR = fromString("error"); - /** Static value conflict for MicrosoftGraphComplianceStatus. */ + /** + * Static value conflict for MicrosoftGraphComplianceStatus. + */ public static final MicrosoftGraphComplianceStatus CONFLICT = fromString("conflict"); - /** Static value notAssigned for MicrosoftGraphComplianceStatus. */ + /** + * Static value notAssigned for MicrosoftGraphComplianceStatus. + */ public static final MicrosoftGraphComplianceStatus NOT_ASSIGNED = fromString("notAssigned"); /** * Creates a new instance of MicrosoftGraphComplianceStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -45,18 +62,17 @@ public MicrosoftGraphComplianceStatus() { /** * Creates or finds a MicrosoftGraphComplianceStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphComplianceStatus. */ - @JsonCreator public static MicrosoftGraphComplianceStatus fromString(String name) { return fromString(name, MicrosoftGraphComplianceStatus.class); } /** * Gets known MicrosoftGraphComplianceStatus values. - * + * * @return known MicrosoftGraphComplianceStatus values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConfigurationManagerClientEnabledFeatures.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConfigurationManagerClientEnabledFeatures.java index a61ce8a9c231a..52d1c3ba75acb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConfigurationManagerClientEnabledFeatures.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConfigurationManagerClientEnabledFeatures.java @@ -5,68 +5,66 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; /** * configurationManagerClientEnabledFeatures - * - *

configuration Manager client enabled features. + * + * configuration Manager client enabled features. */ @Fluent -public final class MicrosoftGraphConfigurationManagerClientEnabledFeatures { +public final class MicrosoftGraphConfigurationManagerClientEnabledFeatures + implements JsonSerializable { /* * Whether compliance policy is managed by Intune */ - @JsonProperty(value = "compliancePolicy") private Boolean compliancePolicy; /* * Whether device configuration is managed by Intune */ - @JsonProperty(value = "deviceConfiguration") private Boolean deviceConfiguration; /* * Whether inventory is managed by Intune */ - @JsonProperty(value = "inventory") private Boolean inventory; /* * Whether modern application is managed by Intune */ - @JsonProperty(value = "modernApps") private Boolean modernApps; /* * Whether resource access is managed by Intune */ - @JsonProperty(value = "resourceAccess") private Boolean resourceAccess; /* * Whether Windows Update for Business is managed by Intune */ - @JsonProperty(value = "windowsUpdateForBusiness") private Boolean windowsUpdateForBusiness; /* * configuration Manager client enabled features */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphConfigurationManagerClientEnabledFeatures class. */ + /** + * Creates an instance of MicrosoftGraphConfigurationManagerClientEnabledFeatures class. + */ public MicrosoftGraphConfigurationManagerClientEnabledFeatures() { } /** * Get the compliancePolicy property: Whether compliance policy is managed by Intune. - * + * * @return the compliancePolicy value. */ public Boolean compliancePolicy() { @@ -75,7 +73,7 @@ public Boolean compliancePolicy() { /** * Set the compliancePolicy property: Whether compliance policy is managed by Intune. - * + * * @param compliancePolicy the compliancePolicy value to set. * @return the MicrosoftGraphConfigurationManagerClientEnabledFeatures object itself. */ @@ -86,7 +84,7 @@ public MicrosoftGraphConfigurationManagerClientEnabledFeatures withCompliancePol /** * Get the deviceConfiguration property: Whether device configuration is managed by Intune. - * + * * @return the deviceConfiguration value. */ public Boolean deviceConfiguration() { @@ -95,19 +93,19 @@ public Boolean deviceConfiguration() { /** * Set the deviceConfiguration property: Whether device configuration is managed by Intune. - * + * * @param deviceConfiguration the deviceConfiguration value to set. * @return the MicrosoftGraphConfigurationManagerClientEnabledFeatures object itself. */ - public MicrosoftGraphConfigurationManagerClientEnabledFeatures withDeviceConfiguration( - Boolean deviceConfiguration) { + public MicrosoftGraphConfigurationManagerClientEnabledFeatures + withDeviceConfiguration(Boolean deviceConfiguration) { this.deviceConfiguration = deviceConfiguration; return this; } /** * Get the inventory property: Whether inventory is managed by Intune. - * + * * @return the inventory value. */ public Boolean inventory() { @@ -116,7 +114,7 @@ public Boolean inventory() { /** * Set the inventory property: Whether inventory is managed by Intune. - * + * * @param inventory the inventory value to set. * @return the MicrosoftGraphConfigurationManagerClientEnabledFeatures object itself. */ @@ -127,7 +125,7 @@ public MicrosoftGraphConfigurationManagerClientEnabledFeatures withInventory(Boo /** * Get the modernApps property: Whether modern application is managed by Intune. - * + * * @return the modernApps value. */ public Boolean modernApps() { @@ -136,7 +134,7 @@ public Boolean modernApps() { /** * Set the modernApps property: Whether modern application is managed by Intune. - * + * * @param modernApps the modernApps value to set. * @return the MicrosoftGraphConfigurationManagerClientEnabledFeatures object itself. */ @@ -147,7 +145,7 @@ public MicrosoftGraphConfigurationManagerClientEnabledFeatures withModernApps(Bo /** * Get the resourceAccess property: Whether resource access is managed by Intune. - * + * * @return the resourceAccess value. */ public Boolean resourceAccess() { @@ -156,7 +154,7 @@ public Boolean resourceAccess() { /** * Set the resourceAccess property: Whether resource access is managed by Intune. - * + * * @param resourceAccess the resourceAccess value to set. * @return the MicrosoftGraphConfigurationManagerClientEnabledFeatures object itself. */ @@ -167,7 +165,7 @@ public MicrosoftGraphConfigurationManagerClientEnabledFeatures withResourceAcces /** * Get the windowsUpdateForBusiness property: Whether Windows Update for Business is managed by Intune. - * + * * @return the windowsUpdateForBusiness value. */ public Boolean windowsUpdateForBusiness() { @@ -176,51 +174,113 @@ public Boolean windowsUpdateForBusiness() { /** * Set the windowsUpdateForBusiness property: Whether Windows Update for Business is managed by Intune. - * + * * @param windowsUpdateForBusiness the windowsUpdateForBusiness value to set. * @return the MicrosoftGraphConfigurationManagerClientEnabledFeatures object itself. */ - public MicrosoftGraphConfigurationManagerClientEnabledFeatures withWindowsUpdateForBusiness( - Boolean windowsUpdateForBusiness) { + public MicrosoftGraphConfigurationManagerClientEnabledFeatures + withWindowsUpdateForBusiness(Boolean windowsUpdateForBusiness) { this.windowsUpdateForBusiness = windowsUpdateForBusiness; return this; } /** * Get the additionalProperties property: configuration Manager client enabled features. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: configuration Manager client enabled features. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphConfigurationManagerClientEnabledFeatures object itself. */ - public MicrosoftGraphConfigurationManagerClientEnabledFeatures withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphConfigurationManagerClientEnabledFeatures + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("compliancePolicy", this.compliancePolicy); + jsonWriter.writeBooleanField("deviceConfiguration", this.deviceConfiguration); + jsonWriter.writeBooleanField("inventory", this.inventory); + jsonWriter.writeBooleanField("modernApps", this.modernApps); + jsonWriter.writeBooleanField("resourceAccess", this.resourceAccess); + jsonWriter.writeBooleanField("windowsUpdateForBusiness", this.windowsUpdateForBusiness); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphConfigurationManagerClientEnabledFeatures from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphConfigurationManagerClientEnabledFeatures 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 MicrosoftGraphConfigurationManagerClientEnabledFeatures. + */ + public static MicrosoftGraphConfigurationManagerClientEnabledFeatures fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphConfigurationManagerClientEnabledFeatures deserializedMicrosoftGraphConfigurationManagerClientEnabledFeatures + = new MicrosoftGraphConfigurationManagerClientEnabledFeatures(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("compliancePolicy".equals(fieldName)) { + deserializedMicrosoftGraphConfigurationManagerClientEnabledFeatures.compliancePolicy + = reader.getNullable(JsonReader::getBoolean); + } else if ("deviceConfiguration".equals(fieldName)) { + deserializedMicrosoftGraphConfigurationManagerClientEnabledFeatures.deviceConfiguration + = reader.getNullable(JsonReader::getBoolean); + } else if ("inventory".equals(fieldName)) { + deserializedMicrosoftGraphConfigurationManagerClientEnabledFeatures.inventory + = reader.getNullable(JsonReader::getBoolean); + } else if ("modernApps".equals(fieldName)) { + deserializedMicrosoftGraphConfigurationManagerClientEnabledFeatures.modernApps + = reader.getNullable(JsonReader::getBoolean); + } else if ("resourceAccess".equals(fieldName)) { + deserializedMicrosoftGraphConfigurationManagerClientEnabledFeatures.resourceAccess + = reader.getNullable(JsonReader::getBoolean); + } else if ("windowsUpdateForBusiness".equals(fieldName)) { + deserializedMicrosoftGraphConfigurationManagerClientEnabledFeatures.windowsUpdateForBusiness + = reader.getNullable(JsonReader::getBoolean); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphConfigurationManagerClientEnabledFeatures.additionalProperties + = additionalProperties; + + return deserializedMicrosoftGraphConfigurationManagerClientEnabledFeatures; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContact.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContact.java index 6b6ea4a795965..bde9a80e4f2f9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContact.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContact.java @@ -5,65 +5,61 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** contact. */ +/** + * contact. + */ @Fluent public final class MicrosoftGraphContact extends MicrosoftGraphOutlookItem { /* * The name of the contact's assistant. */ - @JsonProperty(value = "assistantName") private String assistantName; /* * The contact's birthday. The Timestamp type represents date and time information using ISO 8601 format and is * always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "birthday") private OffsetDateTime birthday; /* * physicalAddress */ - @JsonProperty(value = "businessAddress") private MicrosoftGraphPhysicalAddress businessAddress; /* * The business home page of the contact. */ - @JsonProperty(value = "businessHomePage") private String businessHomePage; /* * The contact's business phone numbers. */ - @JsonProperty(value = "businessPhones") private List businessPhones; /* * The names of the contact's children. */ - @JsonProperty(value = "children") private List children; /* * The name of the contact's company. */ - @JsonProperty(value = "companyName") private String companyName; /* * The contact's department. */ - @JsonProperty(value = "department") private String department; /* @@ -71,189 +67,162 @@ public final class MicrosoftGraphContact extends MicrosoftGraphOutlookItem { * updates to other properties may cause an automatically generated value to overwrite the displayName value you * have specified. To preserve a pre-existing value, always include it as displayName in an update operation. */ - @JsonProperty(value = "displayName") private String displayName; /* * The contact's email addresses. */ - @JsonProperty(value = "emailAddresses") private List emailAddresses; /* * The name the contact is filed under. */ - @JsonProperty(value = "fileAs") private String fileAs; /* * The contact's generation. */ - @JsonProperty(value = "generation") private String generation; /* * The contact's given name. */ - @JsonProperty(value = "givenName") private String givenName; /* * physicalAddress */ - @JsonProperty(value = "homeAddress") private MicrosoftGraphPhysicalAddress homeAddress; /* * The contact's home phone numbers. */ - @JsonProperty(value = "homePhones") private List homePhones; /* * The contact's instant messaging (IM) addresses. */ - @JsonProperty(value = "imAddresses") private List imAddresses; /* * The contact's initials. */ - @JsonProperty(value = "initials") private String initials; /* * The contact’s job title. */ - @JsonProperty(value = "jobTitle") private String jobTitle; /* * The name of the contact's manager. */ - @JsonProperty(value = "manager") private String manager; /* * The contact's middle name. */ - @JsonProperty(value = "middleName") private String middleName; /* * The contact's mobile phone number. */ - @JsonProperty(value = "mobilePhone") private String mobilePhone; /* * The contact's nickname. */ - @JsonProperty(value = "nickName") private String nickName; /* * The location of the contact's office. */ - @JsonProperty(value = "officeLocation") private String officeLocation; /* * physicalAddress */ - @JsonProperty(value = "otherAddress") private MicrosoftGraphPhysicalAddress otherAddress; /* * The ID of the contact's parent folder. */ - @JsonProperty(value = "parentFolderId") private String parentFolderId; /* * The user's notes about the contact. */ - @JsonProperty(value = "personalNotes") private String personalNotes; /* * The contact's profession. */ - @JsonProperty(value = "profession") private String profession; /* * The name of the contact's spouse/partner. */ - @JsonProperty(value = "spouseName") private String spouseName; /* * The contact's surname. */ - @JsonProperty(value = "surname") private String surname; /* * The contact's title. */ - @JsonProperty(value = "title") private String title; /* * The phonetic Japanese company name of the contact. */ - @JsonProperty(value = "yomiCompanyName") private String yomiCompanyName; /* * The phonetic Japanese given name (first name) of the contact. */ - @JsonProperty(value = "yomiGivenName") private String yomiGivenName; /* - * The phonetic Japanese surname (last name) of the contact. + * The phonetic Japanese surname (last name) of the contact. */ - @JsonProperty(value = "yomiSurname") private String yomiSurname; /* * The collection of open extensions defined for the contact. Read-only. Nullable. */ - @JsonProperty(value = "extensions") private List extensions; /* * The collection of multi-value extended properties defined for the contact. Read-only. Nullable. */ - @JsonProperty(value = "multiValueExtendedProperties") private List multiValueExtendedProperties; /* * profilePhoto */ - @JsonProperty(value = "photo") private MicrosoftGraphProfilePhoto photo; /* * The collection of single-value extended properties defined for the contact. Read-only. Nullable. */ - @JsonProperty(value = "singleValueExtendedProperties") private List singleValueExtendedProperties; /* * contact */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphContact class. */ + /** + * Creates an instance of MicrosoftGraphContact class. + */ public MicrosoftGraphContact() { } /** * Get the assistantName property: The name of the contact's assistant. - * + * * @return the assistantName value. */ public String assistantName() { @@ -262,7 +231,7 @@ public String assistantName() { /** * Set the assistantName property: The name of the contact's assistant. - * + * * @param assistantName the assistantName value to set. * @return the MicrosoftGraphContact object itself. */ @@ -275,7 +244,7 @@ public MicrosoftGraphContact withAssistantName(String assistantName) { * Get the birthday property: The contact's birthday. The Timestamp type represents date and time information using * ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @return the birthday value. */ public OffsetDateTime birthday() { @@ -286,7 +255,7 @@ public OffsetDateTime birthday() { * Set the birthday property: The contact's birthday. The Timestamp type represents date and time information using * ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @param birthday the birthday value to set. * @return the MicrosoftGraphContact object itself. */ @@ -297,7 +266,7 @@ public MicrosoftGraphContact withBirthday(OffsetDateTime birthday) { /** * Get the businessAddress property: physicalAddress. - * + * * @return the businessAddress value. */ public MicrosoftGraphPhysicalAddress businessAddress() { @@ -306,7 +275,7 @@ public MicrosoftGraphPhysicalAddress businessAddress() { /** * Set the businessAddress property: physicalAddress. - * + * * @param businessAddress the businessAddress value to set. * @return the MicrosoftGraphContact object itself. */ @@ -317,7 +286,7 @@ public MicrosoftGraphContact withBusinessAddress(MicrosoftGraphPhysicalAddress b /** * Get the businessHomePage property: The business home page of the contact. - * + * * @return the businessHomePage value. */ public String businessHomePage() { @@ -326,7 +295,7 @@ public String businessHomePage() { /** * Set the businessHomePage property: The business home page of the contact. - * + * * @param businessHomePage the businessHomePage value to set. * @return the MicrosoftGraphContact object itself. */ @@ -337,7 +306,7 @@ public MicrosoftGraphContact withBusinessHomePage(String businessHomePage) { /** * Get the businessPhones property: The contact's business phone numbers. - * + * * @return the businessPhones value. */ public List businessPhones() { @@ -346,7 +315,7 @@ public List businessPhones() { /** * Set the businessPhones property: The contact's business phone numbers. - * + * * @param businessPhones the businessPhones value to set. * @return the MicrosoftGraphContact object itself. */ @@ -357,7 +326,7 @@ public MicrosoftGraphContact withBusinessPhones(List businessPhones) { /** * Get the children property: The names of the contact's children. - * + * * @return the children value. */ public List children() { @@ -366,7 +335,7 @@ public List children() { /** * Set the children property: The names of the contact's children. - * + * * @param children the children value to set. * @return the MicrosoftGraphContact object itself. */ @@ -377,7 +346,7 @@ public MicrosoftGraphContact withChildren(List children) { /** * Get the companyName property: The name of the contact's company. - * + * * @return the companyName value. */ public String companyName() { @@ -386,7 +355,7 @@ public String companyName() { /** * Set the companyName property: The name of the contact's company. - * + * * @param companyName the companyName value to set. * @return the MicrosoftGraphContact object itself. */ @@ -397,7 +366,7 @@ public MicrosoftGraphContact withCompanyName(String companyName) { /** * Get the department property: The contact's department. - * + * * @return the department value. */ public String department() { @@ -406,7 +375,7 @@ public String department() { /** * Set the department property: The contact's department. - * + * * @param department the department value to set. * @return the MicrosoftGraphContact object itself. */ @@ -420,7 +389,7 @@ public MicrosoftGraphContact withDepartment(String department) { * operation. Note that later updates to other properties may cause an automatically generated value to overwrite * the displayName value you have specified. To preserve a pre-existing value, always include it as displayName in * an update operation. - * + * * @return the displayName value. */ public String displayName() { @@ -432,7 +401,7 @@ public String displayName() { * operation. Note that later updates to other properties may cause an automatically generated value to overwrite * the displayName value you have specified. To preserve a pre-existing value, always include it as displayName in * an update operation. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphContact object itself. */ @@ -443,7 +412,7 @@ public MicrosoftGraphContact withDisplayName(String displayName) { /** * Get the emailAddresses property: The contact's email addresses. - * + * * @return the emailAddresses value. */ public List emailAddresses() { @@ -452,7 +421,7 @@ public List emailAddresses() { /** * Set the emailAddresses property: The contact's email addresses. - * + * * @param emailAddresses the emailAddresses value to set. * @return the MicrosoftGraphContact object itself. */ @@ -463,7 +432,7 @@ public MicrosoftGraphContact withEmailAddresses(List /** * Get the fileAs property: The name the contact is filed under. - * + * * @return the fileAs value. */ public String fileAs() { @@ -472,7 +441,7 @@ public String fileAs() { /** * Set the fileAs property: The name the contact is filed under. - * + * * @param fileAs the fileAs value to set. * @return the MicrosoftGraphContact object itself. */ @@ -483,7 +452,7 @@ public MicrosoftGraphContact withFileAs(String fileAs) { /** * Get the generation property: The contact's generation. - * + * * @return the generation value. */ public String generation() { @@ -492,7 +461,7 @@ public String generation() { /** * Set the generation property: The contact's generation. - * + * * @param generation the generation value to set. * @return the MicrosoftGraphContact object itself. */ @@ -503,7 +472,7 @@ public MicrosoftGraphContact withGeneration(String generation) { /** * Get the givenName property: The contact's given name. - * + * * @return the givenName value. */ public String givenName() { @@ -512,7 +481,7 @@ public String givenName() { /** * Set the givenName property: The contact's given name. - * + * * @param givenName the givenName value to set. * @return the MicrosoftGraphContact object itself. */ @@ -523,7 +492,7 @@ public MicrosoftGraphContact withGivenName(String givenName) { /** * Get the homeAddress property: physicalAddress. - * + * * @return the homeAddress value. */ public MicrosoftGraphPhysicalAddress homeAddress() { @@ -532,7 +501,7 @@ public MicrosoftGraphPhysicalAddress homeAddress() { /** * Set the homeAddress property: physicalAddress. - * + * * @param homeAddress the homeAddress value to set. * @return the MicrosoftGraphContact object itself. */ @@ -543,7 +512,7 @@ public MicrosoftGraphContact withHomeAddress(MicrosoftGraphPhysicalAddress homeA /** * Get the homePhones property: The contact's home phone numbers. - * + * * @return the homePhones value. */ public List homePhones() { @@ -552,7 +521,7 @@ public List homePhones() { /** * Set the homePhones property: The contact's home phone numbers. - * + * * @param homePhones the homePhones value to set. * @return the MicrosoftGraphContact object itself. */ @@ -563,7 +532,7 @@ public MicrosoftGraphContact withHomePhones(List homePhones) { /** * Get the imAddresses property: The contact's instant messaging (IM) addresses. - * + * * @return the imAddresses value. */ public List imAddresses() { @@ -572,7 +541,7 @@ public List imAddresses() { /** * Set the imAddresses property: The contact's instant messaging (IM) addresses. - * + * * @param imAddresses the imAddresses value to set. * @return the MicrosoftGraphContact object itself. */ @@ -583,7 +552,7 @@ public MicrosoftGraphContact withImAddresses(List imAddresses) { /** * Get the initials property: The contact's initials. - * + * * @return the initials value. */ public String initials() { @@ -592,7 +561,7 @@ public String initials() { /** * Set the initials property: The contact's initials. - * + * * @param initials the initials value to set. * @return the MicrosoftGraphContact object itself. */ @@ -603,7 +572,7 @@ public MicrosoftGraphContact withInitials(String initials) { /** * Get the jobTitle property: The contact’s job title. - * + * * @return the jobTitle value. */ public String jobTitle() { @@ -612,7 +581,7 @@ public String jobTitle() { /** * Set the jobTitle property: The contact’s job title. - * + * * @param jobTitle the jobTitle value to set. * @return the MicrosoftGraphContact object itself. */ @@ -623,7 +592,7 @@ public MicrosoftGraphContact withJobTitle(String jobTitle) { /** * Get the manager property: The name of the contact's manager. - * + * * @return the manager value. */ public String manager() { @@ -632,7 +601,7 @@ public String manager() { /** * Set the manager property: The name of the contact's manager. - * + * * @param manager the manager value to set. * @return the MicrosoftGraphContact object itself. */ @@ -643,7 +612,7 @@ public MicrosoftGraphContact withManager(String manager) { /** * Get the middleName property: The contact's middle name. - * + * * @return the middleName value. */ public String middleName() { @@ -652,7 +621,7 @@ public String middleName() { /** * Set the middleName property: The contact's middle name. - * + * * @param middleName the middleName value to set. * @return the MicrosoftGraphContact object itself. */ @@ -663,7 +632,7 @@ public MicrosoftGraphContact withMiddleName(String middleName) { /** * Get the mobilePhone property: The contact's mobile phone number. - * + * * @return the mobilePhone value. */ public String mobilePhone() { @@ -672,7 +641,7 @@ public String mobilePhone() { /** * Set the mobilePhone property: The contact's mobile phone number. - * + * * @param mobilePhone the mobilePhone value to set. * @return the MicrosoftGraphContact object itself. */ @@ -683,7 +652,7 @@ public MicrosoftGraphContact withMobilePhone(String mobilePhone) { /** * Get the nickName property: The contact's nickname. - * + * * @return the nickName value. */ public String nickName() { @@ -692,7 +661,7 @@ public String nickName() { /** * Set the nickName property: The contact's nickname. - * + * * @param nickName the nickName value to set. * @return the MicrosoftGraphContact object itself. */ @@ -703,7 +672,7 @@ public MicrosoftGraphContact withNickName(String nickName) { /** * Get the officeLocation property: The location of the contact's office. - * + * * @return the officeLocation value. */ public String officeLocation() { @@ -712,7 +681,7 @@ public String officeLocation() { /** * Set the officeLocation property: The location of the contact's office. - * + * * @param officeLocation the officeLocation value to set. * @return the MicrosoftGraphContact object itself. */ @@ -723,7 +692,7 @@ public MicrosoftGraphContact withOfficeLocation(String officeLocation) { /** * Get the otherAddress property: physicalAddress. - * + * * @return the otherAddress value. */ public MicrosoftGraphPhysicalAddress otherAddress() { @@ -732,7 +701,7 @@ public MicrosoftGraphPhysicalAddress otherAddress() { /** * Set the otherAddress property: physicalAddress. - * + * * @param otherAddress the otherAddress value to set. * @return the MicrosoftGraphContact object itself. */ @@ -743,7 +712,7 @@ public MicrosoftGraphContact withOtherAddress(MicrosoftGraphPhysicalAddress othe /** * Get the parentFolderId property: The ID of the contact's parent folder. - * + * * @return the parentFolderId value. */ public String parentFolderId() { @@ -752,7 +721,7 @@ public String parentFolderId() { /** * Set the parentFolderId property: The ID of the contact's parent folder. - * + * * @param parentFolderId the parentFolderId value to set. * @return the MicrosoftGraphContact object itself. */ @@ -763,7 +732,7 @@ public MicrosoftGraphContact withParentFolderId(String parentFolderId) { /** * Get the personalNotes property: The user's notes about the contact. - * + * * @return the personalNotes value. */ public String personalNotes() { @@ -772,7 +741,7 @@ public String personalNotes() { /** * Set the personalNotes property: The user's notes about the contact. - * + * * @param personalNotes the personalNotes value to set. * @return the MicrosoftGraphContact object itself. */ @@ -783,7 +752,7 @@ public MicrosoftGraphContact withPersonalNotes(String personalNotes) { /** * Get the profession property: The contact's profession. - * + * * @return the profession value. */ public String profession() { @@ -792,7 +761,7 @@ public String profession() { /** * Set the profession property: The contact's profession. - * + * * @param profession the profession value to set. * @return the MicrosoftGraphContact object itself. */ @@ -803,7 +772,7 @@ public MicrosoftGraphContact withProfession(String profession) { /** * Get the spouseName property: The name of the contact's spouse/partner. - * + * * @return the spouseName value. */ public String spouseName() { @@ -812,7 +781,7 @@ public String spouseName() { /** * Set the spouseName property: The name of the contact's spouse/partner. - * + * * @param spouseName the spouseName value to set. * @return the MicrosoftGraphContact object itself. */ @@ -823,7 +792,7 @@ public MicrosoftGraphContact withSpouseName(String spouseName) { /** * Get the surname property: The contact's surname. - * + * * @return the surname value. */ public String surname() { @@ -832,7 +801,7 @@ public String surname() { /** * Set the surname property: The contact's surname. - * + * * @param surname the surname value to set. * @return the MicrosoftGraphContact object itself. */ @@ -843,7 +812,7 @@ public MicrosoftGraphContact withSurname(String surname) { /** * Get the title property: The contact's title. - * + * * @return the title value. */ public String title() { @@ -852,7 +821,7 @@ public String title() { /** * Set the title property: The contact's title. - * + * * @param title the title value to set. * @return the MicrosoftGraphContact object itself. */ @@ -863,7 +832,7 @@ public MicrosoftGraphContact withTitle(String title) { /** * Get the yomiCompanyName property: The phonetic Japanese company name of the contact. - * + * * @return the yomiCompanyName value. */ public String yomiCompanyName() { @@ -872,7 +841,7 @@ public String yomiCompanyName() { /** * Set the yomiCompanyName property: The phonetic Japanese company name of the contact. - * + * * @param yomiCompanyName the yomiCompanyName value to set. * @return the MicrosoftGraphContact object itself. */ @@ -883,7 +852,7 @@ public MicrosoftGraphContact withYomiCompanyName(String yomiCompanyName) { /** * Get the yomiGivenName property: The phonetic Japanese given name (first name) of the contact. - * + * * @return the yomiGivenName value. */ public String yomiGivenName() { @@ -892,7 +861,7 @@ public String yomiGivenName() { /** * Set the yomiGivenName property: The phonetic Japanese given name (first name) of the contact. - * + * * @param yomiGivenName the yomiGivenName value to set. * @return the MicrosoftGraphContact object itself. */ @@ -903,7 +872,7 @@ public MicrosoftGraphContact withYomiGivenName(String yomiGivenName) { /** * Get the yomiSurname property: The phonetic Japanese surname (last name) of the contact. - * + * * @return the yomiSurname value. */ public String yomiSurname() { @@ -912,7 +881,7 @@ public String yomiSurname() { /** * Set the yomiSurname property: The phonetic Japanese surname (last name) of the contact. - * + * * @param yomiSurname the yomiSurname value to set. * @return the MicrosoftGraphContact object itself. */ @@ -923,7 +892,7 @@ public MicrosoftGraphContact withYomiSurname(String yomiSurname) { /** * Get the extensions property: The collection of open extensions defined for the contact. Read-only. Nullable. - * + * * @return the extensions value. */ public List extensions() { @@ -932,7 +901,7 @@ public List extensions() { /** * Set the extensions property: The collection of open extensions defined for the contact. Read-only. Nullable. - * + * * @param extensions the extensions value to set. * @return the MicrosoftGraphContact object itself. */ @@ -944,7 +913,7 @@ public MicrosoftGraphContact withExtensions(List extens /** * Get the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * contact. Read-only. Nullable. - * + * * @return the multiValueExtendedProperties value. */ public List multiValueExtendedProperties() { @@ -954,7 +923,7 @@ public List multiValueExtendedPr /** * Set the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * contact. Read-only. Nullable. - * + * * @param multiValueExtendedProperties the multiValueExtendedProperties value to set. * @return the MicrosoftGraphContact object itself. */ @@ -966,7 +935,7 @@ public MicrosoftGraphContact withMultiValueExtendedProperties( /** * Get the photo property: profilePhoto. - * + * * @return the photo value. */ public MicrosoftGraphProfilePhoto photo() { @@ -975,7 +944,7 @@ public MicrosoftGraphProfilePhoto photo() { /** * Set the photo property: profilePhoto. - * + * * @param photo the photo value to set. * @return the MicrosoftGraphContact object itself. */ @@ -987,7 +956,7 @@ public MicrosoftGraphContact withPhoto(MicrosoftGraphProfilePhoto photo) { /** * Get the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the contact. Read-only. Nullable. - * + * * @return the singleValueExtendedProperties value. */ public List singleValueExtendedProperties() { @@ -997,7 +966,7 @@ public List singleValueExtended /** * Set the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the contact. Read-only. Nullable. - * + * * @param singleValueExtendedProperties the singleValueExtendedProperties value to set. * @return the MicrosoftGraphContact object itself. */ @@ -1009,17 +978,16 @@ public MicrosoftGraphContact withSingleValueExtendedProperties( /** * Get the additionalProperties property: contact. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: contact. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphContact object itself. */ @@ -1028,43 +996,45 @@ public MicrosoftGraphContact withAdditionalProperties(Map additi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphContact withCategories(List categories) { super.withCategories(categories); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphContact withChangeKey(String changeKey) { super.withChangeKey(changeKey); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphContact withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphContact withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphContact withId(String id) { super.withId(id); @@ -1073,7 +1043,7 @@ public MicrosoftGraphContact withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -1104,4 +1074,199 @@ public void validate() { singleValueExtendedProperties().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("categories", categories(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("changeKey", changeKey()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeStringField("assistantName", this.assistantName); + jsonWriter.writeStringField("birthday", + this.birthday == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.birthday)); + jsonWriter.writeJsonField("businessAddress", this.businessAddress); + jsonWriter.writeStringField("businessHomePage", this.businessHomePage); + jsonWriter.writeArrayField("businessPhones", this.businessPhones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("children", this.children, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("companyName", this.companyName); + jsonWriter.writeStringField("department", this.department); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeArrayField("emailAddresses", this.emailAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("fileAs", this.fileAs); + jsonWriter.writeStringField("generation", this.generation); + jsonWriter.writeStringField("givenName", this.givenName); + jsonWriter.writeJsonField("homeAddress", this.homeAddress); + jsonWriter.writeArrayField("homePhones", this.homePhones, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("imAddresses", this.imAddresses, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("initials", this.initials); + jsonWriter.writeStringField("jobTitle", this.jobTitle); + jsonWriter.writeStringField("manager", this.manager); + jsonWriter.writeStringField("middleName", this.middleName); + jsonWriter.writeStringField("mobilePhone", this.mobilePhone); + jsonWriter.writeStringField("nickName", this.nickName); + jsonWriter.writeStringField("officeLocation", this.officeLocation); + jsonWriter.writeJsonField("otherAddress", this.otherAddress); + jsonWriter.writeStringField("parentFolderId", this.parentFolderId); + jsonWriter.writeStringField("personalNotes", this.personalNotes); + jsonWriter.writeStringField("profession", this.profession); + jsonWriter.writeStringField("spouseName", this.spouseName); + jsonWriter.writeStringField("surname", this.surname); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("yomiCompanyName", this.yomiCompanyName); + jsonWriter.writeStringField("yomiGivenName", this.yomiGivenName); + jsonWriter.writeStringField("yomiSurname", this.yomiSurname); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("multiValueExtendedProperties", this.multiValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("photo", this.photo); + jsonWriter.writeArrayField("singleValueExtendedProperties", this.singleValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphContact from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphContact 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 MicrosoftGraphContact. + */ + public static MicrosoftGraphContact fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphContact deserializedMicrosoftGraphContact = new MicrosoftGraphContact(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphContact.withId(reader.getString()); + } else if ("categories".equals(fieldName)) { + List categories = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphContact.withCategories(categories); + } else if ("changeKey".equals(fieldName)) { + deserializedMicrosoftGraphContact.withChangeKey(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphContact.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphContact.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("assistantName".equals(fieldName)) { + deserializedMicrosoftGraphContact.assistantName = reader.getString(); + } else if ("birthday".equals(fieldName)) { + deserializedMicrosoftGraphContact.birthday = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("businessAddress".equals(fieldName)) { + deserializedMicrosoftGraphContact.businessAddress = MicrosoftGraphPhysicalAddress.fromJson(reader); + } else if ("businessHomePage".equals(fieldName)) { + deserializedMicrosoftGraphContact.businessHomePage = reader.getString(); + } else if ("businessPhones".equals(fieldName)) { + List businessPhones = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphContact.businessPhones = businessPhones; + } else if ("children".equals(fieldName)) { + List children = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphContact.children = children; + } else if ("companyName".equals(fieldName)) { + deserializedMicrosoftGraphContact.companyName = reader.getString(); + } else if ("department".equals(fieldName)) { + deserializedMicrosoftGraphContact.department = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphContact.displayName = reader.getString(); + } else if ("emailAddresses".equals(fieldName)) { + List emailAddresses + = reader.readArray(reader1 -> MicrosoftGraphEmailAddress.fromJson(reader1)); + deserializedMicrosoftGraphContact.emailAddresses = emailAddresses; + } else if ("fileAs".equals(fieldName)) { + deserializedMicrosoftGraphContact.fileAs = reader.getString(); + } else if ("generation".equals(fieldName)) { + deserializedMicrosoftGraphContact.generation = reader.getString(); + } else if ("givenName".equals(fieldName)) { + deserializedMicrosoftGraphContact.givenName = reader.getString(); + } else if ("homeAddress".equals(fieldName)) { + deserializedMicrosoftGraphContact.homeAddress = MicrosoftGraphPhysicalAddress.fromJson(reader); + } else if ("homePhones".equals(fieldName)) { + List homePhones = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphContact.homePhones = homePhones; + } else if ("imAddresses".equals(fieldName)) { + List imAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphContact.imAddresses = imAddresses; + } else if ("initials".equals(fieldName)) { + deserializedMicrosoftGraphContact.initials = reader.getString(); + } else if ("jobTitle".equals(fieldName)) { + deserializedMicrosoftGraphContact.jobTitle = reader.getString(); + } else if ("manager".equals(fieldName)) { + deserializedMicrosoftGraphContact.manager = reader.getString(); + } else if ("middleName".equals(fieldName)) { + deserializedMicrosoftGraphContact.middleName = reader.getString(); + } else if ("mobilePhone".equals(fieldName)) { + deserializedMicrosoftGraphContact.mobilePhone = reader.getString(); + } else if ("nickName".equals(fieldName)) { + deserializedMicrosoftGraphContact.nickName = reader.getString(); + } else if ("officeLocation".equals(fieldName)) { + deserializedMicrosoftGraphContact.officeLocation = reader.getString(); + } else if ("otherAddress".equals(fieldName)) { + deserializedMicrosoftGraphContact.otherAddress = MicrosoftGraphPhysicalAddress.fromJson(reader); + } else if ("parentFolderId".equals(fieldName)) { + deserializedMicrosoftGraphContact.parentFolderId = reader.getString(); + } else if ("personalNotes".equals(fieldName)) { + deserializedMicrosoftGraphContact.personalNotes = reader.getString(); + } else if ("profession".equals(fieldName)) { + deserializedMicrosoftGraphContact.profession = reader.getString(); + } else if ("spouseName".equals(fieldName)) { + deserializedMicrosoftGraphContact.spouseName = reader.getString(); + } else if ("surname".equals(fieldName)) { + deserializedMicrosoftGraphContact.surname = reader.getString(); + } else if ("title".equals(fieldName)) { + deserializedMicrosoftGraphContact.title = reader.getString(); + } else if ("yomiCompanyName".equals(fieldName)) { + deserializedMicrosoftGraphContact.yomiCompanyName = reader.getString(); + } else if ("yomiGivenName".equals(fieldName)) { + deserializedMicrosoftGraphContact.yomiGivenName = reader.getString(); + } else if ("yomiSurname".equals(fieldName)) { + deserializedMicrosoftGraphContact.yomiSurname = reader.getString(); + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> MicrosoftGraphExtension.fromJson(reader1)); + deserializedMicrosoftGraphContact.extensions = extensions; + } else if ("multiValueExtendedProperties".equals(fieldName)) { + List multiValueExtendedProperties + = reader.readArray(reader1 -> MicrosoftGraphMultiValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphContact.multiValueExtendedProperties = multiValueExtendedProperties; + } else if ("photo".equals(fieldName)) { + deserializedMicrosoftGraphContact.photo = MicrosoftGraphProfilePhoto.fromJson(reader); + } else if ("singleValueExtendedProperties".equals(fieldName)) { + List singleValueExtendedProperties = reader + .readArray(reader1 -> MicrosoftGraphSingleValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphContact.singleValueExtendedProperties = singleValueExtendedProperties; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphContact.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphContact; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContactFolder.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContactFolder.java index aec4f5c89610b..c32700326e97f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContactFolder.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContactFolder.java @@ -5,65 +5,63 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** contactFolder. */ +/** + * contactFolder. + */ @Fluent public final class MicrosoftGraphContactFolder extends MicrosoftGraphEntity { /* * The folder's display name. */ - @JsonProperty(value = "displayName") private String displayName; /* * The ID of the folder's parent folder. */ - @JsonProperty(value = "parentFolderId") private String parentFolderId; /* * The collection of child folders in the folder. Navigation property. Read-only. Nullable. */ - @JsonProperty(value = "childFolders") private List childFolders; /* * The contacts in the folder. Navigation property. Read-only. Nullable. */ - @JsonProperty(value = "contacts") private List contacts; /* * The collection of multi-value extended properties defined for the contactFolder. Read-only. Nullable. */ - @JsonProperty(value = "multiValueExtendedProperties") private List multiValueExtendedProperties; /* * The collection of single-value extended properties defined for the contactFolder. Read-only. Nullable. */ - @JsonProperty(value = "singleValueExtendedProperties") private List singleValueExtendedProperties; /* * contactFolder */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphContactFolder class. */ + /** + * Creates an instance of MicrosoftGraphContactFolder class. + */ public MicrosoftGraphContactFolder() { } /** * Get the displayName property: The folder's display name. - * + * * @return the displayName value. */ public String displayName() { @@ -72,7 +70,7 @@ public String displayName() { /** * Set the displayName property: The folder's display name. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphContactFolder object itself. */ @@ -83,7 +81,7 @@ public MicrosoftGraphContactFolder withDisplayName(String displayName) { /** * Get the parentFolderId property: The ID of the folder's parent folder. - * + * * @return the parentFolderId value. */ public String parentFolderId() { @@ -92,7 +90,7 @@ public String parentFolderId() { /** * Set the parentFolderId property: The ID of the folder's parent folder. - * + * * @param parentFolderId the parentFolderId value to set. * @return the MicrosoftGraphContactFolder object itself. */ @@ -104,7 +102,7 @@ public MicrosoftGraphContactFolder withParentFolderId(String parentFolderId) { /** * Get the childFolders property: The collection of child folders in the folder. Navigation property. Read-only. * Nullable. - * + * * @return the childFolders value. */ public List childFolders() { @@ -114,7 +112,7 @@ public List childFolders() { /** * Set the childFolders property: The collection of child folders in the folder. Navigation property. Read-only. * Nullable. - * + * * @param childFolders the childFolders value to set. * @return the MicrosoftGraphContactFolder object itself. */ @@ -125,7 +123,7 @@ public MicrosoftGraphContactFolder withChildFolders(List contacts() { @@ -134,7 +132,7 @@ public List contacts() { /** * Set the contacts property: The contacts in the folder. Navigation property. Read-only. Nullable. - * + * * @param contacts the contacts value to set. * @return the MicrosoftGraphContactFolder object itself. */ @@ -146,7 +144,7 @@ public MicrosoftGraphContactFolder withContacts(List cont /** * Get the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * contactFolder. Read-only. Nullable. - * + * * @return the multiValueExtendedProperties value. */ public List multiValueExtendedProperties() { @@ -156,7 +154,7 @@ public List multiValueExtendedPr /** * Set the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * contactFolder. Read-only. Nullable. - * + * * @param multiValueExtendedProperties the multiValueExtendedProperties value to set. * @return the MicrosoftGraphContactFolder object itself. */ @@ -169,7 +167,7 @@ public MicrosoftGraphContactFolder withMultiValueExtendedProperties( /** * Get the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the contactFolder. Read-only. Nullable. - * + * * @return the singleValueExtendedProperties value. */ public List singleValueExtendedProperties() { @@ -179,7 +177,7 @@ public List singleValueExtended /** * Set the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the contactFolder. Read-only. Nullable. - * + * * @param singleValueExtendedProperties the singleValueExtendedProperties value to set. * @return the MicrosoftGraphContactFolder object itself. */ @@ -191,17 +189,16 @@ public MicrosoftGraphContactFolder withSingleValueExtendedProperties( /** * Get the additionalProperties property: contactFolder. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: contactFolder. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphContactFolder object itself. */ @@ -210,15 +207,9 @@ public MicrosoftGraphContactFolder withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphContactFolder withId(String id) { super.withId(id); @@ -227,7 +218,7 @@ public MicrosoftGraphContactFolder withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -246,4 +237,80 @@ public void validate() { singleValueExtendedProperties().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("parentFolderId", this.parentFolderId); + jsonWriter.writeArrayField("childFolders", this.childFolders, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("contacts", this.contacts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("multiValueExtendedProperties", this.multiValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("singleValueExtendedProperties", this.singleValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphContactFolder from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphContactFolder 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 MicrosoftGraphContactFolder. + */ + public static MicrosoftGraphContactFolder fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphContactFolder deserializedMicrosoftGraphContactFolder = new MicrosoftGraphContactFolder(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphContactFolder.withId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphContactFolder.displayName = reader.getString(); + } else if ("parentFolderId".equals(fieldName)) { + deserializedMicrosoftGraphContactFolder.parentFolderId = reader.getString(); + } else if ("childFolders".equals(fieldName)) { + List childFolders + = reader.readArray(reader1 -> MicrosoftGraphContactFolder.fromJson(reader1)); + deserializedMicrosoftGraphContactFolder.childFolders = childFolders; + } else if ("contacts".equals(fieldName)) { + List contacts + = reader.readArray(reader1 -> MicrosoftGraphContact.fromJson(reader1)); + deserializedMicrosoftGraphContactFolder.contacts = contacts; + } else if ("multiValueExtendedProperties".equals(fieldName)) { + List multiValueExtendedProperties + = reader.readArray(reader1 -> MicrosoftGraphMultiValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphContactFolder.multiValueExtendedProperties = multiValueExtendedProperties; + } else if ("singleValueExtendedProperties".equals(fieldName)) { + List singleValueExtendedProperties = reader + .readArray(reader1 -> MicrosoftGraphSingleValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphContactFolder.singleValueExtendedProperties + = singleValueExtendedProperties; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphContactFolder.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphContactFolder; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentType.java index bb28b403ac18f..ec973a06fd46e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentType.java @@ -5,90 +5,84 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** contentType. */ +/** + * contentType. + */ @Fluent public final class MicrosoftGraphContentType extends MicrosoftGraphEntity { /* * The descriptive text for the item. */ - @JsonProperty(value = "description") private String description; /* * The name of the group this content type belongs to. Helps organize related content types. */ - @JsonProperty(value = "group") private String group; /* * Indicates whether the content type is hidden in the list's 'New' menu. */ - @JsonProperty(value = "hidden") private Boolean hidden; /* * itemReference */ - @JsonProperty(value = "inheritedFrom") private MicrosoftGraphItemReference inheritedFrom; /* * The name of the content type. */ - @JsonProperty(value = "name") private String name; /* * contentTypeOrder */ - @JsonProperty(value = "order") private MicrosoftGraphContentTypeOrder order; /* * The unique identifier of the content type. */ - @JsonProperty(value = "parentId") private String parentId; /* * If true, the content type cannot be modified unless this value is first set to false. */ - @JsonProperty(value = "readOnly") private Boolean readOnly; /* * If true, the content type cannot be modified by users or through push-down operations. Only site collection * administrators can seal or unseal content types. */ - @JsonProperty(value = "sealed") private Boolean sealed; /* * The collection of columns that are required by this content type */ - @JsonProperty(value = "columnLinks") private List columnLinks; /* * contentType */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphContentType class. */ + /** + * Creates an instance of MicrosoftGraphContentType class. + */ public MicrosoftGraphContentType() { } /** * Get the description property: The descriptive text for the item. - * + * * @return the description value. */ public String description() { @@ -97,7 +91,7 @@ public String description() { /** * Set the description property: The descriptive text for the item. - * + * * @param description the description value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -108,7 +102,7 @@ public MicrosoftGraphContentType withDescription(String description) { /** * Get the group property: The name of the group this content type belongs to. Helps organize related content types. - * + * * @return the group value. */ public String group() { @@ -117,7 +111,7 @@ public String group() { /** * Set the group property: The name of the group this content type belongs to. Helps organize related content types. - * + * * @param group the group value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -128,7 +122,7 @@ public MicrosoftGraphContentType withGroup(String group) { /** * Get the hidden property: Indicates whether the content type is hidden in the list's 'New' menu. - * + * * @return the hidden value. */ public Boolean hidden() { @@ -137,7 +131,7 @@ public Boolean hidden() { /** * Set the hidden property: Indicates whether the content type is hidden in the list's 'New' menu. - * + * * @param hidden the hidden value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -148,7 +142,7 @@ public MicrosoftGraphContentType withHidden(Boolean hidden) { /** * Get the inheritedFrom property: itemReference. - * + * * @return the inheritedFrom value. */ public MicrosoftGraphItemReference inheritedFrom() { @@ -157,7 +151,7 @@ public MicrosoftGraphItemReference inheritedFrom() { /** * Set the inheritedFrom property: itemReference. - * + * * @param inheritedFrom the inheritedFrom value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -168,7 +162,7 @@ public MicrosoftGraphContentType withInheritedFrom(MicrosoftGraphItemReference i /** * Get the name property: The name of the content type. - * + * * @return the name value. */ public String name() { @@ -177,7 +171,7 @@ public String name() { /** * Set the name property: The name of the content type. - * + * * @param name the name value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -188,7 +182,7 @@ public MicrosoftGraphContentType withName(String name) { /** * Get the order property: contentTypeOrder. - * + * * @return the order value. */ public MicrosoftGraphContentTypeOrder order() { @@ -197,7 +191,7 @@ public MicrosoftGraphContentTypeOrder order() { /** * Set the order property: contentTypeOrder. - * + * * @param order the order value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -208,7 +202,7 @@ public MicrosoftGraphContentType withOrder(MicrosoftGraphContentTypeOrder order) /** * Get the parentId property: The unique identifier of the content type. - * + * * @return the parentId value. */ public String parentId() { @@ -217,7 +211,7 @@ public String parentId() { /** * Set the parentId property: The unique identifier of the content type. - * + * * @param parentId the parentId value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -228,7 +222,7 @@ public MicrosoftGraphContentType withParentId(String parentId) { /** * Get the readOnly property: If true, the content type cannot be modified unless this value is first set to false. - * + * * @return the readOnly value. */ public Boolean readOnly() { @@ -237,7 +231,7 @@ public Boolean readOnly() { /** * Set the readOnly property: If true, the content type cannot be modified unless this value is first set to false. - * + * * @param readOnly the readOnly value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -249,7 +243,7 @@ public MicrosoftGraphContentType withReadOnly(Boolean readOnly) { /** * Get the sealed property: If true, the content type cannot be modified by users or through push-down operations. * Only site collection administrators can seal or unseal content types. - * + * * @return the sealed value. */ public Boolean sealed() { @@ -259,7 +253,7 @@ public Boolean sealed() { /** * Set the sealed property: If true, the content type cannot be modified by users or through push-down operations. * Only site collection administrators can seal or unseal content types. - * + * * @param sealed the sealed value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -270,7 +264,7 @@ public MicrosoftGraphContentType withSealed(Boolean sealed) { /** * Get the columnLinks property: The collection of columns that are required by this content type. - * + * * @return the columnLinks value. */ public List columnLinks() { @@ -279,7 +273,7 @@ public List columnLinks() { /** * Set the columnLinks property: The collection of columns that are required by this content type. - * + * * @param columnLinks the columnLinks value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -290,17 +284,16 @@ public MicrosoftGraphContentType withColumnLinks(List /** * Get the additionalProperties property: contentType. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: contentType. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphContentType object itself. */ @@ -309,15 +302,9 @@ public MicrosoftGraphContentType withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphContentType withId(String id) { super.withId(id); @@ -326,7 +313,7 @@ public MicrosoftGraphContentType withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -342,4 +329,83 @@ public void validate() { columnLinks().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("group", this.group); + jsonWriter.writeBooleanField("hidden", this.hidden); + jsonWriter.writeJsonField("inheritedFrom", this.inheritedFrom); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("order", this.order); + jsonWriter.writeStringField("parentId", this.parentId); + jsonWriter.writeBooleanField("readOnly", this.readOnly); + jsonWriter.writeBooleanField("sealed", this.sealed); + jsonWriter.writeArrayField("columnLinks", this.columnLinks, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphContentType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphContentType 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 MicrosoftGraphContentType. + */ + public static MicrosoftGraphContentType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphContentType deserializedMicrosoftGraphContentType = new MicrosoftGraphContentType(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphContentType.withId(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphContentType.description = reader.getString(); + } else if ("group".equals(fieldName)) { + deserializedMicrosoftGraphContentType.group = reader.getString(); + } else if ("hidden".equals(fieldName)) { + deserializedMicrosoftGraphContentType.hidden = reader.getNullable(JsonReader::getBoolean); + } else if ("inheritedFrom".equals(fieldName)) { + deserializedMicrosoftGraphContentType.inheritedFrom = MicrosoftGraphItemReference.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphContentType.name = reader.getString(); + } else if ("order".equals(fieldName)) { + deserializedMicrosoftGraphContentType.order = MicrosoftGraphContentTypeOrder.fromJson(reader); + } else if ("parentId".equals(fieldName)) { + deserializedMicrosoftGraphContentType.parentId = reader.getString(); + } else if ("readOnly".equals(fieldName)) { + deserializedMicrosoftGraphContentType.readOnly = reader.getNullable(JsonReader::getBoolean); + } else if ("sealed".equals(fieldName)) { + deserializedMicrosoftGraphContentType.sealed = reader.getNullable(JsonReader::getBoolean); + } else if ("columnLinks".equals(fieldName)) { + List columnLinks + = reader.readArray(reader1 -> MicrosoftGraphColumnLink.fromJson(reader1)); + deserializedMicrosoftGraphContentType.columnLinks = columnLinks; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphContentType.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphContentType; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentTypeInfo.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentTypeInfo.java index 6e2c960d8024b..1841bd26089fc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentTypeInfo.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentTypeInfo.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** contentTypeInfo. */ +/** + * contentTypeInfo. + */ @Fluent -public final class MicrosoftGraphContentTypeInfo { +public final class MicrosoftGraphContentTypeInfo implements JsonSerializable { /* * The id of the content type. */ - @JsonProperty(value = "id") private String id; /* * The name of the content type. */ - @JsonProperty(value = "name") private String name; /* * contentTypeInfo */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphContentTypeInfo class. */ + /** + * Creates an instance of MicrosoftGraphContentTypeInfo class. + */ public MicrosoftGraphContentTypeInfo() { } /** * Get the id property: The id of the content type. - * + * * @return the id value. */ public String id() { @@ -47,7 +50,7 @@ public String id() { /** * Set the id property: The id of the content type. - * + * * @param id the id value to set. * @return the MicrosoftGraphContentTypeInfo object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphContentTypeInfo withId(String id) { /** * Get the name property: The name of the content type. - * + * * @return the name value. */ public String name() { @@ -67,7 +70,7 @@ public String name() { /** * Set the name property: The name of the content type. - * + * * @param name the name value to set. * @return the MicrosoftGraphContentTypeInfo object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphContentTypeInfo withName(String name) { /** * Get the additionalProperties property: contentTypeInfo. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: contentTypeInfo. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphContentTypeInfo object itself. */ @@ -97,19 +99,62 @@ public MicrosoftGraphContentTypeInfo withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphContentTypeInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphContentTypeInfo 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 MicrosoftGraphContentTypeInfo. + */ + public static MicrosoftGraphContentTypeInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphContentTypeInfo deserializedMicrosoftGraphContentTypeInfo + = new MicrosoftGraphContentTypeInfo(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphContentTypeInfo.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphContentTypeInfo.name = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphContentTypeInfo.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphContentTypeInfo; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentTypeOrder.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentTypeOrder.java index e6282c9b8abff..3b222c0e76fa1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentTypeOrder.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContentTypeOrder.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** contentTypeOrder. */ +/** + * contentTypeOrder. + */ @Fluent -public final class MicrosoftGraphContentTypeOrder { +public final class MicrosoftGraphContentTypeOrder implements JsonSerializable { /* * Whether this is the default Content Type */ - @JsonProperty(value = "default") private Boolean defaultProperty; /* * Specifies the position in which the Content Type appears in the selection UI. */ - @JsonProperty(value = "position") private Integer position; /* * contentTypeOrder */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphContentTypeOrder class. */ + /** + * Creates an instance of MicrosoftGraphContentTypeOrder class. + */ public MicrosoftGraphContentTypeOrder() { } /** * Get the defaultProperty property: Whether this is the default Content Type. - * + * * @return the defaultProperty value. */ public Boolean defaultProperty() { @@ -47,7 +50,7 @@ public Boolean defaultProperty() { /** * Set the defaultProperty property: Whether this is the default Content Type. - * + * * @param defaultProperty the defaultProperty value to set. * @return the MicrosoftGraphContentTypeOrder object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphContentTypeOrder withDefaultProperty(Boolean defaultPropert /** * Get the position property: Specifies the position in which the Content Type appears in the selection UI. - * + * * @return the position value. */ public Integer position() { @@ -67,7 +70,7 @@ public Integer position() { /** * Set the position property: Specifies the position in which the Content Type appears in the selection UI. - * + * * @param position the position value to set. * @return the MicrosoftGraphContentTypeOrder object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphContentTypeOrder withPosition(Integer position) { /** * Get the additionalProperties property: contentTypeOrder. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: contentTypeOrder. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphContentTypeOrder object itself. */ @@ -97,19 +99,63 @@ public MicrosoftGraphContentTypeOrder withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("default", this.defaultProperty); + jsonWriter.writeNumberField("position", this.position); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphContentTypeOrder from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphContentTypeOrder 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 MicrosoftGraphContentTypeOrder. + */ + public static MicrosoftGraphContentTypeOrder fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphContentTypeOrder deserializedMicrosoftGraphContentTypeOrder + = new MicrosoftGraphContentTypeOrder(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("default".equals(fieldName)) { + deserializedMicrosoftGraphContentTypeOrder.defaultProperty + = reader.getNullable(JsonReader::getBoolean); + } else if ("position".equals(fieldName)) { + deserializedMicrosoftGraphContentTypeOrder.position = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphContentTypeOrder.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphContentTypeOrder; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContract.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContract.java index 264b91c84f96c..3d10300714cec 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContract.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphContract.java @@ -5,19 +5,22 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.UUID; /** * contract - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -26,41 +29,39 @@ public final class MicrosoftGraphContract extends MicrosoftGraphDirectoryObjectI * Type of contract.Possible values are: SyndicationPartner - Partner that exclusively resells and manages O365 and * Intune for this customer. They resell and support their customers. BreadthPartner - Partner has the ability to * provide administrative support for this customer. However, the partner is not allowed to resell to the - * customer.ResellerPartner - Partner that is similar to a syndication partner, except that the partner doesn’t - * have exclusive access to a tenant. In the syndication case, the customer cannot buy additional direct - * subscriptions from Microsoft or from other partners. + * customer.ResellerPartner - Partner that is similar to a syndication partner, except that the partner doesn’t have + * exclusive access to a tenant. In the syndication case, the customer cannot buy additional direct subscriptions + * from Microsoft or from other partners. */ - @JsonProperty(value = "contractType") private String contractType; /* * The unique identifier for the customer tenant referenced by this partnership. Corresponds to the id property of * the customer tenant's organization resource. */ - @JsonProperty(value = "customerId") private UUID customerId; /* * A copy of the customer tenant's default domain name. The copy is made when the partnership with the customer is * established. It is not automatically updated if the customer tenant's default domain name changes. */ - @JsonProperty(value = "defaultDomainName") private String defaultDomainName; /* * A copy of the customer tenant's display name. The copy is made when the partnership with the customer is * established. It is not automatically updated if the customer tenant's display name changes. */ - @JsonProperty(value = "displayName") private String displayName; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphContract class. */ + /** + * Creates an instance of MicrosoftGraphContract class. + */ public MicrosoftGraphContract() { } @@ -71,7 +72,7 @@ public MicrosoftGraphContract() { * partner is not allowed to resell to the customer.ResellerPartner - Partner that is similar to a syndication * partner, except that the partner doesn’t have exclusive access to a tenant. In the syndication case, the customer * cannot buy additional direct subscriptions from Microsoft or from other partners. - * + * * @return the contractType value. */ public String contractType() { @@ -85,7 +86,7 @@ public String contractType() { * partner is not allowed to resell to the customer.ResellerPartner - Partner that is similar to a syndication * partner, except that the partner doesn’t have exclusive access to a tenant. In the syndication case, the customer * cannot buy additional direct subscriptions from Microsoft or from other partners. - * + * * @param contractType the contractType value to set. * @return the MicrosoftGraphContract object itself. */ @@ -97,7 +98,7 @@ public MicrosoftGraphContract withContractType(String contractType) { /** * Get the customerId property: The unique identifier for the customer tenant referenced by this partnership. * Corresponds to the id property of the customer tenant's organization resource. - * + * * @return the customerId value. */ public UUID customerId() { @@ -107,7 +108,7 @@ public UUID customerId() { /** * Set the customerId property: The unique identifier for the customer tenant referenced by this partnership. * Corresponds to the id property of the customer tenant's organization resource. - * + * * @param customerId the customerId value to set. * @return the MicrosoftGraphContract object itself. */ @@ -120,7 +121,7 @@ public MicrosoftGraphContract withCustomerId(UUID customerId) { * Get the defaultDomainName property: A copy of the customer tenant's default domain name. The copy is made when * the partnership with the customer is established. It is not automatically updated if the customer tenant's * default domain name changes. - * + * * @return the defaultDomainName value. */ public String defaultDomainName() { @@ -131,7 +132,7 @@ public String defaultDomainName() { * Set the defaultDomainName property: A copy of the customer tenant's default domain name. The copy is made when * the partnership with the customer is established. It is not automatically updated if the customer tenant's * default domain name changes. - * + * * @param defaultDomainName the defaultDomainName value to set. * @return the MicrosoftGraphContract object itself. */ @@ -143,7 +144,7 @@ public MicrosoftGraphContract withDefaultDomainName(String defaultDomainName) { /** * Get the displayName property: A copy of the customer tenant's display name. The copy is made when the partnership * with the customer is established. It is not automatically updated if the customer tenant's display name changes. - * + * * @return the displayName value. */ public String displayName() { @@ -153,7 +154,7 @@ public String displayName() { /** * Set the displayName property: A copy of the customer tenant's display name. The copy is made when the partnership * with the customer is established. It is not automatically updated if the customer tenant's display name changes. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphContract object itself. */ @@ -165,10 +166,9 @@ public MicrosoftGraphContract withDisplayName(String displayName) { /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -176,7 +176,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphContract object itself. */ @@ -185,22 +185,18 @@ public MicrosoftGraphContract withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphContract withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphContract withId(String id) { super.withId(id); @@ -209,11 +205,76 @@ public MicrosoftGraphContract withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("contractType", this.contractType); + jsonWriter.writeStringField("customerId", Objects.toString(this.customerId, null)); + jsonWriter.writeStringField("defaultDomainName", this.defaultDomainName); + jsonWriter.writeStringField("displayName", this.displayName); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphContract from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphContract 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 MicrosoftGraphContract. + */ + public static MicrosoftGraphContract fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphContract deserializedMicrosoftGraphContract = new MicrosoftGraphContract(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphContract.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphContract.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("contractType".equals(fieldName)) { + deserializedMicrosoftGraphContract.contractType = reader.getString(); + } else if ("customerId".equals(fieldName)) { + deserializedMicrosoftGraphContract.customerId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("defaultDomainName".equals(fieldName)) { + deserializedMicrosoftGraphContract.defaultDomainName = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphContract.displayName = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphContract.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphContract; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversation.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversation.java index 54a6422a69083..0d2c1db593633 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversation.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversation.java @@ -5,69 +5,69 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** conversation. */ +/** + * conversation. + */ @Fluent public final class MicrosoftGraphConversation extends MicrosoftGraphEntity { /* * Indicates whether any of the posts within this Conversation has at least one attachment. */ - @JsonProperty(value = "hasAttachments") private Boolean hasAttachments; /* * The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "lastDeliveredDateTime") private OffsetDateTime lastDeliveredDateTime; /* * A short summary from the body of the latest post in this converstaion. */ - @JsonProperty(value = "preview") private String preview; /* * The topic of the conversation. This property can be set when the conversation is created, but it cannot be * updated. */ - @JsonProperty(value = "topic") private String topic; /* * All the users that sent a message to this Conversation. */ - @JsonProperty(value = "uniqueSenders") private List uniqueSenders; /* * A collection of all the conversation threads in the conversation. A navigation property. Read-only. Nullable. */ - @JsonProperty(value = "threads") private List threads; /* * conversation */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphConversation class. */ + /** + * Creates an instance of MicrosoftGraphConversation class. + */ public MicrosoftGraphConversation() { } /** * Get the hasAttachments property: Indicates whether any of the posts within this Conversation has at least one * attachment. - * + * * @return the hasAttachments value. */ public Boolean hasAttachments() { @@ -77,7 +77,7 @@ public Boolean hasAttachments() { /** * Set the hasAttachments property: Indicates whether any of the posts within this Conversation has at least one * attachment. - * + * * @param hasAttachments the hasAttachments value to set. * @return the MicrosoftGraphConversation object itself. */ @@ -90,7 +90,7 @@ public MicrosoftGraphConversation withHasAttachments(Boolean hasAttachments) { * Get the lastDeliveredDateTime property: The Timestamp type represents date and time information using ISO 8601 * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @return the lastDeliveredDateTime value. */ public OffsetDateTime lastDeliveredDateTime() { @@ -101,7 +101,7 @@ public OffsetDateTime lastDeliveredDateTime() { * Set the lastDeliveredDateTime property: The Timestamp type represents date and time information using ISO 8601 * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @param lastDeliveredDateTime the lastDeliveredDateTime value to set. * @return the MicrosoftGraphConversation object itself. */ @@ -112,7 +112,7 @@ public MicrosoftGraphConversation withLastDeliveredDateTime(OffsetDateTime lastD /** * Get the preview property: A short summary from the body of the latest post in this converstaion. - * + * * @return the preview value. */ public String preview() { @@ -121,7 +121,7 @@ public String preview() { /** * Set the preview property: A short summary from the body of the latest post in this converstaion. - * + * * @param preview the preview value to set. * @return the MicrosoftGraphConversation object itself. */ @@ -133,7 +133,7 @@ public MicrosoftGraphConversation withPreview(String preview) { /** * Get the topic property: The topic of the conversation. This property can be set when the conversation is created, * but it cannot be updated. - * + * * @return the topic value. */ public String topic() { @@ -143,7 +143,7 @@ public String topic() { /** * Set the topic property: The topic of the conversation. This property can be set when the conversation is created, * but it cannot be updated. - * + * * @param topic the topic value to set. * @return the MicrosoftGraphConversation object itself. */ @@ -154,7 +154,7 @@ public MicrosoftGraphConversation withTopic(String topic) { /** * Get the uniqueSenders property: All the users that sent a message to this Conversation. - * + * * @return the uniqueSenders value. */ public List uniqueSenders() { @@ -163,7 +163,7 @@ public List uniqueSenders() { /** * Set the uniqueSenders property: All the users that sent a message to this Conversation. - * + * * @param uniqueSenders the uniqueSenders value to set. * @return the MicrosoftGraphConversation object itself. */ @@ -175,7 +175,7 @@ public MicrosoftGraphConversation withUniqueSenders(List uniqueSenders) /** * Get the threads property: A collection of all the conversation threads in the conversation. A navigation * property. Read-only. Nullable. - * + * * @return the threads value. */ public List threads() { @@ -185,7 +185,7 @@ public List threads() { /** * Set the threads property: A collection of all the conversation threads in the conversation. A navigation * property. Read-only. Nullable. - * + * * @param threads the threads value to set. * @return the MicrosoftGraphConversation object itself. */ @@ -196,17 +196,16 @@ public MicrosoftGraphConversation withThreads(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: conversation. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphConversation object itself. */ @@ -215,15 +214,9 @@ public MicrosoftGraphConversation withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphConversation withId(String id) { super.withId(id); @@ -232,7 +225,7 @@ public MicrosoftGraphConversation withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -242,4 +235,77 @@ public void validate() { threads().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeBooleanField("hasAttachments", this.hasAttachments); + jsonWriter.writeStringField("lastDeliveredDateTime", + this.lastDeliveredDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastDeliveredDateTime)); + jsonWriter.writeStringField("preview", this.preview); + jsonWriter.writeStringField("topic", this.topic); + jsonWriter.writeArrayField("uniqueSenders", this.uniqueSenders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("threads", this.threads, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphConversation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphConversation 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 MicrosoftGraphConversation. + */ + public static MicrosoftGraphConversation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphConversation deserializedMicrosoftGraphConversation = new MicrosoftGraphConversation(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphConversation.withId(reader.getString()); + } else if ("hasAttachments".equals(fieldName)) { + deserializedMicrosoftGraphConversation.hasAttachments = reader.getNullable(JsonReader::getBoolean); + } else if ("lastDeliveredDateTime".equals(fieldName)) { + deserializedMicrosoftGraphConversation.lastDeliveredDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("preview".equals(fieldName)) { + deserializedMicrosoftGraphConversation.preview = reader.getString(); + } else if ("topic".equals(fieldName)) { + deserializedMicrosoftGraphConversation.topic = reader.getString(); + } else if ("uniqueSenders".equals(fieldName)) { + List uniqueSenders = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphConversation.uniqueSenders = uniqueSenders; + } else if ("threads".equals(fieldName)) { + List threads + = reader.readArray(reader1 -> MicrosoftGraphConversationThread.fromJson(reader1)); + deserializedMicrosoftGraphConversation.threads = threads; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphConversation.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphConversation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversationMember.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversationMember.java index 89c7fdb590bc2..0e1debe36d75d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversationMember.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversationMember.java @@ -5,41 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** conversationMember. */ +/** + * conversationMember. + */ @Fluent public final class MicrosoftGraphConversationMember extends MicrosoftGraphEntity { /* * The display name of the user. */ - @JsonProperty(value = "displayName") private String displayName; /* * The roles for that user. */ - @JsonProperty(value = "roles") private List roles; /* * conversationMember */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphConversationMember class. */ + /** + * Creates an instance of MicrosoftGraphConversationMember class. + */ public MicrosoftGraphConversationMember() { } /** * Get the displayName property: The display name of the user. - * + * * @return the displayName value. */ public String displayName() { @@ -48,7 +50,7 @@ public String displayName() { /** * Set the displayName property: The display name of the user. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphConversationMember object itself. */ @@ -59,7 +61,7 @@ public MicrosoftGraphConversationMember withDisplayName(String displayName) { /** * Get the roles property: The roles for that user. - * + * * @return the roles value. */ public List roles() { @@ -68,7 +70,7 @@ public List roles() { /** * Set the roles property: The roles for that user. - * + * * @param roles the roles value to set. * @return the MicrosoftGraphConversationMember object itself. */ @@ -79,17 +81,16 @@ public MicrosoftGraphConversationMember withRoles(List roles) { /** * Get the additionalProperties property: conversationMember. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: conversationMember. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphConversationMember object itself. */ @@ -98,15 +99,9 @@ public MicrosoftGraphConversationMember withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphConversationMember withId(String id) { super.withId(id); @@ -115,11 +110,66 @@ public MicrosoftGraphConversationMember withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeString(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphConversationMember from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphConversationMember 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 MicrosoftGraphConversationMember. + */ + public static MicrosoftGraphConversationMember fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphConversationMember deserializedMicrosoftGraphConversationMember + = new MicrosoftGraphConversationMember(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphConversationMember.withId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphConversationMember.displayName = reader.getString(); + } else if ("roles".equals(fieldName)) { + List roles = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphConversationMember.roles = roles; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphConversationMember.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphConversationMember; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversationThread.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversationThread.java index 99331c6ae78fb..5bad3e5e47705 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversationThread.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphConversationThread.java @@ -5,86 +5,83 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** conversationThread. */ +/** + * conversationThread. + */ @Fluent public final class MicrosoftGraphConversationThread extends MicrosoftGraphEntity { /* * The Cc: recipients for the thread. */ - @JsonProperty(value = "ccRecipients") private List ccRecipients; /* * Indicates whether any of the posts within this thread has at least one attachment. */ - @JsonProperty(value = "hasAttachments") private Boolean hasAttachments; /* * Indicates if the thread is locked. */ - @JsonProperty(value = "isLocked") private Boolean isLocked; /* * The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "lastDeliveredDateTime") private OffsetDateTime lastDeliveredDateTime; /* * A short summary from the body of the latest post in this conversation. */ - @JsonProperty(value = "preview") private String preview; /* * The topic of the conversation. This property can be set when the conversation is created, but it cannot be * updated. */ - @JsonProperty(value = "topic") private String topic; /* * The To: recipients for the thread. */ - @JsonProperty(value = "toRecipients") private List toRecipients; /* * All the users that sent a message to this thread. */ - @JsonProperty(value = "uniqueSenders") private List uniqueSenders; /* * Read-only. Nullable. */ - @JsonProperty(value = "posts") private List posts; /* * conversationThread */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphConversationThread class. */ + /** + * Creates an instance of MicrosoftGraphConversationThread class. + */ public MicrosoftGraphConversationThread() { } /** * Get the ccRecipients property: The Cc: recipients for the thread. - * + * * @return the ccRecipients value. */ public List ccRecipients() { @@ -93,7 +90,7 @@ public List ccRecipients() { /** * Set the ccRecipients property: The Cc: recipients for the thread. - * + * * @param ccRecipients the ccRecipients value to set. * @return the MicrosoftGraphConversationThread object itself. */ @@ -105,7 +102,7 @@ public MicrosoftGraphConversationThread withCcRecipients(List toRecipients() { @@ -221,7 +218,7 @@ public List toRecipients() { /** * Set the toRecipients property: The To: recipients for the thread. - * + * * @param toRecipients the toRecipients value to set. * @return the MicrosoftGraphConversationThread object itself. */ @@ -232,7 +229,7 @@ public MicrosoftGraphConversationThread withToRecipients(List uniqueSenders() { @@ -241,7 +238,7 @@ public List uniqueSenders() { /** * Set the uniqueSenders property: All the users that sent a message to this thread. - * + * * @param uniqueSenders the uniqueSenders value to set. * @return the MicrosoftGraphConversationThread object itself. */ @@ -252,7 +249,7 @@ public MicrosoftGraphConversationThread withUniqueSenders(List uniqueSen /** * Get the posts property: Read-only. Nullable. - * + * * @return the posts value. */ public List posts() { @@ -261,7 +258,7 @@ public List posts() { /** * Set the posts property: Read-only. Nullable. - * + * * @param posts the posts value to set. * @return the MicrosoftGraphConversationThread object itself. */ @@ -272,17 +269,16 @@ public MicrosoftGraphConversationThread withPosts(List posts /** * Get the additionalProperties property: conversationThread. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: conversationThread. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphConversationThread object itself. */ @@ -291,15 +287,9 @@ public MicrosoftGraphConversationThread withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphConversationThread withId(String id) { super.withId(id); @@ -308,7 +298,7 @@ public MicrosoftGraphConversationThread withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -324,4 +314,91 @@ public void validate() { posts().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("ccRecipients", this.ccRecipients, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("hasAttachments", this.hasAttachments); + jsonWriter.writeBooleanField("isLocked", this.isLocked); + jsonWriter.writeStringField("lastDeliveredDateTime", + this.lastDeliveredDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastDeliveredDateTime)); + jsonWriter.writeStringField("preview", this.preview); + jsonWriter.writeStringField("topic", this.topic); + jsonWriter.writeArrayField("toRecipients", this.toRecipients, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("uniqueSenders", this.uniqueSenders, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("posts", this.posts, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphConversationThread from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphConversationThread 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 MicrosoftGraphConversationThread. + */ + public static MicrosoftGraphConversationThread fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphConversationThread deserializedMicrosoftGraphConversationThread + = new MicrosoftGraphConversationThread(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphConversationThread.withId(reader.getString()); + } else if ("ccRecipients".equals(fieldName)) { + List ccRecipients + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphConversationThread.ccRecipients = ccRecipients; + } else if ("hasAttachments".equals(fieldName)) { + deserializedMicrosoftGraphConversationThread.hasAttachments + = reader.getNullable(JsonReader::getBoolean); + } else if ("isLocked".equals(fieldName)) { + deserializedMicrosoftGraphConversationThread.isLocked = reader.getNullable(JsonReader::getBoolean); + } else if ("lastDeliveredDateTime".equals(fieldName)) { + deserializedMicrosoftGraphConversationThread.lastDeliveredDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("preview".equals(fieldName)) { + deserializedMicrosoftGraphConversationThread.preview = reader.getString(); + } else if ("topic".equals(fieldName)) { + deserializedMicrosoftGraphConversationThread.topic = reader.getString(); + } else if ("toRecipients".equals(fieldName)) { + List toRecipients + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphConversationThread.toRecipients = toRecipients; + } else if ("uniqueSenders".equals(fieldName)) { + List uniqueSenders = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphConversationThread.uniqueSenders = uniqueSenders; + } else if ("posts".equals(fieldName)) { + List posts = reader.readArray(reader1 -> MicrosoftGraphPost.fromJson(reader1)); + deserializedMicrosoftGraphConversationThread.posts = posts; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphConversationThread.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphConversationThread; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCopyNotebookModel.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCopyNotebookModel.java index 7e1c27066a113..9f6119ca6b599 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCopyNotebookModel.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCopyNotebookModel.java @@ -5,119 +5,111 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** CopyNotebookModel. */ +/** + * CopyNotebookModel. + */ @Fluent -public final class MicrosoftGraphCopyNotebookModel { +public final class MicrosoftGraphCopyNotebookModel implements JsonSerializable { /* * The createdBy property. */ - @JsonProperty(value = "createdBy") private String createdBy; /* * identitySet */ - @JsonProperty(value = "createdByIdentity") private MicrosoftGraphIdentitySet createdByIdentity; /* * The createdTime property. */ - @JsonProperty(value = "createdTime") private OffsetDateTime createdTime; /* * The id property. */ - @JsonProperty(value = "id") private String id; /* * The isDefault property. */ - @JsonProperty(value = "isDefault") private Boolean isDefault; /* * The isShared property. */ - @JsonProperty(value = "isShared") private Boolean isShared; /* * The lastModifiedBy property. */ - @JsonProperty(value = "lastModifiedBy") private String lastModifiedBy; /* * identitySet */ - @JsonProperty(value = "lastModifiedByIdentity") private MicrosoftGraphIdentitySet lastModifiedByIdentity; /* * The lastModifiedTime property. */ - @JsonProperty(value = "lastModifiedTime") private OffsetDateTime lastModifiedTime; /* * notebookLinks */ - @JsonProperty(value = "links") private MicrosoftGraphNotebookLinks links; /* * The name property. */ - @JsonProperty(value = "name") private String name; /* * The sectionGroupsUrl property. */ - @JsonProperty(value = "sectionGroupsUrl") private String sectionGroupsUrl; /* * The sectionsUrl property. */ - @JsonProperty(value = "sectionsUrl") private String sectionsUrl; /* * The self property. */ - @JsonProperty(value = "self") private String self; /* * onenoteUserRole */ - @JsonProperty(value = "userRole") private MicrosoftGraphOnenoteUserRole userRole; /* * CopyNotebookModel */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphCopyNotebookModel class. */ + /** + * Creates an instance of MicrosoftGraphCopyNotebookModel class. + */ public MicrosoftGraphCopyNotebookModel() { } /** * Get the createdBy property: The createdBy property. - * + * * @return the createdBy value. */ public String createdBy() { @@ -126,7 +118,7 @@ public String createdBy() { /** * Set the createdBy property: The createdBy property. - * + * * @param createdBy the createdBy value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -137,7 +129,7 @@ public MicrosoftGraphCopyNotebookModel withCreatedBy(String createdBy) { /** * Get the createdByIdentity property: identitySet. - * + * * @return the createdByIdentity value. */ public MicrosoftGraphIdentitySet createdByIdentity() { @@ -146,7 +138,7 @@ public MicrosoftGraphIdentitySet createdByIdentity() { /** * Set the createdByIdentity property: identitySet. - * + * * @param createdByIdentity the createdByIdentity value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -157,7 +149,7 @@ public MicrosoftGraphCopyNotebookModel withCreatedByIdentity(MicrosoftGraphIdent /** * Get the createdTime property: The createdTime property. - * + * * @return the createdTime value. */ public OffsetDateTime createdTime() { @@ -166,7 +158,7 @@ public OffsetDateTime createdTime() { /** * Set the createdTime property: The createdTime property. - * + * * @param createdTime the createdTime value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -177,7 +169,7 @@ public MicrosoftGraphCopyNotebookModel withCreatedTime(OffsetDateTime createdTim /** * Get the id property: The id property. - * + * * @return the id value. */ public String id() { @@ -186,7 +178,7 @@ public String id() { /** * Set the id property: The id property. - * + * * @param id the id value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -197,7 +189,7 @@ public MicrosoftGraphCopyNotebookModel withId(String id) { /** * Get the isDefault property: The isDefault property. - * + * * @return the isDefault value. */ public Boolean isDefault() { @@ -206,7 +198,7 @@ public Boolean isDefault() { /** * Set the isDefault property: The isDefault property. - * + * * @param isDefault the isDefault value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -217,7 +209,7 @@ public MicrosoftGraphCopyNotebookModel withIsDefault(Boolean isDefault) { /** * Get the isShared property: The isShared property. - * + * * @return the isShared value. */ public Boolean isShared() { @@ -226,7 +218,7 @@ public Boolean isShared() { /** * Set the isShared property: The isShared property. - * + * * @param isShared the isShared value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -237,7 +229,7 @@ public MicrosoftGraphCopyNotebookModel withIsShared(Boolean isShared) { /** * Get the lastModifiedBy property: The lastModifiedBy property. - * + * * @return the lastModifiedBy value. */ public String lastModifiedBy() { @@ -246,7 +238,7 @@ public String lastModifiedBy() { /** * Set the lastModifiedBy property: The lastModifiedBy property. - * + * * @param lastModifiedBy the lastModifiedBy value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -257,7 +249,7 @@ public MicrosoftGraphCopyNotebookModel withLastModifiedBy(String lastModifiedBy) /** * Get the lastModifiedByIdentity property: identitySet. - * + * * @return the lastModifiedByIdentity value. */ public MicrosoftGraphIdentitySet lastModifiedByIdentity() { @@ -266,19 +258,19 @@ public MicrosoftGraphIdentitySet lastModifiedByIdentity() { /** * Set the lastModifiedByIdentity property: identitySet. - * + * * @param lastModifiedByIdentity the lastModifiedByIdentity value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ - public MicrosoftGraphCopyNotebookModel withLastModifiedByIdentity( - MicrosoftGraphIdentitySet lastModifiedByIdentity) { + public MicrosoftGraphCopyNotebookModel + withLastModifiedByIdentity(MicrosoftGraphIdentitySet lastModifiedByIdentity) { this.lastModifiedByIdentity = lastModifiedByIdentity; return this; } /** * Get the lastModifiedTime property: The lastModifiedTime property. - * + * * @return the lastModifiedTime value. */ public OffsetDateTime lastModifiedTime() { @@ -287,7 +279,7 @@ public OffsetDateTime lastModifiedTime() { /** * Set the lastModifiedTime property: The lastModifiedTime property. - * + * * @param lastModifiedTime the lastModifiedTime value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -298,7 +290,7 @@ public MicrosoftGraphCopyNotebookModel withLastModifiedTime(OffsetDateTime lastM /** * Get the links property: notebookLinks. - * + * * @return the links value. */ public MicrosoftGraphNotebookLinks links() { @@ -307,7 +299,7 @@ public MicrosoftGraphNotebookLinks links() { /** * Set the links property: notebookLinks. - * + * * @param links the links value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -318,7 +310,7 @@ public MicrosoftGraphCopyNotebookModel withLinks(MicrosoftGraphNotebookLinks lin /** * Get the name property: The name property. - * + * * @return the name value. */ public String name() { @@ -327,7 +319,7 @@ public String name() { /** * Set the name property: The name property. - * + * * @param name the name value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -338,7 +330,7 @@ public MicrosoftGraphCopyNotebookModel withName(String name) { /** * Get the sectionGroupsUrl property: The sectionGroupsUrl property. - * + * * @return the sectionGroupsUrl value. */ public String sectionGroupsUrl() { @@ -347,7 +339,7 @@ public String sectionGroupsUrl() { /** * Set the sectionGroupsUrl property: The sectionGroupsUrl property. - * + * * @param sectionGroupsUrl the sectionGroupsUrl value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -358,7 +350,7 @@ public MicrosoftGraphCopyNotebookModel withSectionGroupsUrl(String sectionGroups /** * Get the sectionsUrl property: The sectionsUrl property. - * + * * @return the sectionsUrl value. */ public String sectionsUrl() { @@ -367,7 +359,7 @@ public String sectionsUrl() { /** * Set the sectionsUrl property: The sectionsUrl property. - * + * * @param sectionsUrl the sectionsUrl value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -378,7 +370,7 @@ public MicrosoftGraphCopyNotebookModel withSectionsUrl(String sectionsUrl) { /** * Get the self property: The self property. - * + * * @return the self value. */ public String self() { @@ -387,7 +379,7 @@ public String self() { /** * Set the self property: The self property. - * + * * @param self the self value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -398,7 +390,7 @@ public MicrosoftGraphCopyNotebookModel withSelf(String self) { /** * Get the userRole property: onenoteUserRole. - * + * * @return the userRole value. */ public MicrosoftGraphOnenoteUserRole userRole() { @@ -407,7 +399,7 @@ public MicrosoftGraphOnenoteUserRole userRole() { /** * Set the userRole property: onenoteUserRole. - * + * * @param userRole the userRole value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -418,17 +410,16 @@ public MicrosoftGraphCopyNotebookModel withUserRole(MicrosoftGraphOnenoteUserRol /** * Get the additionalProperties property: CopyNotebookModel. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: CopyNotebookModel. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphCopyNotebookModel object itself. */ @@ -437,17 +428,9 @@ public MicrosoftGraphCopyNotebookModel withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -461,4 +444,103 @@ public void validate() { links().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdBy", this.createdBy); + jsonWriter.writeJsonField("createdByIdentity", this.createdByIdentity); + jsonWriter.writeStringField("createdTime", + this.createdTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdTime)); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeBooleanField("isDefault", this.isDefault); + jsonWriter.writeBooleanField("isShared", this.isShared); + jsonWriter.writeStringField("lastModifiedBy", this.lastModifiedBy); + jsonWriter.writeJsonField("lastModifiedByIdentity", this.lastModifiedByIdentity); + jsonWriter.writeStringField("lastModifiedTime", + this.lastModifiedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedTime)); + jsonWriter.writeJsonField("links", this.links); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("sectionGroupsUrl", this.sectionGroupsUrl); + jsonWriter.writeStringField("sectionsUrl", this.sectionsUrl); + jsonWriter.writeStringField("self", this.self); + jsonWriter.writeStringField("userRole", this.userRole == null ? null : this.userRole.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphCopyNotebookModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphCopyNotebookModel 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 MicrosoftGraphCopyNotebookModel. + */ + public static MicrosoftGraphCopyNotebookModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphCopyNotebookModel deserializedMicrosoftGraphCopyNotebookModel + = new MicrosoftGraphCopyNotebookModel(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.createdBy = reader.getString(); + } else if ("createdByIdentity".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.createdByIdentity + = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("createdTime".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("id".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.id = reader.getString(); + } else if ("isDefault".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("isShared".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.isShared = reader.getNullable(JsonReader::getBoolean); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.lastModifiedBy = reader.getString(); + } else if ("lastModifiedByIdentity".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.lastModifiedByIdentity + = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("lastModifiedTime".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.lastModifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("links".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.links = MicrosoftGraphNotebookLinks.fromJson(reader); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.name = reader.getString(); + } else if ("sectionGroupsUrl".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.sectionGroupsUrl = reader.getString(); + } else if ("sectionsUrl".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.sectionsUrl = reader.getString(); + } else if ("self".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.self = reader.getString(); + } else if ("userRole".equals(fieldName)) { + deserializedMicrosoftGraphCopyNotebookModel.userRole + = MicrosoftGraphOnenoteUserRole.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphCopyNotebookModel.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphCopyNotebookModel; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCurrencyColumn.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCurrencyColumn.java index 374ba45042c73..6f9100dc12eb4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCurrencyColumn.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphCurrencyColumn.java @@ -5,34 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** currencyColumn. */ +/** + * currencyColumn. + */ @Fluent -public final class MicrosoftGraphCurrencyColumn { +public final class MicrosoftGraphCurrencyColumn implements JsonSerializable { /* * Specifies the locale from which to infer the currency symbol. */ - @JsonProperty(value = "locale") private String locale; /* * currencyColumn */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphCurrencyColumn class. */ + /** + * Creates an instance of MicrosoftGraphCurrencyColumn class. + */ public MicrosoftGraphCurrencyColumn() { } /** * Get the locale property: Specifies the locale from which to infer the currency symbol. - * + * * @return the locale value. */ public String locale() { @@ -41,7 +45,7 @@ public String locale() { /** * Set the locale property: Specifies the locale from which to infer the currency symbol. - * + * * @param locale the locale value to set. * @return the MicrosoftGraphCurrencyColumn object itself. */ @@ -52,17 +56,16 @@ public MicrosoftGraphCurrencyColumn withLocale(String locale) { /** * Get the additionalProperties property: currencyColumn. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: currencyColumn. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphCurrencyColumn object itself. */ @@ -71,19 +74,58 @@ public MicrosoftGraphCurrencyColumn withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("locale", this.locale); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphCurrencyColumn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphCurrencyColumn 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 MicrosoftGraphCurrencyColumn. + */ + public static MicrosoftGraphCurrencyColumn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphCurrencyColumn deserializedMicrosoftGraphCurrencyColumn = new MicrosoftGraphCurrencyColumn(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("locale".equals(fieldName)) { + deserializedMicrosoftGraphCurrencyColumn.locale = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphCurrencyColumn.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphCurrencyColumn; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDateTimeColumn.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDateTimeColumn.java index bd1f234c361b4..244c0c14743a5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDateTimeColumn.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDateTimeColumn.java @@ -5,43 +5,46 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** dateTimeColumn. */ +/** + * dateTimeColumn. + */ @Fluent -public final class MicrosoftGraphDateTimeColumn { +public final class MicrosoftGraphDateTimeColumn implements JsonSerializable { /* * How the value should be presented in the UX. Must be one of default, friendly, or standard. See below for more * details. If unspecified, treated as default. */ - @JsonProperty(value = "displayAs") private String displayAs; /* * Indicates whether the value should be presented as a date only or a date and time. Must be one of dateOnly or * dateTime */ - @JsonProperty(value = "format") private String format; /* * dateTimeColumn */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDateTimeColumn class. */ + /** + * Creates an instance of MicrosoftGraphDateTimeColumn class. + */ public MicrosoftGraphDateTimeColumn() { } /** * Get the displayAs property: How the value should be presented in the UX. Must be one of default, friendly, or * standard. See below for more details. If unspecified, treated as default. - * + * * @return the displayAs value. */ public String displayAs() { @@ -51,7 +54,7 @@ public String displayAs() { /** * Set the displayAs property: How the value should be presented in the UX. Must be one of default, friendly, or * standard. See below for more details. If unspecified, treated as default. - * + * * @param displayAs the displayAs value to set. * @return the MicrosoftGraphDateTimeColumn object itself. */ @@ -63,7 +66,7 @@ public MicrosoftGraphDateTimeColumn withDisplayAs(String displayAs) { /** * Get the format property: Indicates whether the value should be presented as a date only or a date and time. Must * be one of dateOnly or dateTime. - * + * * @return the format value. */ public String format() { @@ -73,7 +76,7 @@ public String format() { /** * Set the format property: Indicates whether the value should be presented as a date only or a date and time. Must * be one of dateOnly or dateTime. - * + * * @param format the format value to set. * @return the MicrosoftGraphDateTimeColumn object itself. */ @@ -84,17 +87,16 @@ public MicrosoftGraphDateTimeColumn withFormat(String format) { /** * Get the additionalProperties property: dateTimeColumn. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: dateTimeColumn. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDateTimeColumn object itself. */ @@ -103,19 +105,61 @@ public MicrosoftGraphDateTimeColumn withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayAs", this.displayAs); + jsonWriter.writeStringField("format", this.format); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDateTimeColumn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDateTimeColumn 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 MicrosoftGraphDateTimeColumn. + */ + public static MicrosoftGraphDateTimeColumn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDateTimeColumn deserializedMicrosoftGraphDateTimeColumn = new MicrosoftGraphDateTimeColumn(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayAs".equals(fieldName)) { + deserializedMicrosoftGraphDateTimeColumn.displayAs = reader.getString(); + } else if ("format".equals(fieldName)) { + deserializedMicrosoftGraphDateTimeColumn.format = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDateTimeColumn.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDateTimeColumn; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDateTimeZone.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDateTimeZone.java index d7cab43f6dece..8a4a9a8fa3709 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDateTimeZone.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDateTimeZone.java @@ -5,42 +5,45 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** dateTimeTimeZone. */ +/** + * dateTimeTimeZone. + */ @Fluent -public final class MicrosoftGraphDateTimeZone { +public final class MicrosoftGraphDateTimeZone implements JsonSerializable { /* * A single point of time in a combined date and time representation ({date}T{time}; for example, * 2017-08-29T04:00:00.0000000). */ - @JsonProperty(value = "dateTime") private String dateTime; /* * Represents a time zone, for example, 'Pacific Standard Time'. See below for more possible values. */ - @JsonProperty(value = "timeZone") private String timeZone; /* * dateTimeTimeZone */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDateTimeZone class. */ + /** + * Creates an instance of MicrosoftGraphDateTimeZone class. + */ public MicrosoftGraphDateTimeZone() { } /** * Get the dateTime property: A single point of time in a combined date and time representation ({date}T{time}; for * example, 2017-08-29T04:00:00.0000000). - * + * * @return the dateTime value. */ public String dateTime() { @@ -50,7 +53,7 @@ public String dateTime() { /** * Set the dateTime property: A single point of time in a combined date and time representation ({date}T{time}; for * example, 2017-08-29T04:00:00.0000000). - * + * * @param dateTime the dateTime value to set. * @return the MicrosoftGraphDateTimeZone object itself. */ @@ -62,7 +65,7 @@ public MicrosoftGraphDateTimeZone withDateTime(String dateTime) { /** * Get the timeZone property: Represents a time zone, for example, 'Pacific Standard Time'. See below for more * possible values. - * + * * @return the timeZone value. */ public String timeZone() { @@ -72,7 +75,7 @@ public String timeZone() { /** * Set the timeZone property: Represents a time zone, for example, 'Pacific Standard Time'. See below for more * possible values. - * + * * @param timeZone the timeZone value to set. * @return the MicrosoftGraphDateTimeZone object itself. */ @@ -83,17 +86,16 @@ public MicrosoftGraphDateTimeZone withTimeZone(String timeZone) { /** * Get the additionalProperties property: dateTimeTimeZone. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: dateTimeTimeZone. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDateTimeZone object itself. */ @@ -102,19 +104,61 @@ public MicrosoftGraphDateTimeZone withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dateTime", this.dateTime); + jsonWriter.writeStringField("timeZone", this.timeZone); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDateTimeZone from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDateTimeZone 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 MicrosoftGraphDateTimeZone. + */ + public static MicrosoftGraphDateTimeZone fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDateTimeZone deserializedMicrosoftGraphDateTimeZone = new MicrosoftGraphDateTimeZone(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dateTime".equals(fieldName)) { + deserializedMicrosoftGraphDateTimeZone.dateTime = reader.getString(); + } else if ("timeZone".equals(fieldName)) { + deserializedMicrosoftGraphDateTimeZone.timeZone = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDateTimeZone.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDateTimeZone; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDayOfWeek.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDayOfWeek.java index f594ee41e1d90..a8544652d0efe 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDayOfWeek.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDayOfWeek.java @@ -5,35 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** dayOfWeek. */ +/** + * dayOfWeek. + */ public final class MicrosoftGraphDayOfWeek extends ExpandableStringEnum { - /** Static value sunday for MicrosoftGraphDayOfWeek. */ + /** + * Static value sunday for MicrosoftGraphDayOfWeek. + */ public static final MicrosoftGraphDayOfWeek SUNDAY = fromString("sunday"); - /** Static value monday for MicrosoftGraphDayOfWeek. */ + /** + * Static value monday for MicrosoftGraphDayOfWeek. + */ public static final MicrosoftGraphDayOfWeek MONDAY = fromString("monday"); - /** Static value tuesday for MicrosoftGraphDayOfWeek. */ + /** + * Static value tuesday for MicrosoftGraphDayOfWeek. + */ public static final MicrosoftGraphDayOfWeek TUESDAY = fromString("tuesday"); - /** Static value wednesday for MicrosoftGraphDayOfWeek. */ + /** + * Static value wednesday for MicrosoftGraphDayOfWeek. + */ public static final MicrosoftGraphDayOfWeek WEDNESDAY = fromString("wednesday"); - /** Static value thursday for MicrosoftGraphDayOfWeek. */ + /** + * Static value thursday for MicrosoftGraphDayOfWeek. + */ public static final MicrosoftGraphDayOfWeek THURSDAY = fromString("thursday"); - /** Static value friday for MicrosoftGraphDayOfWeek. */ + /** + * Static value friday for MicrosoftGraphDayOfWeek. + */ public static final MicrosoftGraphDayOfWeek FRIDAY = fromString("friday"); - /** Static value saturday for MicrosoftGraphDayOfWeek. */ + /** + * Static value saturday for MicrosoftGraphDayOfWeek. + */ public static final MicrosoftGraphDayOfWeek SATURDAY = fromString("saturday"); /** * Creates a new instance of MicrosoftGraphDayOfWeek value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,18 +57,17 @@ public MicrosoftGraphDayOfWeek() { /** * Creates or finds a MicrosoftGraphDayOfWeek from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphDayOfWeek. */ - @JsonCreator public static MicrosoftGraphDayOfWeek fromString(String name) { return fromString(name, MicrosoftGraphDayOfWeek.class); } /** * Gets known MicrosoftGraphDayOfWeek values. - * + * * @return known MicrosoftGraphDayOfWeek values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDefaultColumnValue.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDefaultColumnValue.java index 874625a7c67bb..f73bea93faf59 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDefaultColumnValue.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDefaultColumnValue.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** defaultColumnValue. */ +/** + * defaultColumnValue. + */ @Fluent -public final class MicrosoftGraphDefaultColumnValue { +public final class MicrosoftGraphDefaultColumnValue implements JsonSerializable { /* * The formula used to compute the default value for this column. */ - @JsonProperty(value = "formula") private String formula; /* * The direct value to use as the default value for this column. */ - @JsonProperty(value = "value") private String value; /* * defaultColumnValue */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDefaultColumnValue class. */ + /** + * Creates an instance of MicrosoftGraphDefaultColumnValue class. + */ public MicrosoftGraphDefaultColumnValue() { } /** * Get the formula property: The formula used to compute the default value for this column. - * + * * @return the formula value. */ public String formula() { @@ -47,7 +50,7 @@ public String formula() { /** * Set the formula property: The formula used to compute the default value for this column. - * + * * @param formula the formula value to set. * @return the MicrosoftGraphDefaultColumnValue object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphDefaultColumnValue withFormula(String formula) { /** * Get the value property: The direct value to use as the default value for this column. - * + * * @return the value value. */ public String value() { @@ -67,7 +70,7 @@ public String value() { /** * Set the value property: The direct value to use as the default value for this column. - * + * * @param value the value value to set. * @return the MicrosoftGraphDefaultColumnValue object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphDefaultColumnValue withValue(String value) { /** * Get the additionalProperties property: defaultColumnValue. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: defaultColumnValue. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDefaultColumnValue object itself. */ @@ -97,19 +99,62 @@ public MicrosoftGraphDefaultColumnValue withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("formula", this.formula); + jsonWriter.writeStringField("value", this.value); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDefaultColumnValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDefaultColumnValue 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 MicrosoftGraphDefaultColumnValue. + */ + public static MicrosoftGraphDefaultColumnValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDefaultColumnValue deserializedMicrosoftGraphDefaultColumnValue + = new MicrosoftGraphDefaultColumnValue(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("formula".equals(fieldName)) { + deserializedMicrosoftGraphDefaultColumnValue.formula = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedMicrosoftGraphDefaultColumnValue.value = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDefaultColumnValue.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDefaultColumnValue; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDelegateMeetingMessageDeliveryOptions.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDelegateMeetingMessageDeliveryOptions.java index 031f07a4b7e32..0082c01064a98 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDelegateMeetingMessageDeliveryOptions.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDelegateMeetingMessageDeliveryOptions.java @@ -5,27 +5,34 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** delegateMeetingMessageDeliveryOptions. */ +/** + * delegateMeetingMessageDeliveryOptions. + */ public final class MicrosoftGraphDelegateMeetingMessageDeliveryOptions extends ExpandableStringEnum { - /** Static value sendToDelegateAndInformationToPrincipal for MicrosoftGraphDelegateMeetingMessageDeliveryOptions. */ - public static final MicrosoftGraphDelegateMeetingMessageDeliveryOptions - SEND_TO_DELEGATE_AND_INFORMATION_TO_PRINCIPAL = fromString("sendToDelegateAndInformationToPrincipal"); + /** + * Static value sendToDelegateAndInformationToPrincipal for MicrosoftGraphDelegateMeetingMessageDeliveryOptions. + */ + public static final MicrosoftGraphDelegateMeetingMessageDeliveryOptions SEND_TO_DELEGATE_AND_INFORMATION_TO_PRINCIPAL + = fromString("sendToDelegateAndInformationToPrincipal"); - /** Static value sendToDelegateAndPrincipal for MicrosoftGraphDelegateMeetingMessageDeliveryOptions. */ - public static final MicrosoftGraphDelegateMeetingMessageDeliveryOptions SEND_TO_DELEGATE_AND_PRINCIPAL = - fromString("sendToDelegateAndPrincipal"); + /** + * Static value sendToDelegateAndPrincipal for MicrosoftGraphDelegateMeetingMessageDeliveryOptions. + */ + public static final MicrosoftGraphDelegateMeetingMessageDeliveryOptions SEND_TO_DELEGATE_AND_PRINCIPAL + = fromString("sendToDelegateAndPrincipal"); - /** Static value sendToDelegateOnly for MicrosoftGraphDelegateMeetingMessageDeliveryOptions. */ - public static final MicrosoftGraphDelegateMeetingMessageDeliveryOptions SEND_TO_DELEGATE_ONLY = - fromString("sendToDelegateOnly"); + /** + * Static value sendToDelegateOnly for MicrosoftGraphDelegateMeetingMessageDeliveryOptions. + */ + public static final MicrosoftGraphDelegateMeetingMessageDeliveryOptions SEND_TO_DELEGATE_ONLY + = fromString("sendToDelegateOnly"); /** * Creates a new instance of MicrosoftGraphDelegateMeetingMessageDeliveryOptions value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +41,17 @@ public MicrosoftGraphDelegateMeetingMessageDeliveryOptions() { /** * Creates or finds a MicrosoftGraphDelegateMeetingMessageDeliveryOptions from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphDelegateMeetingMessageDeliveryOptions. */ - @JsonCreator public static MicrosoftGraphDelegateMeetingMessageDeliveryOptions fromString(String name) { return fromString(name, MicrosoftGraphDelegateMeetingMessageDeliveryOptions.class); } /** * Gets known MicrosoftGraphDelegateMeetingMessageDeliveryOptions values. - * + * * @return known MicrosoftGraphDelegateMeetingMessageDeliveryOptions values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDelegatedPermissionClassification.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDelegatedPermissionClassification.java index 1d9ab59b99839..5fb60d3082a8a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDelegatedPermissionClassification.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDelegatedPermissionClassification.java @@ -5,48 +5,49 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** delegatedPermissionClassification. */ +/** + * delegatedPermissionClassification. + */ @Fluent public final class MicrosoftGraphDelegatedPermissionClassification extends MicrosoftGraphEntity { /* * permissionClassificationType */ - @JsonProperty(value = "classification") private MicrosoftGraphPermissionClassificationType classification; /* * The unique identifier (id) for the delegated permission listed in the oauth2PermissionScopes collection of the * servicePrincipal. Required on create. Does not support $filter. */ - @JsonProperty(value = "permissionId") private String permissionId; /* * The claim value (value) for the delegated permission listed in the oauth2PermissionScopes collection of the * servicePrincipal. Does not support $filter. */ - @JsonProperty(value = "permissionName") private String permissionName; /* * delegatedPermissionClassification */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDelegatedPermissionClassification class. */ + /** + * Creates an instance of MicrosoftGraphDelegatedPermissionClassification class. + */ public MicrosoftGraphDelegatedPermissionClassification() { } /** * Get the classification property: permissionClassificationType. - * + * * @return the classification value. */ public MicrosoftGraphPermissionClassificationType classification() { @@ -55,12 +56,12 @@ public MicrosoftGraphPermissionClassificationType classification() { /** * Set the classification property: permissionClassificationType. - * + * * @param classification the classification value to set. * @return the MicrosoftGraphDelegatedPermissionClassification object itself. */ - public MicrosoftGraphDelegatedPermissionClassification withClassification( - MicrosoftGraphPermissionClassificationType classification) { + public MicrosoftGraphDelegatedPermissionClassification + withClassification(MicrosoftGraphPermissionClassificationType classification) { this.classification = classification; return this; } @@ -68,7 +69,7 @@ public MicrosoftGraphDelegatedPermissionClassification withClassification( /** * Get the permissionId property: The unique identifier (id) for the delegated permission listed in the * oauth2PermissionScopes collection of the servicePrincipal. Required on create. Does not support $filter. - * + * * @return the permissionId value. */ public String permissionId() { @@ -78,7 +79,7 @@ public String permissionId() { /** * Set the permissionId property: The unique identifier (id) for the delegated permission listed in the * oauth2PermissionScopes collection of the servicePrincipal. Required on create. Does not support $filter. - * + * * @param permissionId the permissionId value to set. * @return the MicrosoftGraphDelegatedPermissionClassification object itself. */ @@ -90,7 +91,7 @@ public MicrosoftGraphDelegatedPermissionClassification withPermissionId(String p /** * Get the permissionName property: The claim value (value) for the delegated permission listed in the * oauth2PermissionScopes collection of the servicePrincipal. Does not support $filter. - * + * * @return the permissionName value. */ public String permissionName() { @@ -100,7 +101,7 @@ public String permissionName() { /** * Set the permissionName property: The claim value (value) for the delegated permission listed in the * oauth2PermissionScopes collection of the servicePrincipal. Does not support $filter. - * + * * @param permissionName the permissionName value to set. * @return the MicrosoftGraphDelegatedPermissionClassification object itself. */ @@ -111,35 +112,28 @@ public MicrosoftGraphDelegatedPermissionClassification withPermissionName(String /** * Get the additionalProperties property: delegatedPermissionClassification. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: delegatedPermissionClassification. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDelegatedPermissionClassification object itself. */ - public MicrosoftGraphDelegatedPermissionClassification withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphDelegatedPermissionClassification + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDelegatedPermissionClassification withId(String id) { super.withId(id); @@ -148,11 +142,70 @@ public MicrosoftGraphDelegatedPermissionClassification withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("classification", + this.classification == null ? null : this.classification.toString()); + jsonWriter.writeStringField("permissionId", this.permissionId); + jsonWriter.writeStringField("permissionName", this.permissionName); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDelegatedPermissionClassification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDelegatedPermissionClassification 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 MicrosoftGraphDelegatedPermissionClassification. + */ + public static MicrosoftGraphDelegatedPermissionClassification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDelegatedPermissionClassification deserializedMicrosoftGraphDelegatedPermissionClassification + = new MicrosoftGraphDelegatedPermissionClassification(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDelegatedPermissionClassification.withId(reader.getString()); + } else if ("classification".equals(fieldName)) { + deserializedMicrosoftGraphDelegatedPermissionClassification.classification + = MicrosoftGraphPermissionClassificationType.fromString(reader.getString()); + } else if ("permissionId".equals(fieldName)) { + deserializedMicrosoftGraphDelegatedPermissionClassification.permissionId = reader.getString(); + } else if ("permissionName".equals(fieldName)) { + deserializedMicrosoftGraphDelegatedPermissionClassification.permissionName = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDelegatedPermissionClassification.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDelegatedPermissionClassification; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeleted.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeleted.java index 33fa476640fb8..5b9ebfe0eb182 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeleted.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeleted.java @@ -5,34 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** deleted. */ +/** + * deleted. + */ @Fluent -public final class MicrosoftGraphDeleted { +public final class MicrosoftGraphDeleted implements JsonSerializable { /* * Represents the state of the deleted item. */ - @JsonProperty(value = "state") private String state; /* * deleted */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDeleted class. */ + /** + * Creates an instance of MicrosoftGraphDeleted class. + */ public MicrosoftGraphDeleted() { } /** * Get the state property: Represents the state of the deleted item. - * + * * @return the state value. */ public String state() { @@ -41,7 +45,7 @@ public String state() { /** * Set the state property: Represents the state of the deleted item. - * + * * @param state the state value to set. * @return the MicrosoftGraphDeleted object itself. */ @@ -52,17 +56,16 @@ public MicrosoftGraphDeleted withState(String state) { /** * Get the additionalProperties property: deleted. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: deleted. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDeleted object itself. */ @@ -71,19 +74,58 @@ public MicrosoftGraphDeleted withAdditionalProperties(Map additi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDeleted from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDeleted 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 MicrosoftGraphDeleted. + */ + public static MicrosoftGraphDeleted fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDeleted deserializedMicrosoftGraphDeleted = new MicrosoftGraphDeleted(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedMicrosoftGraphDeleted.state = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDeleted.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDeleted; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDevice.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDevice.java index 11d89ee3157a5..36098e9f53030 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDevice.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDevice.java @@ -5,19 +5,21 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * device - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -25,20 +27,17 @@ public final class MicrosoftGraphDevice extends MicrosoftGraphDirectoryObjectInn /* * true if the account is enabled; otherwise, false. Required. */ - @JsonProperty(value = "accountEnabled") private Boolean accountEnabled; /* * For internal use only. Not nullable. */ - @JsonProperty(value = "alternativeSecurityIds") private List alternativeSecurityIds; /* * The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. */ - @JsonProperty(value = "approximateLastSignInDateTime") private OffsetDateTime approximateLastSignInDateTime; /* @@ -46,51 +45,43 @@ public final class MicrosoftGraphDevice extends MicrosoftGraphDirectoryObjectInn * information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look * like this: '2014-01-01T00:00:00Z'. Read-only. */ - @JsonProperty(value = "complianceExpirationDateTime") private OffsetDateTime complianceExpirationDateTime; /* * Unique identifier set by Azure Device Registration Service at the time of registration. */ - @JsonProperty(value = "deviceId") private String deviceId; /* * For internal use only. Set to null. */ - @JsonProperty(value = "deviceMetadata") private String deviceMetadata; /* * For internal use only. */ - @JsonProperty(value = "deviceVersion") private Integer deviceVersion; /* * The display name for the device. Required. */ - @JsonProperty(value = "displayName") private String displayName; /* * true if the device complies with Mobile Device Management (MDM) policies; otherwise, false. Read-only. This can * only be updated by Intune for any device OS type or by an approved MDM app for Windows OS devices. */ - @JsonProperty(value = "isCompliant") private Boolean isCompliant; /* - * true if the device is managed by a Mobile Device Management (MDM) app; otherwise, false. This can only be - * updated by Intune for any device OS type or by an approved MDM app for Windows OS devices. + * true if the device is managed by a Mobile Device Management (MDM) app; otherwise, false. This can only be updated + * by Intune for any device OS type or by an approved MDM app for Windows OS devices. */ - @JsonProperty(value = "isManaged") private Boolean isManaged; /* * Application identifier used to register device into MDM. Read-only. Supports $filter. */ - @JsonProperty(value = "mdmAppId") private String mdmAppId; /* @@ -98,7 +89,6 @@ public final class MicrosoftGraphDevice extends MicrosoftGraphDirectoryObjectInn * and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 * would look like this: '2014-01-01T00:00:00Z' Read-only. */ - @JsonProperty(value = "onPremisesLastSyncDateTime") private OffsetDateTime onPremisesLastSyncDateTime; /* @@ -106,37 +96,31 @@ public final class MicrosoftGraphDevice extends MicrosoftGraphDirectoryObjectInn * on-premises directory but is no longer synced; null if this object has never been synced from an on-premises * directory (default). Read-only. */ - @JsonProperty(value = "onPremisesSyncEnabled") private Boolean onPremisesSyncEnabled; /* * The type of operating system on the device. Required. */ - @JsonProperty(value = "operatingSystem") private String operatingSystem; /* * The version of the operating system on the device. Required. */ - @JsonProperty(value = "operatingSystemVersion") private String operatingSystemVersion; /* * For internal use only. Not nullable. */ - @JsonProperty(value = "physicalIds") private List physicalIds; /* * The profile type of the device. Possible values:RegisteredDevice (default)SecureVMPrinterSharedIoT */ - @JsonProperty(value = "profileType") private String profileType; /* * List of labels applied to the device by the system. */ - @JsonProperty(value = "systemLabels") private List systemLabels; /* @@ -144,55 +128,50 @@ public final class MicrosoftGraphDevice extends MicrosoftGraphDirectoryObjectInn * devicesAzureAd - Cloud only joined devicesServerAd - on-premises domain joined devices joined to Azure AD. For * more details, see Introduction to device management in Azure Active Directory */ - @JsonProperty(value = "trustType") private String trustType; /* * Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. */ - @JsonProperty(value = "memberOf") private List memberOf; /* * The user that cloud joined the device or registered their personal device. The registered owner is set at the * time of registration. Currently, there can be only one owner. Read-only. Nullable. */ - @JsonProperty(value = "registeredOwners") private List registeredOwners; /* * Collection of registered users of the device. For cloud joined devices and registered personal devices, - * registered users are set to the same value as registered owners at the time of registration. Read-only. - * Nullable. + * registered users are set to the same value as registered owners at the time of registration. Read-only. Nullable. */ - @JsonProperty(value = "registeredUsers") private List registeredUsers; /* * The transitiveMemberOf property. */ - @JsonProperty(value = "transitiveMemberOf") private List transitiveMemberOf; /* * The collection of open extensions defined for the device. Read-only. Nullable. */ - @JsonProperty(value = "extensions") private List extensions; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDevice class. */ + /** + * Creates an instance of MicrosoftGraphDevice class. + */ public MicrosoftGraphDevice() { } /** * Get the accountEnabled property: true if the account is enabled; otherwise, false. Required. - * + * * @return the accountEnabled value. */ public Boolean accountEnabled() { @@ -201,7 +180,7 @@ public Boolean accountEnabled() { /** * Set the accountEnabled property: true if the account is enabled; otherwise, false. Required. - * + * * @param accountEnabled the accountEnabled value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -212,7 +191,7 @@ public MicrosoftGraphDevice withAccountEnabled(Boolean accountEnabled) { /** * Get the alternativeSecurityIds property: For internal use only. Not nullable. - * + * * @return the alternativeSecurityIds value. */ public List alternativeSecurityIds() { @@ -221,12 +200,12 @@ public List alternativeSecurityIds() { /** * Set the alternativeSecurityIds property: For internal use only. Not nullable. - * + * * @param alternativeSecurityIds the alternativeSecurityIds value to set. * @return the MicrosoftGraphDevice object itself. */ - public MicrosoftGraphDevice withAlternativeSecurityIds( - List alternativeSecurityIds) { + public MicrosoftGraphDevice + withAlternativeSecurityIds(List alternativeSecurityIds) { this.alternativeSecurityIds = alternativeSecurityIds; return this; } @@ -235,7 +214,7 @@ public MicrosoftGraphDevice withAlternativeSecurityIds( * Get the approximateLastSignInDateTime property: The timestamp type represents date and time information using ISO * 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. Read-only. - * + * * @return the approximateLastSignInDateTime value. */ public OffsetDateTime approximateLastSignInDateTime() { @@ -246,7 +225,7 @@ public OffsetDateTime approximateLastSignInDateTime() { * Set the approximateLastSignInDateTime property: The timestamp type represents date and time information using ISO * 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. Read-only. - * + * * @param approximateLastSignInDateTime the approximateLastSignInDateTime value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -259,7 +238,7 @@ public MicrosoftGraphDevice withApproximateLastSignInDateTime(OffsetDateTime app * Get the complianceExpirationDateTime property: The timestamp when the device is no longer deemed compliant. The * timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, * midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @return the complianceExpirationDateTime value. */ public OffsetDateTime complianceExpirationDateTime() { @@ -270,7 +249,7 @@ public OffsetDateTime complianceExpirationDateTime() { * Set the complianceExpirationDateTime property: The timestamp when the device is no longer deemed compliant. The * timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, * midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @param complianceExpirationDateTime the complianceExpirationDateTime value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -282,7 +261,7 @@ public MicrosoftGraphDevice withComplianceExpirationDateTime(OffsetDateTime comp /** * Get the deviceId property: Unique identifier set by Azure Device Registration Service at the time of * registration. - * + * * @return the deviceId value. */ public String deviceId() { @@ -292,7 +271,7 @@ public String deviceId() { /** * Set the deviceId property: Unique identifier set by Azure Device Registration Service at the time of * registration. - * + * * @param deviceId the deviceId value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -303,7 +282,7 @@ public MicrosoftGraphDevice withDeviceId(String deviceId) { /** * Get the deviceMetadata property: For internal use only. Set to null. - * + * * @return the deviceMetadata value. */ public String deviceMetadata() { @@ -312,7 +291,7 @@ public String deviceMetadata() { /** * Set the deviceMetadata property: For internal use only. Set to null. - * + * * @param deviceMetadata the deviceMetadata value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -323,7 +302,7 @@ public MicrosoftGraphDevice withDeviceMetadata(String deviceMetadata) { /** * Get the deviceVersion property: For internal use only. - * + * * @return the deviceVersion value. */ public Integer deviceVersion() { @@ -332,7 +311,7 @@ public Integer deviceVersion() { /** * Set the deviceVersion property: For internal use only. - * + * * @param deviceVersion the deviceVersion value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -343,7 +322,7 @@ public MicrosoftGraphDevice withDeviceVersion(Integer deviceVersion) { /** * Get the displayName property: The display name for the device. Required. - * + * * @return the displayName value. */ public String displayName() { @@ -352,7 +331,7 @@ public String displayName() { /** * Set the displayName property: The display name for the device. Required. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -365,7 +344,7 @@ public MicrosoftGraphDevice withDisplayName(String displayName) { * Get the isCompliant property: true if the device complies with Mobile Device Management (MDM) policies; * otherwise, false. Read-only. This can only be updated by Intune for any device OS type or by an approved MDM app * for Windows OS devices. - * + * * @return the isCompliant value. */ public Boolean isCompliant() { @@ -376,7 +355,7 @@ public Boolean isCompliant() { * Set the isCompliant property: true if the device complies with Mobile Device Management (MDM) policies; * otherwise, false. Read-only. This can only be updated by Intune for any device OS type or by an approved MDM app * for Windows OS devices. - * + * * @param isCompliant the isCompliant value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -389,7 +368,7 @@ public MicrosoftGraphDevice withIsCompliant(Boolean isCompliant) { * Get the isManaged property: true if the device is managed by a Mobile Device Management (MDM) app; otherwise, * false. This can only be updated by Intune for any device OS type or by an approved MDM app for Windows OS * devices. - * + * * @return the isManaged value. */ public Boolean isManaged() { @@ -400,7 +379,7 @@ public Boolean isManaged() { * Set the isManaged property: true if the device is managed by a Mobile Device Management (MDM) app; otherwise, * false. This can only be updated by Intune for any device OS type or by an approved MDM app for Windows OS * devices. - * + * * @param isManaged the isManaged value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -411,7 +390,7 @@ public MicrosoftGraphDevice withIsManaged(Boolean isManaged) { /** * Get the mdmAppId property: Application identifier used to register device into MDM. Read-only. Supports $filter. - * + * * @return the mdmAppId value. */ public String mdmAppId() { @@ -420,7 +399,7 @@ public String mdmAppId() { /** * Set the mdmAppId property: Application identifier used to register device into MDM. Read-only. Supports $filter. - * + * * @param mdmAppId the mdmAppId value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -433,7 +412,7 @@ public MicrosoftGraphDevice withMdmAppId(String mdmAppId) { * Get the onPremisesLastSyncDateTime property: The last time at which the object was synced with the on-premises * directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC * time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' Read-only. - * + * * @return the onPremisesLastSyncDateTime value. */ public OffsetDateTime onPremisesLastSyncDateTime() { @@ -444,7 +423,7 @@ public OffsetDateTime onPremisesLastSyncDateTime() { * Set the onPremisesLastSyncDateTime property: The last time at which the object was synced with the on-premises * directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC * time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' Read-only. - * + * * @param onPremisesLastSyncDateTime the onPremisesLastSyncDateTime value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -457,7 +436,7 @@ public MicrosoftGraphDevice withOnPremisesLastSyncDateTime(OffsetDateTime onPrem * Get the onPremisesSyncEnabled property: true if this object is synced from an on-premises directory; false if * this object was originally synced from an on-premises directory but is no longer synced; null if this object has * never been synced from an on-premises directory (default). Read-only. - * + * * @return the onPremisesSyncEnabled value. */ public Boolean onPremisesSyncEnabled() { @@ -468,7 +447,7 @@ public Boolean onPremisesSyncEnabled() { * Set the onPremisesSyncEnabled property: true if this object is synced from an on-premises directory; false if * this object was originally synced from an on-premises directory but is no longer synced; null if this object has * never been synced from an on-premises directory (default). Read-only. - * + * * @param onPremisesSyncEnabled the onPremisesSyncEnabled value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -479,7 +458,7 @@ public MicrosoftGraphDevice withOnPremisesSyncEnabled(Boolean onPremisesSyncEnab /** * Get the operatingSystem property: The type of operating system on the device. Required. - * + * * @return the operatingSystem value. */ public String operatingSystem() { @@ -488,7 +467,7 @@ public String operatingSystem() { /** * Set the operatingSystem property: The type of operating system on the device. Required. - * + * * @param operatingSystem the operatingSystem value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -499,7 +478,7 @@ public MicrosoftGraphDevice withOperatingSystem(String operatingSystem) { /** * Get the operatingSystemVersion property: The version of the operating system on the device. Required. - * + * * @return the operatingSystemVersion value. */ public String operatingSystemVersion() { @@ -508,7 +487,7 @@ public String operatingSystemVersion() { /** * Set the operatingSystemVersion property: The version of the operating system on the device. Required. - * + * * @param operatingSystemVersion the operatingSystemVersion value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -519,7 +498,7 @@ public MicrosoftGraphDevice withOperatingSystemVersion(String operatingSystemVer /** * Get the physicalIds property: For internal use only. Not nullable. - * + * * @return the physicalIds value. */ public List physicalIds() { @@ -528,7 +507,7 @@ public List physicalIds() { /** * Set the physicalIds property: For internal use only. Not nullable. - * + * * @param physicalIds the physicalIds value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -540,7 +519,7 @@ public MicrosoftGraphDevice withPhysicalIds(List physicalIds) { /** * Get the profileType property: The profile type of the device. Possible values:RegisteredDevice * (default)SecureVMPrinterSharedIoT. - * + * * @return the profileType value. */ public String profileType() { @@ -550,7 +529,7 @@ public String profileType() { /** * Set the profileType property: The profile type of the device. Possible values:RegisteredDevice * (default)SecureVMPrinterSharedIoT. - * + * * @param profileType the profileType value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -561,7 +540,7 @@ public MicrosoftGraphDevice withProfileType(String profileType) { /** * Get the systemLabels property: List of labels applied to the device by the system. - * + * * @return the systemLabels value. */ public List systemLabels() { @@ -570,7 +549,7 @@ public List systemLabels() { /** * Set the systemLabels property: List of labels applied to the device by the system. - * + * * @param systemLabels the systemLabels value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -583,7 +562,7 @@ public MicrosoftGraphDevice withSystemLabels(List systemLabels) { * Get the trustType property: Type of trust for the joined device. Read-only. Possible values: Workplace - * indicates bring your own personal devicesAzureAd - Cloud only joined devicesServerAd - on-premises domain joined * devices joined to Azure AD. For more details, see Introduction to device management in Azure Active Directory. - * + * * @return the trustType value. */ public String trustType() { @@ -594,7 +573,7 @@ public String trustType() { * Set the trustType property: Type of trust for the joined device. Read-only. Possible values: Workplace - * indicates bring your own personal devicesAzureAd - Cloud only joined devicesServerAd - on-premises domain joined * devices joined to Azure AD. For more details, see Introduction to device management in Azure Active Directory. - * + * * @param trustType the trustType value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -606,7 +585,7 @@ public MicrosoftGraphDevice withTrustType(String trustType) { /** * Get the memberOf property: Groups that this group is a member of. HTTP Methods: GET (supported for all groups). * Read-only. Nullable. - * + * * @return the memberOf value. */ public List memberOf() { @@ -616,7 +595,7 @@ public List memberOf() { /** * Set the memberOf property: Groups that this group is a member of. HTTP Methods: GET (supported for all groups). * Read-only. Nullable. - * + * * @param memberOf the memberOf value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -628,7 +607,7 @@ public MicrosoftGraphDevice withMemberOf(List registeredOwners() { @@ -638,7 +617,7 @@ public List registeredOwners() { /** * Set the registeredOwners property: The user that cloud joined the device or registered their personal device. The * registered owner is set at the time of registration. Currently, there can be only one owner. Read-only. Nullable. - * + * * @param registeredOwners the registeredOwners value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -651,7 +630,7 @@ public MicrosoftGraphDevice withRegisteredOwners(List registeredUsers() { @@ -662,7 +641,7 @@ public List registeredUsers() { * Set the registeredUsers property: Collection of registered users of the device. For cloud joined devices and * registered personal devices, registered users are set to the same value as registered owners at the time of * registration. Read-only. Nullable. - * + * * @param registeredUsers the registeredUsers value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -673,7 +652,7 @@ public MicrosoftGraphDevice withRegisteredUsers(List transitiveMemberOf() { @@ -682,7 +661,7 @@ public List transitiveMemberOf() { /** * Set the transitiveMemberOf property: The transitiveMemberOf property. - * + * * @param transitiveMemberOf the transitiveMemberOf value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -693,7 +672,7 @@ public MicrosoftGraphDevice withTransitiveMemberOf(List extensions() { @@ -702,7 +681,7 @@ public List extensions() { /** * Set the extensions property: The collection of open extensions defined for the device. Read-only. Nullable. - * + * * @param extensions the extensions value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -714,10 +693,9 @@ public MicrosoftGraphDevice withExtensions(List extensi /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -725,7 +703,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDevice object itself. */ @@ -734,22 +712,18 @@ public MicrosoftGraphDevice withAdditionalProperties(Map additio return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDevice withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDevice withId(String id) { super.withId(id); @@ -758,7 +732,7 @@ public MicrosoftGraphDevice withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -783,4 +757,158 @@ public void validate() { extensions().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeBooleanField("accountEnabled", this.accountEnabled); + jsonWriter.writeArrayField("alternativeSecurityIds", this.alternativeSecurityIds, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("approximateLastSignInDateTime", + this.approximateLastSignInDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.approximateLastSignInDateTime)); + jsonWriter.writeStringField("complianceExpirationDateTime", + this.complianceExpirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.complianceExpirationDateTime)); + jsonWriter.writeStringField("deviceId", this.deviceId); + jsonWriter.writeStringField("deviceMetadata", this.deviceMetadata); + jsonWriter.writeNumberField("deviceVersion", this.deviceVersion); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeBooleanField("isCompliant", this.isCompliant); + jsonWriter.writeBooleanField("isManaged", this.isManaged); + jsonWriter.writeStringField("mdmAppId", this.mdmAppId); + jsonWriter.writeStringField("onPremisesLastSyncDateTime", + this.onPremisesLastSyncDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.onPremisesLastSyncDateTime)); + jsonWriter.writeBooleanField("onPremisesSyncEnabled", this.onPremisesSyncEnabled); + jsonWriter.writeStringField("operatingSystem", this.operatingSystem); + jsonWriter.writeStringField("operatingSystemVersion", this.operatingSystemVersion); + jsonWriter.writeArrayField("physicalIds", this.physicalIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("profileType", this.profileType); + jsonWriter.writeArrayField("systemLabels", this.systemLabels, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("trustType", this.trustType); + jsonWriter.writeArrayField("memberOf", this.memberOf, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registeredOwners", this.registeredOwners, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("registeredUsers", this.registeredUsers, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("transitiveMemberOf", this.transitiveMemberOf, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDevice from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDevice 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 MicrosoftGraphDevice. + */ + public static MicrosoftGraphDevice fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDevice deserializedMicrosoftGraphDevice = new MicrosoftGraphDevice(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDevice.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDevice.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("accountEnabled".equals(fieldName)) { + deserializedMicrosoftGraphDevice.accountEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("alternativeSecurityIds".equals(fieldName)) { + List alternativeSecurityIds + = reader.readArray(reader1 -> MicrosoftGraphAlternativeSecurityId.fromJson(reader1)); + deserializedMicrosoftGraphDevice.alternativeSecurityIds = alternativeSecurityIds; + } else if ("approximateLastSignInDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDevice.approximateLastSignInDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("complianceExpirationDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDevice.complianceExpirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("deviceId".equals(fieldName)) { + deserializedMicrosoftGraphDevice.deviceId = reader.getString(); + } else if ("deviceMetadata".equals(fieldName)) { + deserializedMicrosoftGraphDevice.deviceMetadata = reader.getString(); + } else if ("deviceVersion".equals(fieldName)) { + deserializedMicrosoftGraphDevice.deviceVersion = reader.getNullable(JsonReader::getInt); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphDevice.displayName = reader.getString(); + } else if ("isCompliant".equals(fieldName)) { + deserializedMicrosoftGraphDevice.isCompliant = reader.getNullable(JsonReader::getBoolean); + } else if ("isManaged".equals(fieldName)) { + deserializedMicrosoftGraphDevice.isManaged = reader.getNullable(JsonReader::getBoolean); + } else if ("mdmAppId".equals(fieldName)) { + deserializedMicrosoftGraphDevice.mdmAppId = reader.getString(); + } else if ("onPremisesLastSyncDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDevice.onPremisesLastSyncDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("onPremisesSyncEnabled".equals(fieldName)) { + deserializedMicrosoftGraphDevice.onPremisesSyncEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("operatingSystem".equals(fieldName)) { + deserializedMicrosoftGraphDevice.operatingSystem = reader.getString(); + } else if ("operatingSystemVersion".equals(fieldName)) { + deserializedMicrosoftGraphDevice.operatingSystemVersion = reader.getString(); + } else if ("physicalIds".equals(fieldName)) { + List physicalIds = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphDevice.physicalIds = physicalIds; + } else if ("profileType".equals(fieldName)) { + deserializedMicrosoftGraphDevice.profileType = reader.getString(); + } else if ("systemLabels".equals(fieldName)) { + List systemLabels = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphDevice.systemLabels = systemLabels; + } else if ("trustType".equals(fieldName)) { + deserializedMicrosoftGraphDevice.trustType = reader.getString(); + } else if ("memberOf".equals(fieldName)) { + List memberOf + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphDevice.memberOf = memberOf; + } else if ("registeredOwners".equals(fieldName)) { + List registeredOwners + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphDevice.registeredOwners = registeredOwners; + } else if ("registeredUsers".equals(fieldName)) { + List registeredUsers + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphDevice.registeredUsers = registeredUsers; + } else if ("transitiveMemberOf".equals(fieldName)) { + List transitiveMemberOf + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphDevice.transitiveMemberOf = transitiveMemberOf; + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> MicrosoftGraphExtension.fromJson(reader1)); + deserializedMicrosoftGraphDevice.extensions = extensions; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDevice.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDevice; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceActionResult.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceActionResult.java index 1a44e8edd1549..4afe769b16f98 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceActionResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceActionResult.java @@ -5,57 +5,58 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; /** * deviceActionResult - * - *

Device action result. + * + * Device action result. */ @Fluent -public final class MicrosoftGraphDeviceActionResult { +public final class MicrosoftGraphDeviceActionResult implements JsonSerializable { /* * Action name */ - @JsonProperty(value = "actionName") private String actionName; /* * actionState */ - @JsonProperty(value = "actionState") private MicrosoftGraphActionState actionState; /* * Time the action state was last updated */ - @JsonProperty(value = "lastUpdatedDateTime") private OffsetDateTime lastUpdatedDateTime; /* * Time the action was initiated */ - @JsonProperty(value = "startDateTime") private OffsetDateTime startDateTime; /* * Device action result */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDeviceActionResult class. */ + /** + * Creates an instance of MicrosoftGraphDeviceActionResult class. + */ public MicrosoftGraphDeviceActionResult() { } /** * Get the actionName property: Action name. - * + * * @return the actionName value. */ public String actionName() { @@ -64,7 +65,7 @@ public String actionName() { /** * Set the actionName property: Action name. - * + * * @param actionName the actionName value to set. * @return the MicrosoftGraphDeviceActionResult object itself. */ @@ -75,7 +76,7 @@ public MicrosoftGraphDeviceActionResult withActionName(String actionName) { /** * Get the actionState property: actionState. - * + * * @return the actionState value. */ public MicrosoftGraphActionState actionState() { @@ -84,7 +85,7 @@ public MicrosoftGraphActionState actionState() { /** * Set the actionState property: actionState. - * + * * @param actionState the actionState value to set. * @return the MicrosoftGraphDeviceActionResult object itself. */ @@ -95,7 +96,7 @@ public MicrosoftGraphDeviceActionResult withActionState(MicrosoftGraphActionStat /** * Get the lastUpdatedDateTime property: Time the action state was last updated. - * + * * @return the lastUpdatedDateTime value. */ public OffsetDateTime lastUpdatedDateTime() { @@ -104,7 +105,7 @@ public OffsetDateTime lastUpdatedDateTime() { /** * Set the lastUpdatedDateTime property: Time the action state was last updated. - * + * * @param lastUpdatedDateTime the lastUpdatedDateTime value to set. * @return the MicrosoftGraphDeviceActionResult object itself. */ @@ -115,7 +116,7 @@ public MicrosoftGraphDeviceActionResult withLastUpdatedDateTime(OffsetDateTime l /** * Get the startDateTime property: Time the action was initiated. - * + * * @return the startDateTime value. */ public OffsetDateTime startDateTime() { @@ -124,7 +125,7 @@ public OffsetDateTime startDateTime() { /** * Set the startDateTime property: Time the action was initiated. - * + * * @param startDateTime the startDateTime value to set. * @return the MicrosoftGraphDeviceActionResult object itself. */ @@ -135,17 +136,16 @@ public MicrosoftGraphDeviceActionResult withStartDateTime(OffsetDateTime startDa /** * Get the additionalProperties property: Device action result. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Device action result. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDeviceActionResult object itself. */ @@ -154,19 +154,75 @@ public MicrosoftGraphDeviceActionResult withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actionName", this.actionName); + jsonWriter.writeStringField("actionState", this.actionState == null ? null : this.actionState.toString()); + jsonWriter.writeStringField("lastUpdatedDateTime", + this.lastUpdatedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedDateTime)); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDeviceActionResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDeviceActionResult 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 MicrosoftGraphDeviceActionResult. + */ + public static MicrosoftGraphDeviceActionResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDeviceActionResult deserializedMicrosoftGraphDeviceActionResult + = new MicrosoftGraphDeviceActionResult(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceActionResult.actionName = reader.getString(); + } else if ("actionState".equals(fieldName)) { + deserializedMicrosoftGraphDeviceActionResult.actionState + = MicrosoftGraphActionState.fromString(reader.getString()); + } else if ("lastUpdatedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDeviceActionResult.lastUpdatedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDeviceActionResult.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDeviceActionResult.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDeviceActionResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCategory.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCategory.java index 1e834ef420b80..93a668b3cee8c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCategory.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCategory.java @@ -5,50 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; /** * deviceCategory - * - *

Device categories provides a way to organize your devices. Using device categories, company administrators can - * define their own categories that make sense to their company. These categories can then be applied to a device in the - * Intune Azure console or selected by a user during device enrollment. You can filter reports and create dynamic Azure - * Active Directory device groups based on device categories. + * + * Device categories provides a way to organize your devices. Using device categories, company administrators can define + * their own categories that make sense to their company. These categories can then be applied to a device in the Intune + * Azure console or selected by a user during device enrollment. You can filter reports and create dynamic Azure Active + * Directory device groups based on device categories. */ @Fluent public final class MicrosoftGraphDeviceCategory extends MicrosoftGraphEntity { /* * Optional description for the device category. */ - @JsonProperty(value = "description") private String description; /* * Display name for the device category. */ - @JsonProperty(value = "displayName") private String displayName; /* * Device categories provides a way to organize your devices. Using device categories, company administrators can - * define their own categories that make sense to their company. These categories can then be applied to a device - * in the Intune Azure console or selected by a user during device enrollment. You can filter reports and create + * define their own categories that make sense to their company. These categories can then be applied to a device in + * the Intune Azure console or selected by a user during device enrollment. You can filter reports and create * dynamic Azure Active Directory device groups based on device categories. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDeviceCategory class. */ + /** + * Creates an instance of MicrosoftGraphDeviceCategory class. + */ public MicrosoftGraphDeviceCategory() { } /** * Get the description property: Optional description for the device category. - * + * * @return the description value. */ public String description() { @@ -57,7 +57,7 @@ public String description() { /** * Set the description property: Optional description for the device category. - * + * * @param description the description value to set. * @return the MicrosoftGraphDeviceCategory object itself. */ @@ -68,7 +68,7 @@ public MicrosoftGraphDeviceCategory withDescription(String description) { /** * Get the displayName property: Display name for the device category. - * + * * @return the displayName value. */ public String displayName() { @@ -77,7 +77,7 @@ public String displayName() { /** * Set the displayName property: Display name for the device category. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphDeviceCategory object itself. */ @@ -92,10 +92,9 @@ public MicrosoftGraphDeviceCategory withDisplayName(String displayName) { * categories can then be applied to a device in the Intune Azure console or selected by a user during device * enrollment. You can filter reports and create dynamic Azure Active Directory device groups based on device * categories. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -106,7 +105,7 @@ public Map additionalProperties() { * categories can then be applied to a device in the Intune Azure console or selected by a user during device * enrollment. You can filter reports and create dynamic Azure Active Directory device groups based on device * categories. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDeviceCategory object itself. */ @@ -115,15 +114,9 @@ public MicrosoftGraphDeviceCategory withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDeviceCategory withId(String id) { super.withId(id); @@ -132,11 +125,64 @@ public MicrosoftGraphDeviceCategory withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDeviceCategory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDeviceCategory 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 MicrosoftGraphDeviceCategory. + */ + public static MicrosoftGraphDeviceCategory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDeviceCategory deserializedMicrosoftGraphDeviceCategory = new MicrosoftGraphDeviceCategory(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCategory.withId(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCategory.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCategory.displayName = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDeviceCategory.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDeviceCategory; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCompliancePolicySettingState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCompliancePolicySettingState.java index 2b32c047d7a1f..e417a4ff06913 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCompliancePolicySettingState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCompliancePolicySettingState.java @@ -5,105 +5,97 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * deviceCompliancePolicySettingState - * - *

Device Compilance Policy Setting State for a given device. + * + * Device Compilance Policy Setting State for a given device. */ @Fluent -public final class MicrosoftGraphDeviceCompliancePolicySettingState { +public final class MicrosoftGraphDeviceCompliancePolicySettingState + implements JsonSerializable { /* * Current value of setting on device */ - @JsonProperty(value = "currentValue") private String currentValue; /* * Error code for the setting */ - @JsonProperty(value = "errorCode") private Long errorCode; /* * Error description */ - @JsonProperty(value = "errorDescription") private String errorDescription; /* * Name of setting instance that is being reported. */ - @JsonProperty(value = "instanceDisplayName") private String instanceDisplayName; /* * The setting that is being reported */ - @JsonProperty(value = "setting") private String setting; /* * Localized/user friendly setting name that is being reported */ - @JsonProperty(value = "settingName") private String settingName; /* * Contributing policies */ - @JsonProperty(value = "sources") private List sources; /* * complianceStatus */ - @JsonProperty(value = "state") private MicrosoftGraphComplianceStatus state; /* * UserEmail */ - @JsonProperty(value = "userEmail") private String userEmail; /* * UserId */ - @JsonProperty(value = "userId") private String userId; /* * UserName */ - @JsonProperty(value = "userName") private String username; /* * UserPrincipalName. */ - @JsonProperty(value = "userPrincipalName") private String userPrincipalName; /* * Device Compilance Policy Setting State for a given device. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDeviceCompliancePolicySettingState class. */ + /** + * Creates an instance of MicrosoftGraphDeviceCompliancePolicySettingState class. + */ public MicrosoftGraphDeviceCompliancePolicySettingState() { } /** * Get the currentValue property: Current value of setting on device. - * + * * @return the currentValue value. */ public String currentValue() { @@ -112,7 +104,7 @@ public String currentValue() { /** * Set the currentValue property: Current value of setting on device. - * + * * @param currentValue the currentValue value to set. * @return the MicrosoftGraphDeviceCompliancePolicySettingState object itself. */ @@ -123,7 +115,7 @@ public MicrosoftGraphDeviceCompliancePolicySettingState withCurrentValue(String /** * Get the errorCode property: Error code for the setting. - * + * * @return the errorCode value. */ public Long errorCode() { @@ -132,7 +124,7 @@ public Long errorCode() { /** * Set the errorCode property: Error code for the setting. - * + * * @param errorCode the errorCode value to set. * @return the MicrosoftGraphDeviceCompliancePolicySettingState object itself. */ @@ -143,7 +135,7 @@ public MicrosoftGraphDeviceCompliancePolicySettingState withErrorCode(Long error /** * Get the errorDescription property: Error description. - * + * * @return the errorDescription value. */ public String errorDescription() { @@ -152,7 +144,7 @@ public String errorDescription() { /** * Set the errorDescription property: Error description. - * + * * @param errorDescription the errorDescription value to set. * @return the MicrosoftGraphDeviceCompliancePolicySettingState object itself. */ @@ -163,7 +155,7 @@ public MicrosoftGraphDeviceCompliancePolicySettingState withErrorDescription(Str /** * Get the instanceDisplayName property: Name of setting instance that is being reported. - * + * * @return the instanceDisplayName value. */ public String instanceDisplayName() { @@ -172,7 +164,7 @@ public String instanceDisplayName() { /** * Set the instanceDisplayName property: Name of setting instance that is being reported. - * + * * @param instanceDisplayName the instanceDisplayName value to set. * @return the MicrosoftGraphDeviceCompliancePolicySettingState object itself. */ @@ -183,7 +175,7 @@ public MicrosoftGraphDeviceCompliancePolicySettingState withInstanceDisplayName( /** * Get the setting property: The setting that is being reported. - * + * * @return the setting value. */ public String setting() { @@ -192,7 +184,7 @@ public String setting() { /** * Set the setting property: The setting that is being reported. - * + * * @param setting the setting value to set. * @return the MicrosoftGraphDeviceCompliancePolicySettingState object itself. */ @@ -203,7 +195,7 @@ public MicrosoftGraphDeviceCompliancePolicySettingState withSetting(String setti /** * Get the settingName property: Localized/user friendly setting name that is being reported. - * + * * @return the settingName value. */ public String settingName() { @@ -212,7 +204,7 @@ public String settingName() { /** * Set the settingName property: Localized/user friendly setting name that is being reported. - * + * * @param settingName the settingName value to set. * @return the MicrosoftGraphDeviceCompliancePolicySettingState object itself. */ @@ -223,7 +215,7 @@ public MicrosoftGraphDeviceCompliancePolicySettingState withSettingName(String s /** * Get the sources property: Contributing policies. - * + * * @return the sources value. */ public List sources() { @@ -232,7 +224,7 @@ public List sources() { /** * Set the sources property: Contributing policies. - * + * * @param sources the sources value to set. * @return the MicrosoftGraphDeviceCompliancePolicySettingState object itself. */ @@ -243,7 +235,7 @@ public MicrosoftGraphDeviceCompliancePolicySettingState withSources(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Device Compilance Policy Setting State for a given device. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDeviceCompliancePolicySettingState object itself. */ - public MicrosoftGraphDeviceCompliancePolicySettingState withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphDeviceCompliancePolicySettingState + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -381,4 +364,90 @@ public void validate() { sources().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("currentValue", this.currentValue); + jsonWriter.writeNumberField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorDescription", this.errorDescription); + jsonWriter.writeStringField("instanceDisplayName", this.instanceDisplayName); + jsonWriter.writeStringField("setting", this.setting); + jsonWriter.writeStringField("settingName", this.settingName); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("userEmail", this.userEmail); + jsonWriter.writeStringField("userId", this.userId); + jsonWriter.writeStringField("userName", this.username); + jsonWriter.writeStringField("userPrincipalName", this.userPrincipalName); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDeviceCompliancePolicySettingState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDeviceCompliancePolicySettingState 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 MicrosoftGraphDeviceCompliancePolicySettingState. + */ + public static MicrosoftGraphDeviceCompliancePolicySettingState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDeviceCompliancePolicySettingState deserializedMicrosoftGraphDeviceCompliancePolicySettingState + = new MicrosoftGraphDeviceCompliancePolicySettingState(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("currentValue".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.currentValue = reader.getString(); + } else if ("errorCode".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.errorCode + = reader.getNullable(JsonReader::getLong); + } else if ("errorDescription".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.errorDescription = reader.getString(); + } else if ("instanceDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.instanceDisplayName + = reader.getString(); + } else if ("setting".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.setting = reader.getString(); + } else if ("settingName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.settingName = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources + = reader.readArray(reader1 -> MicrosoftGraphSettingSource.fromJson(reader1)); + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.sources = sources; + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.state + = MicrosoftGraphComplianceStatus.fromString(reader.getString()); + } else if ("userEmail".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.userEmail = reader.getString(); + } else if ("userId".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.userId = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.username = reader.getString(); + } else if ("userPrincipalName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.userPrincipalName = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDeviceCompliancePolicySettingState.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDeviceCompliancePolicySettingState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCompliancePolicyState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCompliancePolicyState.java index adc24063e1a2d..b279d83fa7949 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCompliancePolicyState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceCompliancePolicyState.java @@ -5,69 +5,65 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * deviceCompliancePolicyState - * - *

Device Compliance Policy State for a given device. + * + * Device Compliance Policy State for a given device. */ @Fluent public final class MicrosoftGraphDeviceCompliancePolicyState extends MicrosoftGraphEntity { /* * The name of the policy for this policyBase */ - @JsonProperty(value = "displayName") private String displayName; /* * policyPlatformType */ - @JsonProperty(value = "platformType") private MicrosoftGraphPolicyPlatformType platformType; /* * Count of how many setting a policy holds */ - @JsonProperty(value = "settingCount") private Integer settingCount; /* * The settingStates property. */ - @JsonProperty(value = "settingStates") private List settingStates; /* * complianceStatus */ - @JsonProperty(value = "state") private MicrosoftGraphComplianceStatus state; /* * The version of the policy */ - @JsonProperty(value = "version") private Integer version; /* * Device Compliance Policy State for a given device. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDeviceCompliancePolicyState class. */ + /** + * Creates an instance of MicrosoftGraphDeviceCompliancePolicyState class. + */ public MicrosoftGraphDeviceCompliancePolicyState() { } /** * Get the displayName property: The name of the policy for this policyBase. - * + * * @return the displayName value. */ public String displayName() { @@ -76,7 +72,7 @@ public String displayName() { /** * Set the displayName property: The name of the policy for this policyBase. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphDeviceCompliancePolicyState object itself. */ @@ -87,7 +83,7 @@ public MicrosoftGraphDeviceCompliancePolicyState withDisplayName(String displayN /** * Get the platformType property: policyPlatformType. - * + * * @return the platformType value. */ public MicrosoftGraphPolicyPlatformType platformType() { @@ -96,7 +92,7 @@ public MicrosoftGraphPolicyPlatformType platformType() { /** * Set the platformType property: policyPlatformType. - * + * * @param platformType the platformType value to set. * @return the MicrosoftGraphDeviceCompliancePolicyState object itself. */ @@ -107,7 +103,7 @@ public MicrosoftGraphDeviceCompliancePolicyState withPlatformType(MicrosoftGraph /** * Get the settingCount property: Count of how many setting a policy holds. - * + * * @return the settingCount value. */ public Integer settingCount() { @@ -116,7 +112,7 @@ public Integer settingCount() { /** * Set the settingCount property: Count of how many setting a policy holds. - * + * * @param settingCount the settingCount value to set. * @return the MicrosoftGraphDeviceCompliancePolicyState object itself. */ @@ -127,7 +123,7 @@ public MicrosoftGraphDeviceCompliancePolicyState withSettingCount(Integer settin /** * Get the settingStates property: The settingStates property. - * + * * @return the settingStates value. */ public List settingStates() { @@ -136,19 +132,19 @@ public List settingStates() { /** * Set the settingStates property: The settingStates property. - * + * * @param settingStates the settingStates value to set. * @return the MicrosoftGraphDeviceCompliancePolicyState object itself. */ - public MicrosoftGraphDeviceCompliancePolicyState withSettingStates( - List settingStates) { + public MicrosoftGraphDeviceCompliancePolicyState + withSettingStates(List settingStates) { this.settingStates = settingStates; return this; } /** * Get the state property: complianceStatus. - * + * * @return the state value. */ public MicrosoftGraphComplianceStatus state() { @@ -157,7 +153,7 @@ public MicrosoftGraphComplianceStatus state() { /** * Set the state property: complianceStatus. - * + * * @param state the state value to set. * @return the MicrosoftGraphDeviceCompliancePolicyState object itself. */ @@ -168,7 +164,7 @@ public MicrosoftGraphDeviceCompliancePolicyState withState(MicrosoftGraphComplia /** * Get the version property: The version of the policy. - * + * * @return the version value. */ public Integer version() { @@ -177,7 +173,7 @@ public Integer version() { /** * Set the version property: The version of the policy. - * + * * @param version the version value to set. * @return the MicrosoftGraphDeviceCompliancePolicyState object itself. */ @@ -188,35 +184,28 @@ public MicrosoftGraphDeviceCompliancePolicyState withVersion(Integer version) { /** * Get the additionalProperties property: Device Compliance Policy State for a given device. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Device Compliance Policy State for a given device. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDeviceCompliancePolicyState object itself. */ - public MicrosoftGraphDeviceCompliancePolicyState withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphDeviceCompliancePolicyState + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDeviceCompliancePolicyState withId(String id) { super.withId(id); @@ -225,7 +214,7 @@ public MicrosoftGraphDeviceCompliancePolicyState withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -235,4 +224,76 @@ public void validate() { settingStates().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("platformType", this.platformType == null ? null : this.platformType.toString()); + jsonWriter.writeNumberField("settingCount", this.settingCount); + jsonWriter.writeArrayField("settingStates", this.settingStates, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeNumberField("version", this.version); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDeviceCompliancePolicyState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDeviceCompliancePolicyState 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 MicrosoftGraphDeviceCompliancePolicyState. + */ + public static MicrosoftGraphDeviceCompliancePolicyState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDeviceCompliancePolicyState deserializedMicrosoftGraphDeviceCompliancePolicyState + = new MicrosoftGraphDeviceCompliancePolicyState(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicyState.withId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicyState.displayName = reader.getString(); + } else if ("platformType".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicyState.platformType + = MicrosoftGraphPolicyPlatformType.fromString(reader.getString()); + } else if ("settingCount".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicyState.settingCount + = reader.getNullable(JsonReader::getInt); + } else if ("settingStates".equals(fieldName)) { + List settingStates = reader + .readArray(reader1 -> MicrosoftGraphDeviceCompliancePolicySettingState.fromJson(reader1)); + deserializedMicrosoftGraphDeviceCompliancePolicyState.settingStates = settingStates; + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicyState.state + = MicrosoftGraphComplianceStatus.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedMicrosoftGraphDeviceCompliancePolicyState.version + = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDeviceCompliancePolicyState.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDeviceCompliancePolicyState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceConfigurationSettingState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceConfigurationSettingState.java index f854503c7f2c2..8798893d00729 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceConfigurationSettingState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceConfigurationSettingState.java @@ -5,105 +5,97 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * deviceConfigurationSettingState - * - *

Device Configuration Setting State for a given device. + * + * Device Configuration Setting State for a given device. */ @Fluent -public final class MicrosoftGraphDeviceConfigurationSettingState { +public final class MicrosoftGraphDeviceConfigurationSettingState + implements JsonSerializable { /* * Current value of setting on device */ - @JsonProperty(value = "currentValue") private String currentValue; /* * Error code for the setting */ - @JsonProperty(value = "errorCode") private Long errorCode; /* * Error description */ - @JsonProperty(value = "errorDescription") private String errorDescription; /* * Name of setting instance that is being reported. */ - @JsonProperty(value = "instanceDisplayName") private String instanceDisplayName; /* * The setting that is being reported */ - @JsonProperty(value = "setting") private String setting; /* * Localized/user friendly setting name that is being reported */ - @JsonProperty(value = "settingName") private String settingName; /* * Contributing policies */ - @JsonProperty(value = "sources") private List sources; /* * complianceStatus */ - @JsonProperty(value = "state") private MicrosoftGraphComplianceStatus state; /* * UserEmail */ - @JsonProperty(value = "userEmail") private String userEmail; /* * UserId */ - @JsonProperty(value = "userId") private String userId; /* * UserName */ - @JsonProperty(value = "userName") private String username; /* * UserPrincipalName. */ - @JsonProperty(value = "userPrincipalName") private String userPrincipalName; /* * Device Configuration Setting State for a given device. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDeviceConfigurationSettingState class. */ + /** + * Creates an instance of MicrosoftGraphDeviceConfigurationSettingState class. + */ public MicrosoftGraphDeviceConfigurationSettingState() { } /** * Get the currentValue property: Current value of setting on device. - * + * * @return the currentValue value. */ public String currentValue() { @@ -112,7 +104,7 @@ public String currentValue() { /** * Set the currentValue property: Current value of setting on device. - * + * * @param currentValue the currentValue value to set. * @return the MicrosoftGraphDeviceConfigurationSettingState object itself. */ @@ -123,7 +115,7 @@ public MicrosoftGraphDeviceConfigurationSettingState withCurrentValue(String cur /** * Get the errorCode property: Error code for the setting. - * + * * @return the errorCode value. */ public Long errorCode() { @@ -132,7 +124,7 @@ public Long errorCode() { /** * Set the errorCode property: Error code for the setting. - * + * * @param errorCode the errorCode value to set. * @return the MicrosoftGraphDeviceConfigurationSettingState object itself. */ @@ -143,7 +135,7 @@ public MicrosoftGraphDeviceConfigurationSettingState withErrorCode(Long errorCod /** * Get the errorDescription property: Error description. - * + * * @return the errorDescription value. */ public String errorDescription() { @@ -152,7 +144,7 @@ public String errorDescription() { /** * Set the errorDescription property: Error description. - * + * * @param errorDescription the errorDescription value to set. * @return the MicrosoftGraphDeviceConfigurationSettingState object itself. */ @@ -163,7 +155,7 @@ public MicrosoftGraphDeviceConfigurationSettingState withErrorDescription(String /** * Get the instanceDisplayName property: Name of setting instance that is being reported. - * + * * @return the instanceDisplayName value. */ public String instanceDisplayName() { @@ -172,7 +164,7 @@ public String instanceDisplayName() { /** * Set the instanceDisplayName property: Name of setting instance that is being reported. - * + * * @param instanceDisplayName the instanceDisplayName value to set. * @return the MicrosoftGraphDeviceConfigurationSettingState object itself. */ @@ -183,7 +175,7 @@ public MicrosoftGraphDeviceConfigurationSettingState withInstanceDisplayName(Str /** * Get the setting property: The setting that is being reported. - * + * * @return the setting value. */ public String setting() { @@ -192,7 +184,7 @@ public String setting() { /** * Set the setting property: The setting that is being reported. - * + * * @param setting the setting value to set. * @return the MicrosoftGraphDeviceConfigurationSettingState object itself. */ @@ -203,7 +195,7 @@ public MicrosoftGraphDeviceConfigurationSettingState withSetting(String setting) /** * Get the settingName property: Localized/user friendly setting name that is being reported. - * + * * @return the settingName value. */ public String settingName() { @@ -212,7 +204,7 @@ public String settingName() { /** * Set the settingName property: Localized/user friendly setting name that is being reported. - * + * * @param settingName the settingName value to set. * @return the MicrosoftGraphDeviceConfigurationSettingState object itself. */ @@ -223,7 +215,7 @@ public MicrosoftGraphDeviceConfigurationSettingState withSettingName(String sett /** * Get the sources property: Contributing policies. - * + * * @return the sources value. */ public List sources() { @@ -232,7 +224,7 @@ public List sources() { /** * Set the sources property: Contributing policies. - * + * * @param sources the sources value to set. * @return the MicrosoftGraphDeviceConfigurationSettingState object itself. */ @@ -243,7 +235,7 @@ public MicrosoftGraphDeviceConfigurationSettingState withSources(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Device Configuration Setting State for a given device. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDeviceConfigurationSettingState object itself. */ - public MicrosoftGraphDeviceConfigurationSettingState withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphDeviceConfigurationSettingState + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -381,4 +364,89 @@ public void validate() { sources().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("currentValue", this.currentValue); + jsonWriter.writeNumberField("errorCode", this.errorCode); + jsonWriter.writeStringField("errorDescription", this.errorDescription); + jsonWriter.writeStringField("instanceDisplayName", this.instanceDisplayName); + jsonWriter.writeStringField("setting", this.setting); + jsonWriter.writeStringField("settingName", this.settingName); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeStringField("userEmail", this.userEmail); + jsonWriter.writeStringField("userId", this.userId); + jsonWriter.writeStringField("userName", this.username); + jsonWriter.writeStringField("userPrincipalName", this.userPrincipalName); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDeviceConfigurationSettingState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDeviceConfigurationSettingState 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 MicrosoftGraphDeviceConfigurationSettingState. + */ + public static MicrosoftGraphDeviceConfigurationSettingState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDeviceConfigurationSettingState deserializedMicrosoftGraphDeviceConfigurationSettingState + = new MicrosoftGraphDeviceConfigurationSettingState(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("currentValue".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.currentValue = reader.getString(); + } else if ("errorCode".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.errorCode + = reader.getNullable(JsonReader::getLong); + } else if ("errorDescription".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.errorDescription = reader.getString(); + } else if ("instanceDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.instanceDisplayName = reader.getString(); + } else if ("setting".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.setting = reader.getString(); + } else if ("settingName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.settingName = reader.getString(); + } else if ("sources".equals(fieldName)) { + List sources + = reader.readArray(reader1 -> MicrosoftGraphSettingSource.fromJson(reader1)); + deserializedMicrosoftGraphDeviceConfigurationSettingState.sources = sources; + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.state + = MicrosoftGraphComplianceStatus.fromString(reader.getString()); + } else if ("userEmail".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.userEmail = reader.getString(); + } else if ("userId".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.userId = reader.getString(); + } else if ("userName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.username = reader.getString(); + } else if ("userPrincipalName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationSettingState.userPrincipalName = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDeviceConfigurationSettingState.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDeviceConfigurationSettingState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceConfigurationState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceConfigurationState.java index 8353f287f31f5..167b466a3c645 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceConfigurationState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceConfigurationState.java @@ -5,69 +5,65 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * deviceConfigurationState - * - *

Device Configuration State for a given device. + * + * Device Configuration State for a given device. */ @Fluent public final class MicrosoftGraphDeviceConfigurationState extends MicrosoftGraphEntity { /* * The name of the policy for this policyBase */ - @JsonProperty(value = "displayName") private String displayName; /* * policyPlatformType */ - @JsonProperty(value = "platformType") private MicrosoftGraphPolicyPlatformType platformType; /* * Count of how many setting a policy holds */ - @JsonProperty(value = "settingCount") private Integer settingCount; /* * The settingStates property. */ - @JsonProperty(value = "settingStates") private List settingStates; /* * complianceStatus */ - @JsonProperty(value = "state") private MicrosoftGraphComplianceStatus state; /* * The version of the policy */ - @JsonProperty(value = "version") private Integer version; /* * Device Configuration State for a given device. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDeviceConfigurationState class. */ + /** + * Creates an instance of MicrosoftGraphDeviceConfigurationState class. + */ public MicrosoftGraphDeviceConfigurationState() { } /** * Get the displayName property: The name of the policy for this policyBase. - * + * * @return the displayName value. */ public String displayName() { @@ -76,7 +72,7 @@ public String displayName() { /** * Set the displayName property: The name of the policy for this policyBase. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphDeviceConfigurationState object itself. */ @@ -87,7 +83,7 @@ public MicrosoftGraphDeviceConfigurationState withDisplayName(String displayName /** * Get the platformType property: policyPlatformType. - * + * * @return the platformType value. */ public MicrosoftGraphPolicyPlatformType platformType() { @@ -96,7 +92,7 @@ public MicrosoftGraphPolicyPlatformType platformType() { /** * Set the platformType property: policyPlatformType. - * + * * @param platformType the platformType value to set. * @return the MicrosoftGraphDeviceConfigurationState object itself. */ @@ -107,7 +103,7 @@ public MicrosoftGraphDeviceConfigurationState withPlatformType(MicrosoftGraphPol /** * Get the settingCount property: Count of how many setting a policy holds. - * + * * @return the settingCount value. */ public Integer settingCount() { @@ -116,7 +112,7 @@ public Integer settingCount() { /** * Set the settingCount property: Count of how many setting a policy holds. - * + * * @param settingCount the settingCount value to set. * @return the MicrosoftGraphDeviceConfigurationState object itself. */ @@ -127,7 +123,7 @@ public MicrosoftGraphDeviceConfigurationState withSettingCount(Integer settingCo /** * Get the settingStates property: The settingStates property. - * + * * @return the settingStates value. */ public List settingStates() { @@ -136,19 +132,19 @@ public List settingStates() { /** * Set the settingStates property: The settingStates property. - * + * * @param settingStates the settingStates value to set. * @return the MicrosoftGraphDeviceConfigurationState object itself. */ - public MicrosoftGraphDeviceConfigurationState withSettingStates( - List settingStates) { + public MicrosoftGraphDeviceConfigurationState + withSettingStates(List settingStates) { this.settingStates = settingStates; return this; } /** * Get the state property: complianceStatus. - * + * * @return the state value. */ public MicrosoftGraphComplianceStatus state() { @@ -157,7 +153,7 @@ public MicrosoftGraphComplianceStatus state() { /** * Set the state property: complianceStatus. - * + * * @param state the state value to set. * @return the MicrosoftGraphDeviceConfigurationState object itself. */ @@ -168,7 +164,7 @@ public MicrosoftGraphDeviceConfigurationState withState(MicrosoftGraphCompliance /** * Get the version property: The version of the policy. - * + * * @return the version value. */ public Integer version() { @@ -177,7 +173,7 @@ public Integer version() { /** * Set the version property: The version of the policy. - * + * * @param version the version value to set. * @return the MicrosoftGraphDeviceConfigurationState object itself. */ @@ -188,17 +184,16 @@ public MicrosoftGraphDeviceConfigurationState withVersion(Integer version) { /** * Get the additionalProperties property: Device Configuration State for a given device. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Device Configuration State for a given device. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDeviceConfigurationState object itself. */ @@ -207,15 +202,9 @@ public MicrosoftGraphDeviceConfigurationState withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDeviceConfigurationState withId(String id) { super.withId(id); @@ -224,7 +213,7 @@ public MicrosoftGraphDeviceConfigurationState withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -234,4 +223,75 @@ public void validate() { settingStates().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("platformType", this.platformType == null ? null : this.platformType.toString()); + jsonWriter.writeNumberField("settingCount", this.settingCount); + jsonWriter.writeArrayField("settingStates", this.settingStates, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeNumberField("version", this.version); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDeviceConfigurationState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDeviceConfigurationState 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 MicrosoftGraphDeviceConfigurationState. + */ + public static MicrosoftGraphDeviceConfigurationState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDeviceConfigurationState deserializedMicrosoftGraphDeviceConfigurationState + = new MicrosoftGraphDeviceConfigurationState(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationState.withId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationState.displayName = reader.getString(); + } else if ("platformType".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationState.platformType + = MicrosoftGraphPolicyPlatformType.fromString(reader.getString()); + } else if ("settingCount".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationState.settingCount + = reader.getNullable(JsonReader::getInt); + } else if ("settingStates".equals(fieldName)) { + List settingStates + = reader.readArray(reader1 -> MicrosoftGraphDeviceConfigurationSettingState.fromJson(reader1)); + deserializedMicrosoftGraphDeviceConfigurationState.settingStates = settingStates; + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationState.state + = MicrosoftGraphComplianceStatus.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedMicrosoftGraphDeviceConfigurationState.version = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDeviceConfigurationState.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDeviceConfigurationState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceEnrollmentType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceEnrollmentType.java index 326fad0f47300..99af6b08d9713 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceEnrollmentType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceEnrollmentType.java @@ -5,47 +5,68 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** deviceEnrollmentType. */ +/** + * deviceEnrollmentType. + */ public final class MicrosoftGraphDeviceEnrollmentType extends ExpandableStringEnum { - /** Static value unknown for MicrosoftGraphDeviceEnrollmentType. */ + /** + * Static value unknown for MicrosoftGraphDeviceEnrollmentType. + */ public static final MicrosoftGraphDeviceEnrollmentType UNKNOWN = fromString("unknown"); - /** Static value userEnrollment for MicrosoftGraphDeviceEnrollmentType. */ + /** + * Static value userEnrollment for MicrosoftGraphDeviceEnrollmentType. + */ public static final MicrosoftGraphDeviceEnrollmentType USER_ENROLLMENT = fromString("userEnrollment"); - /** Static value deviceEnrollmentManager for MicrosoftGraphDeviceEnrollmentType. */ - public static final MicrosoftGraphDeviceEnrollmentType DEVICE_ENROLLMENT_MANAGER = - fromString("deviceEnrollmentManager"); + /** + * Static value deviceEnrollmentManager for MicrosoftGraphDeviceEnrollmentType. + */ + public static final MicrosoftGraphDeviceEnrollmentType DEVICE_ENROLLMENT_MANAGER + = fromString("deviceEnrollmentManager"); - /** Static value appleBulkWithUser for MicrosoftGraphDeviceEnrollmentType. */ + /** + * Static value appleBulkWithUser for MicrosoftGraphDeviceEnrollmentType. + */ public static final MicrosoftGraphDeviceEnrollmentType APPLE_BULK_WITH_USER = fromString("appleBulkWithUser"); - /** Static value appleBulkWithoutUser for MicrosoftGraphDeviceEnrollmentType. */ + /** + * Static value appleBulkWithoutUser for MicrosoftGraphDeviceEnrollmentType. + */ public static final MicrosoftGraphDeviceEnrollmentType APPLE_BULK_WITHOUT_USER = fromString("appleBulkWithoutUser"); - /** Static value windowsAzureADJoin for MicrosoftGraphDeviceEnrollmentType. */ + /** + * Static value windowsAzureADJoin for MicrosoftGraphDeviceEnrollmentType. + */ public static final MicrosoftGraphDeviceEnrollmentType WINDOWS_AZURE_ADJOIN = fromString("windowsAzureADJoin"); - /** Static value windowsBulkUserless for MicrosoftGraphDeviceEnrollmentType. */ + /** + * Static value windowsBulkUserless for MicrosoftGraphDeviceEnrollmentType. + */ public static final MicrosoftGraphDeviceEnrollmentType WINDOWS_BULK_USERLESS = fromString("windowsBulkUserless"); - /** Static value windowsAutoEnrollment for MicrosoftGraphDeviceEnrollmentType. */ - public static final MicrosoftGraphDeviceEnrollmentType WINDOWS_AUTO_ENROLLMENT = - fromString("windowsAutoEnrollment"); + /** + * Static value windowsAutoEnrollment for MicrosoftGraphDeviceEnrollmentType. + */ + public static final MicrosoftGraphDeviceEnrollmentType WINDOWS_AUTO_ENROLLMENT + = fromString("windowsAutoEnrollment"); - /** Static value windowsBulkAzureDomainJoin for MicrosoftGraphDeviceEnrollmentType. */ - public static final MicrosoftGraphDeviceEnrollmentType WINDOWS_BULK_AZURE_DOMAIN_JOIN = - fromString("windowsBulkAzureDomainJoin"); + /** + * Static value windowsBulkAzureDomainJoin for MicrosoftGraphDeviceEnrollmentType. + */ + public static final MicrosoftGraphDeviceEnrollmentType WINDOWS_BULK_AZURE_DOMAIN_JOIN + = fromString("windowsBulkAzureDomainJoin"); - /** Static value windowsCoManagement for MicrosoftGraphDeviceEnrollmentType. */ + /** + * Static value windowsCoManagement for MicrosoftGraphDeviceEnrollmentType. + */ public static final MicrosoftGraphDeviceEnrollmentType WINDOWS_CO_MANAGEMENT = fromString("windowsCoManagement"); /** * Creates a new instance of MicrosoftGraphDeviceEnrollmentType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -54,18 +75,17 @@ public MicrosoftGraphDeviceEnrollmentType() { /** * Creates or finds a MicrosoftGraphDeviceEnrollmentType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphDeviceEnrollmentType. */ - @JsonCreator public static MicrosoftGraphDeviceEnrollmentType fromString(String name) { return fromString(name, MicrosoftGraphDeviceEnrollmentType.class); } /** * Gets known MicrosoftGraphDeviceEnrollmentType values. - * + * * @return known MicrosoftGraphDeviceEnrollmentType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceHealthAttestationState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceHealthAttestationState.java index b3d69a4a66936..74fc7e1057646 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceHealthAttestationState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceHealthAttestationState.java @@ -5,223 +5,199 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** deviceHealthAttestationState. */ +/** + * deviceHealthAttestationState. + */ @Fluent -public final class MicrosoftGraphDeviceHealthAttestationState { +public final class MicrosoftGraphDeviceHealthAttestationState + implements JsonSerializable { /* * TWhen an Attestation Identity Key (AIK) is present on a device, it indicates that the device has an endorsement * key (EK) certificate. */ - @JsonProperty(value = "attestationIdentityKey") private String attestationIdentityKey; /* * On or Off of BitLocker Drive Encryption */ - @JsonProperty(value = "bitLockerStatus") private String bitLockerStatus; /* * The security version number of the Boot Application */ - @JsonProperty(value = "bootAppSecurityVersion") private String bootAppSecurityVersion; /* * When bootDebugging is enabled, the device is used in development and testing */ - @JsonProperty(value = "bootDebugging") private String bootDebugging; /* * The security version number of the Boot Application */ - @JsonProperty(value = "bootManagerSecurityVersion") private String bootManagerSecurityVersion; /* * The version of the Boot Manager */ - @JsonProperty(value = "bootManagerVersion") private String bootManagerVersion; /* * The Boot Revision List that was loaded during initial boot on the attested device */ - @JsonProperty(value = "bootRevisionListInfo") private String bootRevisionListInfo; /* * When code integrity is enabled, code execution is restricted to integrity verified code */ - @JsonProperty(value = "codeIntegrity") private String codeIntegrity; /* * The version of the Boot Manager */ - @JsonProperty(value = "codeIntegrityCheckVersion") private String codeIntegrityCheckVersion; /* * The Code Integrity policy that is controlling the security of the boot environment */ - @JsonProperty(value = "codeIntegrityPolicy") private String codeIntegrityPolicy; /* * The DHA report version. (Namespace version) */ - @JsonProperty(value = "contentNamespaceUrl") private String contentNamespaceUrl; /* * The HealthAttestation state schema version */ - @JsonProperty(value = "contentVersion") private String contentVersion; /* * DEP Policy defines a set of hardware and software technologies that perform additional checks on memory */ - @JsonProperty(value = "dataExcutionPolicy") private String dataExcutionPolicy; /* * The DHA report version. (Namespace version) */ - @JsonProperty(value = "deviceHealthAttestationStatus") private String deviceHealthAttestationStatus; /* * ELAM provides protection for the computers in your network when they start up */ - @JsonProperty(value = "earlyLaunchAntiMalwareDriverProtection") private String earlyLaunchAntiMalwareDriverProtection; /* * This attribute indicates if DHA is supported for the device */ - @JsonProperty(value = "healthAttestationSupportedStatus") private String healthAttestationSupportedStatus; /* * This attribute appears if DHA-Service detects an integrity issue */ - @JsonProperty(value = "healthStatusMismatchInfo") private String healthStatusMismatchInfo; /* * The DateTime when device was evaluated or issued to MDM */ - @JsonProperty(value = "issuedDateTime") private OffsetDateTime issuedDateTime; /* * The Timestamp of the last update. */ - @JsonProperty(value = "lastUpdateDateTime") private String lastUpdateDateTime; /* * When operatingSystemKernelDebugging is enabled, the device is used in development and testing */ - @JsonProperty(value = "operatingSystemKernelDebugging") private String operatingSystemKernelDebugging; /* * The Operating System Revision List that was loaded during initial boot on the attested device */ - @JsonProperty(value = "operatingSystemRevListInfo") private String operatingSystemRevListInfo; /* * The measurement that is captured in PCR[0] */ - @JsonProperty(value = "pcr0") private String pcr0; /* * Informational attribute that identifies the HASH algorithm that was used by TPM */ - @JsonProperty(value = "pcrHashAlgorithm") private String pcrHashAlgorithm; /* * The number of times a PC device has hibernated or resumed */ - @JsonProperty(value = "resetCount") private Long resetCount; /* * The number of times a PC device has rebooted */ - @JsonProperty(value = "restartCount") private Long restartCount; /* * Safe mode is a troubleshooting option for Windows that starts your computer in a limited state */ - @JsonProperty(value = "safeMode") private String safeMode; /* * When Secure Boot is enabled, the core components must have the correct cryptographic signatures */ - @JsonProperty(value = "secureBoot") private String secureBoot; /* * Fingerprint of the Custom Secure Boot Configuration Policy */ - @JsonProperty(value = "secureBootConfigurationPolicyFingerPrint") private String secureBootConfigurationPolicyFingerPrint; /* * When test signing is allowed, the device does not enforce signature validation during boot */ - @JsonProperty(value = "testSigning") private String testSigning; /* * The security version number of the Boot Application */ - @JsonProperty(value = "tpmVersion") private String tpmVersion; /* * VSM is a container that protects high value assets from a compromised kernel */ - @JsonProperty(value = "virtualSecureMode") private String virtualSecureMode; /* * Operating system running with limited services that is used to prepare a computer for Windows */ - @JsonProperty(value = "windowsPE") private String windowsPE; /* * deviceHealthAttestationState */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDeviceHealthAttestationState class. */ + /** + * Creates an instance of MicrosoftGraphDeviceHealthAttestationState class. + */ public MicrosoftGraphDeviceHealthAttestationState() { } /** * Get the attestationIdentityKey property: TWhen an Attestation Identity Key (AIK) is present on a device, it * indicates that the device has an endorsement key (EK) certificate. - * + * * @return the attestationIdentityKey value. */ public String attestationIdentityKey() { @@ -231,7 +207,7 @@ public String attestationIdentityKey() { /** * Set the attestationIdentityKey property: TWhen an Attestation Identity Key (AIK) is present on a device, it * indicates that the device has an endorsement key (EK) certificate. - * + * * @param attestationIdentityKey the attestationIdentityKey value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -242,7 +218,7 @@ public MicrosoftGraphDeviceHealthAttestationState withAttestationIdentityKey(Str /** * Get the bitLockerStatus property: On or Off of BitLocker Drive Encryption. - * + * * @return the bitLockerStatus value. */ public String bitLockerStatus() { @@ -251,7 +227,7 @@ public String bitLockerStatus() { /** * Set the bitLockerStatus property: On or Off of BitLocker Drive Encryption. - * + * * @param bitLockerStatus the bitLockerStatus value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -262,7 +238,7 @@ public MicrosoftGraphDeviceHealthAttestationState withBitLockerStatus(String bit /** * Get the bootAppSecurityVersion property: The security version number of the Boot Application. - * + * * @return the bootAppSecurityVersion value. */ public String bootAppSecurityVersion() { @@ -271,7 +247,7 @@ public String bootAppSecurityVersion() { /** * Set the bootAppSecurityVersion property: The security version number of the Boot Application. - * + * * @param bootAppSecurityVersion the bootAppSecurityVersion value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -282,7 +258,7 @@ public MicrosoftGraphDeviceHealthAttestationState withBootAppSecurityVersion(Str /** * Get the bootDebugging property: When bootDebugging is enabled, the device is used in development and testing. - * + * * @return the bootDebugging value. */ public String bootDebugging() { @@ -291,7 +267,7 @@ public String bootDebugging() { /** * Set the bootDebugging property: When bootDebugging is enabled, the device is used in development and testing. - * + * * @param bootDebugging the bootDebugging value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -302,7 +278,7 @@ public MicrosoftGraphDeviceHealthAttestationState withBootDebugging(String bootD /** * Get the bootManagerSecurityVersion property: The security version number of the Boot Application. - * + * * @return the bootManagerSecurityVersion value. */ public String bootManagerSecurityVersion() { @@ -311,19 +287,19 @@ public String bootManagerSecurityVersion() { /** * Set the bootManagerSecurityVersion property: The security version number of the Boot Application. - * + * * @param bootManagerSecurityVersion the bootManagerSecurityVersion value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ - public MicrosoftGraphDeviceHealthAttestationState withBootManagerSecurityVersion( - String bootManagerSecurityVersion) { + public MicrosoftGraphDeviceHealthAttestationState + withBootManagerSecurityVersion(String bootManagerSecurityVersion) { this.bootManagerSecurityVersion = bootManagerSecurityVersion; return this; } /** * Get the bootManagerVersion property: The version of the Boot Manager. - * + * * @return the bootManagerVersion value. */ public String bootManagerVersion() { @@ -332,7 +308,7 @@ public String bootManagerVersion() { /** * Set the bootManagerVersion property: The version of the Boot Manager. - * + * * @param bootManagerVersion the bootManagerVersion value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -344,7 +320,7 @@ public MicrosoftGraphDeviceHealthAttestationState withBootManagerVersion(String /** * Get the bootRevisionListInfo property: The Boot Revision List that was loaded during initial boot on the attested * device. - * + * * @return the bootRevisionListInfo value. */ public String bootRevisionListInfo() { @@ -354,7 +330,7 @@ public String bootRevisionListInfo() { /** * Set the bootRevisionListInfo property: The Boot Revision List that was loaded during initial boot on the attested * device. - * + * * @param bootRevisionListInfo the bootRevisionListInfo value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -366,7 +342,7 @@ public MicrosoftGraphDeviceHealthAttestationState withBootRevisionListInfo(Strin /** * Get the codeIntegrity property: When code integrity is enabled, code execution is restricted to integrity * verified code. - * + * * @return the codeIntegrity value. */ public String codeIntegrity() { @@ -376,7 +352,7 @@ public String codeIntegrity() { /** * Set the codeIntegrity property: When code integrity is enabled, code execution is restricted to integrity * verified code. - * + * * @param codeIntegrity the codeIntegrity value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -387,7 +363,7 @@ public MicrosoftGraphDeviceHealthAttestationState withCodeIntegrity(String codeI /** * Get the codeIntegrityCheckVersion property: The version of the Boot Manager. - * + * * @return the codeIntegrityCheckVersion value. */ public String codeIntegrityCheckVersion() { @@ -396,7 +372,7 @@ public String codeIntegrityCheckVersion() { /** * Set the codeIntegrityCheckVersion property: The version of the Boot Manager. - * + * * @param codeIntegrityCheckVersion the codeIntegrityCheckVersion value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -408,7 +384,7 @@ public MicrosoftGraphDeviceHealthAttestationState withCodeIntegrityCheckVersion( /** * Get the codeIntegrityPolicy property: The Code Integrity policy that is controlling the security of the boot * environment. - * + * * @return the codeIntegrityPolicy value. */ public String codeIntegrityPolicy() { @@ -418,7 +394,7 @@ public String codeIntegrityPolicy() { /** * Set the codeIntegrityPolicy property: The Code Integrity policy that is controlling the security of the boot * environment. - * + * * @param codeIntegrityPolicy the codeIntegrityPolicy value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -429,7 +405,7 @@ public MicrosoftGraphDeviceHealthAttestationState withCodeIntegrityPolicy(String /** * Get the contentNamespaceUrl property: The DHA report version. (Namespace version). - * + * * @return the contentNamespaceUrl value. */ public String contentNamespaceUrl() { @@ -438,7 +414,7 @@ public String contentNamespaceUrl() { /** * Set the contentNamespaceUrl property: The DHA report version. (Namespace version). - * + * * @param contentNamespaceUrl the contentNamespaceUrl value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -449,7 +425,7 @@ public MicrosoftGraphDeviceHealthAttestationState withContentNamespaceUrl(String /** * Get the contentVersion property: The HealthAttestation state schema version. - * + * * @return the contentVersion value. */ public String contentVersion() { @@ -458,7 +434,7 @@ public String contentVersion() { /** * Set the contentVersion property: The HealthAttestation state schema version. - * + * * @param contentVersion the contentVersion value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -470,7 +446,7 @@ public MicrosoftGraphDeviceHealthAttestationState withContentVersion(String cont /** * Get the dataExcutionPolicy property: DEP Policy defines a set of hardware and software technologies that perform * additional checks on memory. - * + * * @return the dataExcutionPolicy value. */ public String dataExcutionPolicy() { @@ -480,7 +456,7 @@ public String dataExcutionPolicy() { /** * Set the dataExcutionPolicy property: DEP Policy defines a set of hardware and software technologies that perform * additional checks on memory. - * + * * @param dataExcutionPolicy the dataExcutionPolicy value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -491,7 +467,7 @@ public MicrosoftGraphDeviceHealthAttestationState withDataExcutionPolicy(String /** * Get the deviceHealthAttestationStatus property: The DHA report version. (Namespace version). - * + * * @return the deviceHealthAttestationStatus value. */ public String deviceHealthAttestationStatus() { @@ -500,12 +476,12 @@ public String deviceHealthAttestationStatus() { /** * Set the deviceHealthAttestationStatus property: The DHA report version. (Namespace version). - * + * * @param deviceHealthAttestationStatus the deviceHealthAttestationStatus value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ - public MicrosoftGraphDeviceHealthAttestationState withDeviceHealthAttestationStatus( - String deviceHealthAttestationStatus) { + public MicrosoftGraphDeviceHealthAttestationState + withDeviceHealthAttestationStatus(String deviceHealthAttestationStatus) { this.deviceHealthAttestationStatus = deviceHealthAttestationStatus; return this; } @@ -513,7 +489,7 @@ public MicrosoftGraphDeviceHealthAttestationState withDeviceHealthAttestationSta /** * Get the earlyLaunchAntiMalwareDriverProtection property: ELAM provides protection for the computers in your * network when they start up. - * + * * @return the earlyLaunchAntiMalwareDriverProtection value. */ public String earlyLaunchAntiMalwareDriverProtection() { @@ -523,19 +499,19 @@ public String earlyLaunchAntiMalwareDriverProtection() { /** * Set the earlyLaunchAntiMalwareDriverProtection property: ELAM provides protection for the computers in your * network when they start up. - * + * * @param earlyLaunchAntiMalwareDriverProtection the earlyLaunchAntiMalwareDriverProtection value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ - public MicrosoftGraphDeviceHealthAttestationState withEarlyLaunchAntiMalwareDriverProtection( - String earlyLaunchAntiMalwareDriverProtection) { + public MicrosoftGraphDeviceHealthAttestationState + withEarlyLaunchAntiMalwareDriverProtection(String earlyLaunchAntiMalwareDriverProtection) { this.earlyLaunchAntiMalwareDriverProtection = earlyLaunchAntiMalwareDriverProtection; return this; } /** * Get the healthAttestationSupportedStatus property: This attribute indicates if DHA is supported for the device. - * + * * @return the healthAttestationSupportedStatus value. */ public String healthAttestationSupportedStatus() { @@ -544,19 +520,19 @@ public String healthAttestationSupportedStatus() { /** * Set the healthAttestationSupportedStatus property: This attribute indicates if DHA is supported for the device. - * + * * @param healthAttestationSupportedStatus the healthAttestationSupportedStatus value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ - public MicrosoftGraphDeviceHealthAttestationState withHealthAttestationSupportedStatus( - String healthAttestationSupportedStatus) { + public MicrosoftGraphDeviceHealthAttestationState + withHealthAttestationSupportedStatus(String healthAttestationSupportedStatus) { this.healthAttestationSupportedStatus = healthAttestationSupportedStatus; return this; } /** * Get the healthStatusMismatchInfo property: This attribute appears if DHA-Service detects an integrity issue. - * + * * @return the healthStatusMismatchInfo value. */ public String healthStatusMismatchInfo() { @@ -565,7 +541,7 @@ public String healthStatusMismatchInfo() { /** * Set the healthStatusMismatchInfo property: This attribute appears if DHA-Service detects an integrity issue. - * + * * @param healthStatusMismatchInfo the healthStatusMismatchInfo value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -576,7 +552,7 @@ public MicrosoftGraphDeviceHealthAttestationState withHealthStatusMismatchInfo(S /** * Get the issuedDateTime property: The DateTime when device was evaluated or issued to MDM. - * + * * @return the issuedDateTime value. */ public OffsetDateTime issuedDateTime() { @@ -585,7 +561,7 @@ public OffsetDateTime issuedDateTime() { /** * Set the issuedDateTime property: The DateTime when device was evaluated or issued to MDM. - * + * * @param issuedDateTime the issuedDateTime value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -596,7 +572,7 @@ public MicrosoftGraphDeviceHealthAttestationState withIssuedDateTime(OffsetDateT /** * Get the lastUpdateDateTime property: The Timestamp of the last update. - * + * * @return the lastUpdateDateTime value. */ public String lastUpdateDateTime() { @@ -605,7 +581,7 @@ public String lastUpdateDateTime() { /** * Set the lastUpdateDateTime property: The Timestamp of the last update. - * + * * @param lastUpdateDateTime the lastUpdateDateTime value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -617,7 +593,7 @@ public MicrosoftGraphDeviceHealthAttestationState withLastUpdateDateTime(String /** * Get the operatingSystemKernelDebugging property: When operatingSystemKernelDebugging is enabled, the device is * used in development and testing. - * + * * @return the operatingSystemKernelDebugging value. */ public String operatingSystemKernelDebugging() { @@ -627,12 +603,12 @@ public String operatingSystemKernelDebugging() { /** * Set the operatingSystemKernelDebugging property: When operatingSystemKernelDebugging is enabled, the device is * used in development and testing. - * + * * @param operatingSystemKernelDebugging the operatingSystemKernelDebugging value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ - public MicrosoftGraphDeviceHealthAttestationState withOperatingSystemKernelDebugging( - String operatingSystemKernelDebugging) { + public MicrosoftGraphDeviceHealthAttestationState + withOperatingSystemKernelDebugging(String operatingSystemKernelDebugging) { this.operatingSystemKernelDebugging = operatingSystemKernelDebugging; return this; } @@ -640,7 +616,7 @@ public MicrosoftGraphDeviceHealthAttestationState withOperatingSystemKernelDebug /** * Get the operatingSystemRevListInfo property: The Operating System Revision List that was loaded during initial * boot on the attested device. - * + * * @return the operatingSystemRevListInfo value. */ public String operatingSystemRevListInfo() { @@ -650,19 +626,19 @@ public String operatingSystemRevListInfo() { /** * Set the operatingSystemRevListInfo property: The Operating System Revision List that was loaded during initial * boot on the attested device. - * + * * @param operatingSystemRevListInfo the operatingSystemRevListInfo value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ - public MicrosoftGraphDeviceHealthAttestationState withOperatingSystemRevListInfo( - String operatingSystemRevListInfo) { + public MicrosoftGraphDeviceHealthAttestationState + withOperatingSystemRevListInfo(String operatingSystemRevListInfo) { this.operatingSystemRevListInfo = operatingSystemRevListInfo; return this; } /** * Get the pcr0 property: The measurement that is captured in PCR[0]. - * + * * @return the pcr0 value. */ public String pcr0() { @@ -671,7 +647,7 @@ public String pcr0() { /** * Set the pcr0 property: The measurement that is captured in PCR[0]. - * + * * @param pcr0 the pcr0 value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -683,7 +659,7 @@ public MicrosoftGraphDeviceHealthAttestationState withPcr0(String pcr0) { /** * Get the pcrHashAlgorithm property: Informational attribute that identifies the HASH algorithm that was used by * TPM. - * + * * @return the pcrHashAlgorithm value. */ public String pcrHashAlgorithm() { @@ -693,7 +669,7 @@ public String pcrHashAlgorithm() { /** * Set the pcrHashAlgorithm property: Informational attribute that identifies the HASH algorithm that was used by * TPM. - * + * * @param pcrHashAlgorithm the pcrHashAlgorithm value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -704,7 +680,7 @@ public MicrosoftGraphDeviceHealthAttestationState withPcrHashAlgorithm(String pc /** * Get the resetCount property: The number of times a PC device has hibernated or resumed. - * + * * @return the resetCount value. */ public Long resetCount() { @@ -713,7 +689,7 @@ public Long resetCount() { /** * Set the resetCount property: The number of times a PC device has hibernated or resumed. - * + * * @param resetCount the resetCount value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -724,7 +700,7 @@ public MicrosoftGraphDeviceHealthAttestationState withResetCount(Long resetCount /** * Get the restartCount property: The number of times a PC device has rebooted. - * + * * @return the restartCount value. */ public Long restartCount() { @@ -733,7 +709,7 @@ public Long restartCount() { /** * Set the restartCount property: The number of times a PC device has rebooted. - * + * * @param restartCount the restartCount value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -745,7 +721,7 @@ public MicrosoftGraphDeviceHealthAttestationState withRestartCount(Long restartC /** * Get the safeMode property: Safe mode is a troubleshooting option for Windows that starts your computer in a * limited state. - * + * * @return the safeMode value. */ public String safeMode() { @@ -755,7 +731,7 @@ public String safeMode() { /** * Set the safeMode property: Safe mode is a troubleshooting option for Windows that starts your computer in a * limited state. - * + * * @param safeMode the safeMode value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -767,7 +743,7 @@ public MicrosoftGraphDeviceHealthAttestationState withSafeMode(String safeMode) /** * Get the secureBoot property: When Secure Boot is enabled, the core components must have the correct cryptographic * signatures. - * + * * @return the secureBoot value. */ public String secureBoot() { @@ -777,7 +753,7 @@ public String secureBoot() { /** * Set the secureBoot property: When Secure Boot is enabled, the core components must have the correct cryptographic * signatures. - * + * * @param secureBoot the secureBoot value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -789,7 +765,7 @@ public MicrosoftGraphDeviceHealthAttestationState withSecureBoot(String secureBo /** * Get the secureBootConfigurationPolicyFingerPrint property: Fingerprint of the Custom Secure Boot Configuration * Policy. - * + * * @return the secureBootConfigurationPolicyFingerPrint value. */ public String secureBootConfigurationPolicyFingerPrint() { @@ -799,12 +775,12 @@ public String secureBootConfigurationPolicyFingerPrint() { /** * Set the secureBootConfigurationPolicyFingerPrint property: Fingerprint of the Custom Secure Boot Configuration * Policy. - * + * * @param secureBootConfigurationPolicyFingerPrint the secureBootConfigurationPolicyFingerPrint value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ - public MicrosoftGraphDeviceHealthAttestationState withSecureBootConfigurationPolicyFingerPrint( - String secureBootConfigurationPolicyFingerPrint) { + public MicrosoftGraphDeviceHealthAttestationState + withSecureBootConfigurationPolicyFingerPrint(String secureBootConfigurationPolicyFingerPrint) { this.secureBootConfigurationPolicyFingerPrint = secureBootConfigurationPolicyFingerPrint; return this; } @@ -812,7 +788,7 @@ public MicrosoftGraphDeviceHealthAttestationState withSecureBootConfigurationPol /** * Get the testSigning property: When test signing is allowed, the device does not enforce signature validation * during boot. - * + * * @return the testSigning value. */ public String testSigning() { @@ -822,7 +798,7 @@ public String testSigning() { /** * Set the testSigning property: When test signing is allowed, the device does not enforce signature validation * during boot. - * + * * @param testSigning the testSigning value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -833,7 +809,7 @@ public MicrosoftGraphDeviceHealthAttestationState withTestSigning(String testSig /** * Get the tpmVersion property: The security version number of the Boot Application. - * + * * @return the tpmVersion value. */ public String tpmVersion() { @@ -842,7 +818,7 @@ public String tpmVersion() { /** * Set the tpmVersion property: The security version number of the Boot Application. - * + * * @param tpmVersion the tpmVersion value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -853,7 +829,7 @@ public MicrosoftGraphDeviceHealthAttestationState withTpmVersion(String tpmVersi /** * Get the virtualSecureMode property: VSM is a container that protects high value assets from a compromised kernel. - * + * * @return the virtualSecureMode value. */ public String virtualSecureMode() { @@ -862,7 +838,7 @@ public String virtualSecureMode() { /** * Set the virtualSecureMode property: VSM is a container that protects high value assets from a compromised kernel. - * + * * @param virtualSecureMode the virtualSecureMode value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -874,7 +850,7 @@ public MicrosoftGraphDeviceHealthAttestationState withVirtualSecureMode(String v /** * Get the windowsPE property: Operating system running with limited services that is used to prepare a computer for * Windows. - * + * * @return the windowsPE value. */ public String windowsPE() { @@ -884,7 +860,7 @@ public String windowsPE() { /** * Set the windowsPE property: Operating system running with limited services that is used to prepare a computer for * Windows. - * + * * @param windowsPE the windowsPE value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ @@ -895,39 +871,186 @@ public MicrosoftGraphDeviceHealthAttestationState withWindowsPE(String windowsPE /** * Get the additionalProperties property: deviceHealthAttestationState. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: deviceHealthAttestationState. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDeviceHealthAttestationState object itself. */ - public MicrosoftGraphDeviceHealthAttestationState withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphDeviceHealthAttestationState + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("attestationIdentityKey", this.attestationIdentityKey); + jsonWriter.writeStringField("bitLockerStatus", this.bitLockerStatus); + jsonWriter.writeStringField("bootAppSecurityVersion", this.bootAppSecurityVersion); + jsonWriter.writeStringField("bootDebugging", this.bootDebugging); + jsonWriter.writeStringField("bootManagerSecurityVersion", this.bootManagerSecurityVersion); + jsonWriter.writeStringField("bootManagerVersion", this.bootManagerVersion); + jsonWriter.writeStringField("bootRevisionListInfo", this.bootRevisionListInfo); + jsonWriter.writeStringField("codeIntegrity", this.codeIntegrity); + jsonWriter.writeStringField("codeIntegrityCheckVersion", this.codeIntegrityCheckVersion); + jsonWriter.writeStringField("codeIntegrityPolicy", this.codeIntegrityPolicy); + jsonWriter.writeStringField("contentNamespaceUrl", this.contentNamespaceUrl); + jsonWriter.writeStringField("contentVersion", this.contentVersion); + jsonWriter.writeStringField("dataExcutionPolicy", this.dataExcutionPolicy); + jsonWriter.writeStringField("deviceHealthAttestationStatus", this.deviceHealthAttestationStatus); + jsonWriter.writeStringField("earlyLaunchAntiMalwareDriverProtection", + this.earlyLaunchAntiMalwareDriverProtection); + jsonWriter.writeStringField("healthAttestationSupportedStatus", this.healthAttestationSupportedStatus); + jsonWriter.writeStringField("healthStatusMismatchInfo", this.healthStatusMismatchInfo); + jsonWriter.writeStringField("issuedDateTime", + this.issuedDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.issuedDateTime)); + jsonWriter.writeStringField("lastUpdateDateTime", this.lastUpdateDateTime); + jsonWriter.writeStringField("operatingSystemKernelDebugging", this.operatingSystemKernelDebugging); + jsonWriter.writeStringField("operatingSystemRevListInfo", this.operatingSystemRevListInfo); + jsonWriter.writeStringField("pcr0", this.pcr0); + jsonWriter.writeStringField("pcrHashAlgorithm", this.pcrHashAlgorithm); + jsonWriter.writeNumberField("resetCount", this.resetCount); + jsonWriter.writeNumberField("restartCount", this.restartCount); + jsonWriter.writeStringField("safeMode", this.safeMode); + jsonWriter.writeStringField("secureBoot", this.secureBoot); + jsonWriter.writeStringField("secureBootConfigurationPolicyFingerPrint", + this.secureBootConfigurationPolicyFingerPrint); + jsonWriter.writeStringField("testSigning", this.testSigning); + jsonWriter.writeStringField("tpmVersion", this.tpmVersion); + jsonWriter.writeStringField("virtualSecureMode", this.virtualSecureMode); + jsonWriter.writeStringField("windowsPE", this.windowsPE); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDeviceHealthAttestationState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDeviceHealthAttestationState 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 MicrosoftGraphDeviceHealthAttestationState. + */ + public static MicrosoftGraphDeviceHealthAttestationState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDeviceHealthAttestationState deserializedMicrosoftGraphDeviceHealthAttestationState + = new MicrosoftGraphDeviceHealthAttestationState(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attestationIdentityKey".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.attestationIdentityKey = reader.getString(); + } else if ("bitLockerStatus".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.bitLockerStatus = reader.getString(); + } else if ("bootAppSecurityVersion".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.bootAppSecurityVersion = reader.getString(); + } else if ("bootDebugging".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.bootDebugging = reader.getString(); + } else if ("bootManagerSecurityVersion".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.bootManagerSecurityVersion + = reader.getString(); + } else if ("bootManagerVersion".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.bootManagerVersion = reader.getString(); + } else if ("bootRevisionListInfo".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.bootRevisionListInfo = reader.getString(); + } else if ("codeIntegrity".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.codeIntegrity = reader.getString(); + } else if ("codeIntegrityCheckVersion".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.codeIntegrityCheckVersion + = reader.getString(); + } else if ("codeIntegrityPolicy".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.codeIntegrityPolicy = reader.getString(); + } else if ("contentNamespaceUrl".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.contentNamespaceUrl = reader.getString(); + } else if ("contentVersion".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.contentVersion = reader.getString(); + } else if ("dataExcutionPolicy".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.dataExcutionPolicy = reader.getString(); + } else if ("deviceHealthAttestationStatus".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.deviceHealthAttestationStatus + = reader.getString(); + } else if ("earlyLaunchAntiMalwareDriverProtection".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.earlyLaunchAntiMalwareDriverProtection + = reader.getString(); + } else if ("healthAttestationSupportedStatus".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.healthAttestationSupportedStatus + = reader.getString(); + } else if ("healthStatusMismatchInfo".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.healthStatusMismatchInfo + = reader.getString(); + } else if ("issuedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.issuedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastUpdateDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.lastUpdateDateTime = reader.getString(); + } else if ("operatingSystemKernelDebugging".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.operatingSystemKernelDebugging + = reader.getString(); + } else if ("operatingSystemRevListInfo".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.operatingSystemRevListInfo + = reader.getString(); + } else if ("pcr0".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.pcr0 = reader.getString(); + } else if ("pcrHashAlgorithm".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.pcrHashAlgorithm = reader.getString(); + } else if ("resetCount".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.resetCount + = reader.getNullable(JsonReader::getLong); + } else if ("restartCount".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.restartCount + = reader.getNullable(JsonReader::getLong); + } else if ("safeMode".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.safeMode = reader.getString(); + } else if ("secureBoot".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.secureBoot = reader.getString(); + } else if ("secureBootConfigurationPolicyFingerPrint".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.secureBootConfigurationPolicyFingerPrint + = reader.getString(); + } else if ("testSigning".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.testSigning = reader.getString(); + } else if ("tpmVersion".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.tpmVersion = reader.getString(); + } else if ("virtualSecureMode".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.virtualSecureMode = reader.getString(); + } else if ("windowsPE".equals(fieldName)) { + deserializedMicrosoftGraphDeviceHealthAttestationState.windowsPE = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDeviceHealthAttestationState.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDeviceHealthAttestationState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementExchangeAccessState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementExchangeAccessState.java index 4f352f3d49459..d7d127f46fef6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementExchangeAccessState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementExchangeAccessState.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** deviceManagementExchangeAccessState. */ +/** + * deviceManagementExchangeAccessState. + */ public final class MicrosoftGraphDeviceManagementExchangeAccessState extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphDeviceManagementExchangeAccessState. */ + /** + * Static value none for MicrosoftGraphDeviceManagementExchangeAccessState. + */ public static final MicrosoftGraphDeviceManagementExchangeAccessState NONE = fromString("none"); - /** Static value unknown for MicrosoftGraphDeviceManagementExchangeAccessState. */ + /** + * Static value unknown for MicrosoftGraphDeviceManagementExchangeAccessState. + */ public static final MicrosoftGraphDeviceManagementExchangeAccessState UNKNOWN = fromString("unknown"); - /** Static value allowed for MicrosoftGraphDeviceManagementExchangeAccessState. */ + /** + * Static value allowed for MicrosoftGraphDeviceManagementExchangeAccessState. + */ public static final MicrosoftGraphDeviceManagementExchangeAccessState ALLOWED = fromString("allowed"); - /** Static value blocked for MicrosoftGraphDeviceManagementExchangeAccessState. */ + /** + * Static value blocked for MicrosoftGraphDeviceManagementExchangeAccessState. + */ public static final MicrosoftGraphDeviceManagementExchangeAccessState BLOCKED = fromString("blocked"); - /** Static value quarantined for MicrosoftGraphDeviceManagementExchangeAccessState. */ + /** + * Static value quarantined for MicrosoftGraphDeviceManagementExchangeAccessState. + */ public static final MicrosoftGraphDeviceManagementExchangeAccessState QUARANTINED = fromString("quarantined"); /** * Creates a new instance of MicrosoftGraphDeviceManagementExchangeAccessState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public MicrosoftGraphDeviceManagementExchangeAccessState() { /** * Creates or finds a MicrosoftGraphDeviceManagementExchangeAccessState from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphDeviceManagementExchangeAccessState. */ - @JsonCreator public static MicrosoftGraphDeviceManagementExchangeAccessState fromString(String name) { return fromString(name, MicrosoftGraphDeviceManagementExchangeAccessState.class); } /** * Gets known MicrosoftGraphDeviceManagementExchangeAccessState values. - * + * * @return known MicrosoftGraphDeviceManagementExchangeAccessState values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementExchangeAccessStateReason.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementExchangeAccessStateReason.java index fa6aea0c37f3e..8974d1906ee69 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementExchangeAccessStateReason.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementExchangeAccessStateReason.java @@ -5,75 +5,108 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** deviceManagementExchangeAccessStateReason. */ +/** + * deviceManagementExchangeAccessStateReason. + */ public final class MicrosoftGraphDeviceManagementExchangeAccessStateReason extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ + /** + * Static value none for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason NONE = fromString("none"); - /** Static value unknown for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ + /** + * Static value unknown for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason UNKNOWN = fromString("unknown"); - /** Static value exchangeGlobalRule for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason EXCHANGE_GLOBAL_RULE = - fromString("exchangeGlobalRule"); + /** + * Static value exchangeGlobalRule for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason EXCHANGE_GLOBAL_RULE + = fromString("exchangeGlobalRule"); - /** Static value exchangeIndividualRule for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason EXCHANGE_INDIVIDUAL_RULE = - fromString("exchangeIndividualRule"); + /** + * Static value exchangeIndividualRule for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason EXCHANGE_INDIVIDUAL_RULE + = fromString("exchangeIndividualRule"); - /** Static value exchangeDeviceRule for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason EXCHANGE_DEVICE_RULE = - fromString("exchangeDeviceRule"); + /** + * Static value exchangeDeviceRule for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason EXCHANGE_DEVICE_RULE + = fromString("exchangeDeviceRule"); - /** Static value exchangeUpgrade for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason EXCHANGE_UPGRADE = - fromString("exchangeUpgrade"); + /** + * Static value exchangeUpgrade for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason EXCHANGE_UPGRADE + = fromString("exchangeUpgrade"); - /** Static value exchangeMailboxPolicy for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason EXCHANGE_MAILBOX_POLICY = - fromString("exchangeMailboxPolicy"); + /** + * Static value exchangeMailboxPolicy for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason EXCHANGE_MAILBOX_POLICY + = fromString("exchangeMailboxPolicy"); - /** Static value other for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ + /** + * Static value other for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason OTHER = fromString("other"); - /** Static value compliant for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ + /** + * Static value compliant for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason COMPLIANT = fromString("compliant"); - /** Static value notCompliant for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason NOT_COMPLIANT = - fromString("notCompliant"); + /** + * Static value notCompliant for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason NOT_COMPLIANT + = fromString("notCompliant"); - /** Static value notEnrolled for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason NOT_ENROLLED = - fromString("notEnrolled"); + /** + * Static value notEnrolled for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason NOT_ENROLLED + = fromString("notEnrolled"); - /** Static value unknownLocation for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason UNKNOWN_LOCATION = - fromString("unknownLocation"); + /** + * Static value unknownLocation for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason UNKNOWN_LOCATION + = fromString("unknownLocation"); - /** Static value mfaRequired for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason MFA_REQUIRED = - fromString("mfaRequired"); + /** + * Static value mfaRequired for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason MFA_REQUIRED + = fromString("mfaRequired"); - /** Static value azureADBlockDueToAccessPolicy for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason AZURE_ADBLOCK_DUE_TO_ACCESS_POLICY = - fromString("azureADBlockDueToAccessPolicy"); + /** + * Static value azureADBlockDueToAccessPolicy for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason AZURE_ADBLOCK_DUE_TO_ACCESS_POLICY + = fromString("azureADBlockDueToAccessPolicy"); - /** Static value compromisedPassword for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason COMPROMISED_PASSWORD = - fromString("compromisedPassword"); + /** + * Static value compromisedPassword for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason COMPROMISED_PASSWORD + = fromString("compromisedPassword"); - /** Static value deviceNotKnownWithManagedApp for MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason DEVICE_NOT_KNOWN_WITH_MANAGED_APP = - fromString("deviceNotKnownWithManagedApp"); + /** + * Static value deviceNotKnownWithManagedApp for MicrosoftGraphDeviceManagementExchangeAccessStateReason. + */ + public static final MicrosoftGraphDeviceManagementExchangeAccessStateReason DEVICE_NOT_KNOWN_WITH_MANAGED_APP + = fromString("deviceNotKnownWithManagedApp"); /** * Creates a new instance of MicrosoftGraphDeviceManagementExchangeAccessStateReason value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -82,18 +115,17 @@ public MicrosoftGraphDeviceManagementExchangeAccessStateReason() { /** * Creates or finds a MicrosoftGraphDeviceManagementExchangeAccessStateReason from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphDeviceManagementExchangeAccessStateReason. */ - @JsonCreator public static MicrosoftGraphDeviceManagementExchangeAccessStateReason fromString(String name) { return fromString(name, MicrosoftGraphDeviceManagementExchangeAccessStateReason.class); } /** * Gets known MicrosoftGraphDeviceManagementExchangeAccessStateReason values. - * + * * @return known MicrosoftGraphDeviceManagementExchangeAccessStateReason values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementTroubleshootingEvent.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementTroubleshootingEvent.java index d3ece5aa62ba2..4ba66d1d68b19 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementTroubleshootingEvent.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceManagementTroubleshootingEvent.java @@ -5,45 +5,47 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; /** * deviceManagementTroubleshootingEvent - * - *

Event representing an general failure. + * + * Event representing an general failure. */ @Fluent public final class MicrosoftGraphDeviceManagementTroubleshootingEvent extends MicrosoftGraphEntity { /* * Id used for tracing the failure in the service. */ - @JsonProperty(value = "correlationId") private String correlationId; /* * Time when the event occurred . */ - @JsonProperty(value = "eventDateTime") private OffsetDateTime eventDateTime; /* * Event representing an general failure. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDeviceManagementTroubleshootingEvent class. */ + /** + * Creates an instance of MicrosoftGraphDeviceManagementTroubleshootingEvent class. + */ public MicrosoftGraphDeviceManagementTroubleshootingEvent() { } /** * Get the correlationId property: Id used for tracing the failure in the service. - * + * * @return the correlationId value. */ public String correlationId() { @@ -52,7 +54,7 @@ public String correlationId() { /** * Set the correlationId property: Id used for tracing the failure in the service. - * + * * @param correlationId the correlationId value to set. * @return the MicrosoftGraphDeviceManagementTroubleshootingEvent object itself. */ @@ -63,7 +65,7 @@ public MicrosoftGraphDeviceManagementTroubleshootingEvent withCorrelationId(Stri /** * Get the eventDateTime property: Time when the event occurred . - * + * * @return the eventDateTime value. */ public OffsetDateTime eventDateTime() { @@ -72,7 +74,7 @@ public OffsetDateTime eventDateTime() { /** * Set the eventDateTime property: Time when the event occurred . - * + * * @param eventDateTime the eventDateTime value to set. * @return the MicrosoftGraphDeviceManagementTroubleshootingEvent object itself. */ @@ -83,35 +85,28 @@ public MicrosoftGraphDeviceManagementTroubleshootingEvent withEventDateTime(Offs /** * Get the additionalProperties property: Event representing an general failure. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Event representing an general failure. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDeviceManagementTroubleshootingEvent object itself. */ - public MicrosoftGraphDeviceManagementTroubleshootingEvent withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphDeviceManagementTroubleshootingEvent + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDeviceManagementTroubleshootingEvent withId(String id) { super.withId(id); @@ -120,11 +115,68 @@ public MicrosoftGraphDeviceManagementTroubleshootingEvent withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("correlationId", this.correlationId); + jsonWriter.writeStringField("eventDateTime", + this.eventDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.eventDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDeviceManagementTroubleshootingEvent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDeviceManagementTroubleshootingEvent 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 MicrosoftGraphDeviceManagementTroubleshootingEvent. + */ + public static MicrosoftGraphDeviceManagementTroubleshootingEvent fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDeviceManagementTroubleshootingEvent deserializedMicrosoftGraphDeviceManagementTroubleshootingEvent + = new MicrosoftGraphDeviceManagementTroubleshootingEvent(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDeviceManagementTroubleshootingEvent.withId(reader.getString()); + } else if ("correlationId".equals(fieldName)) { + deserializedMicrosoftGraphDeviceManagementTroubleshootingEvent.correlationId = reader.getString(); + } else if ("eventDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDeviceManagementTroubleshootingEvent.eventDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDeviceManagementTroubleshootingEvent.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDeviceManagementTroubleshootingEvent; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceRegistrationState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceRegistrationState.java index 63675781bb63f..ce789463eb9f5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceRegistrationState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDeviceRegistrationState.java @@ -5,40 +5,57 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** deviceRegistrationState. */ +/** + * deviceRegistrationState. + */ public final class MicrosoftGraphDeviceRegistrationState extends ExpandableStringEnum { - /** Static value notRegistered for MicrosoftGraphDeviceRegistrationState. */ + /** + * Static value notRegistered for MicrosoftGraphDeviceRegistrationState. + */ public static final MicrosoftGraphDeviceRegistrationState NOT_REGISTERED = fromString("notRegistered"); - /** Static value registered for MicrosoftGraphDeviceRegistrationState. */ + /** + * Static value registered for MicrosoftGraphDeviceRegistrationState. + */ public static final MicrosoftGraphDeviceRegistrationState REGISTERED = fromString("registered"); - /** Static value revoked for MicrosoftGraphDeviceRegistrationState. */ + /** + * Static value revoked for MicrosoftGraphDeviceRegistrationState. + */ public static final MicrosoftGraphDeviceRegistrationState REVOKED = fromString("revoked"); - /** Static value keyConflict for MicrosoftGraphDeviceRegistrationState. */ + /** + * Static value keyConflict for MicrosoftGraphDeviceRegistrationState. + */ public static final MicrosoftGraphDeviceRegistrationState KEY_CONFLICT = fromString("keyConflict"); - /** Static value approvalPending for MicrosoftGraphDeviceRegistrationState. */ + /** + * Static value approvalPending for MicrosoftGraphDeviceRegistrationState. + */ public static final MicrosoftGraphDeviceRegistrationState APPROVAL_PENDING = fromString("approvalPending"); - /** Static value certificateReset for MicrosoftGraphDeviceRegistrationState. */ + /** + * Static value certificateReset for MicrosoftGraphDeviceRegistrationState. + */ public static final MicrosoftGraphDeviceRegistrationState CERTIFICATE_RESET = fromString("certificateReset"); - /** Static value notRegisteredPendingEnrollment for MicrosoftGraphDeviceRegistrationState. */ - public static final MicrosoftGraphDeviceRegistrationState NOT_REGISTERED_PENDING_ENROLLMENT = - fromString("notRegisteredPendingEnrollment"); + /** + * Static value notRegisteredPendingEnrollment for MicrosoftGraphDeviceRegistrationState. + */ + public static final MicrosoftGraphDeviceRegistrationState NOT_REGISTERED_PENDING_ENROLLMENT + = fromString("notRegisteredPendingEnrollment"); - /** Static value unknown for MicrosoftGraphDeviceRegistrationState. */ + /** + * Static value unknown for MicrosoftGraphDeviceRegistrationState. + */ public static final MicrosoftGraphDeviceRegistrationState UNKNOWN = fromString("unknown"); /** * Creates a new instance of MicrosoftGraphDeviceRegistrationState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -47,18 +64,17 @@ public MicrosoftGraphDeviceRegistrationState() { /** * Creates or finds a MicrosoftGraphDeviceRegistrationState from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphDeviceRegistrationState. */ - @JsonCreator public static MicrosoftGraphDeviceRegistrationState fromString(String name) { return fromString(name, MicrosoftGraphDeviceRegistrationState.class); } /** * Gets known MicrosoftGraphDeviceRegistrationState values. - * + * * @return known MicrosoftGraphDeviceRegistrationState values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectory.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectory.java index 4aec212a986ab..4c84961851e62 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectory.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectory.java @@ -5,41 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** directory. */ +/** + * directory. + */ @Fluent public final class MicrosoftGraphDirectory extends MicrosoftGraphEntity { /* * The administrativeUnits property. */ - @JsonProperty(value = "administrativeUnits") private List administrativeUnits; /* * Recently deleted items. Read-only. Nullable. */ - @JsonProperty(value = "deletedItems") private List deletedItems; /* * directory */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDirectory class. */ + /** + * Creates an instance of MicrosoftGraphDirectory class. + */ public MicrosoftGraphDirectory() { } /** * Get the administrativeUnits property: The administrativeUnits property. - * + * * @return the administrativeUnits value. */ public List administrativeUnits() { @@ -48,7 +50,7 @@ public List administrativeUnits() { /** * Set the administrativeUnits property: The administrativeUnits property. - * + * * @param administrativeUnits the administrativeUnits value to set. * @return the MicrosoftGraphDirectory object itself. */ @@ -59,7 +61,7 @@ public MicrosoftGraphDirectory withAdministrativeUnits(List deletedItems() { @@ -68,7 +70,7 @@ public List deletedItems() { /** * Set the deletedItems property: Recently deleted items. Read-only. Nullable. - * + * * @param deletedItems the deletedItems value to set. * @return the MicrosoftGraphDirectory object itself. */ @@ -79,17 +81,16 @@ public MicrosoftGraphDirectory withDeletedItems(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: directory. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDirectory object itself. */ @@ -98,15 +99,9 @@ public MicrosoftGraphDirectory withAdditionalProperties(Map addi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDirectory withId(String id) { super.withId(id); @@ -115,7 +110,7 @@ public MicrosoftGraphDirectory withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -128,4 +123,62 @@ public void validate() { deletedItems().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("administrativeUnits", this.administrativeUnits, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("deletedItems", this.deletedItems, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDirectory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDirectory 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 MicrosoftGraphDirectory. + */ + public static MicrosoftGraphDirectory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDirectory deserializedMicrosoftGraphDirectory = new MicrosoftGraphDirectory(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDirectory.withId(reader.getString()); + } else if ("administrativeUnits".equals(fieldName)) { + List administrativeUnits + = reader.readArray(reader1 -> MicrosoftGraphAdministrativeUnit.fromJson(reader1)); + deserializedMicrosoftGraphDirectory.administrativeUnits = administrativeUnits; + } else if ("deletedItems".equals(fieldName)) { + List deletedItems + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphDirectory.deletedItems = deletedItems; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDirectory.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDirectory; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryObjectInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryObjectInner.java index 4bb72e1527232..3d09a8153b435 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryObjectInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryObjectInner.java @@ -5,18 +5,20 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; /** * directoryObject - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -24,22 +26,23 @@ public class MicrosoftGraphDirectoryObjectInner extends MicrosoftGraphEntity { /* * The deletedDateTime property. */ - @JsonProperty(value = "deletedDateTime") private OffsetDateTime deletedDateTime; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDirectoryObjectInner class. */ + /** + * Creates an instance of MicrosoftGraphDirectoryObjectInner class. + */ public MicrosoftGraphDirectoryObjectInner() { } /** * Get the deletedDateTime property: The deletedDateTime property. - * + * * @return the deletedDateTime value. */ public OffsetDateTime deletedDateTime() { @@ -48,7 +51,7 @@ public OffsetDateTime deletedDateTime() { /** * Set the deletedDateTime property: The deletedDateTime property. - * + * * @param deletedDateTime the deletedDateTime value to set. * @return the MicrosoftGraphDirectoryObjectInner object itself. */ @@ -60,10 +63,9 @@ public MicrosoftGraphDirectoryObjectInner withDeletedDateTime(OffsetDateTime del /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -71,7 +73,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDirectoryObjectInner object itself. */ @@ -80,15 +82,9 @@ public MicrosoftGraphDirectoryObjectInner withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDirectoryObjectInner withId(String id) { super.withId(id); @@ -97,11 +93,64 @@ public MicrosoftGraphDirectoryObjectInner withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + this.deletedDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.deletedDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDirectoryObjectInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDirectoryObjectInner 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 MicrosoftGraphDirectoryObjectInner. + */ + public static MicrosoftGraphDirectoryObjectInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDirectoryObjectInner deserializedMicrosoftGraphDirectoryObjectInner + = new MicrosoftGraphDirectoryObjectInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryObjectInner.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryObjectInner.deletedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDirectoryObjectInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDirectoryObjectInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryRole.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryRole.java index 7d06132a8563a..6e1ab91f4c768 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryRole.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryRole.java @@ -5,19 +5,21 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * directoryRole - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -25,13 +27,11 @@ public final class MicrosoftGraphDirectoryRole extends MicrosoftGraphDirectoryOb /* * The description for the directory role. Read-only. */ - @JsonProperty(value = "description") private String description; /* * The display name for the directory role. Read-only. */ - @JsonProperty(value = "displayName") private String displayName; /* @@ -39,34 +39,33 @@ public final class MicrosoftGraphDirectoryRole extends MicrosoftGraphDirectoryOb * directory role in a tenant with a POST operation. After the directory role has been activated, the property is * read only. */ - @JsonProperty(value = "roleTemplateId") private String roleTemplateId; /* * Users that are members of this directory role. HTTP Methods: GET, POST, DELETE. Read-only. Nullable. */ - @JsonProperty(value = "members") private List members; /* * The scopedMembers property. */ - @JsonProperty(value = "scopedMembers") private List scopedMembers; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDirectoryRole class. */ + /** + * Creates an instance of MicrosoftGraphDirectoryRole class. + */ public MicrosoftGraphDirectoryRole() { } /** * Get the description property: The description for the directory role. Read-only. - * + * * @return the description value. */ public String description() { @@ -75,7 +74,7 @@ public String description() { /** * Set the description property: The description for the directory role. Read-only. - * + * * @param description the description value to set. * @return the MicrosoftGraphDirectoryRole object itself. */ @@ -86,7 +85,7 @@ public MicrosoftGraphDirectoryRole withDescription(String description) { /** * Get the displayName property: The display name for the directory role. Read-only. - * + * * @return the displayName value. */ public String displayName() { @@ -95,7 +94,7 @@ public String displayName() { /** * Set the displayName property: The display name for the directory role. Read-only. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphDirectoryRole object itself. */ @@ -108,7 +107,7 @@ public MicrosoftGraphDirectoryRole withDisplayName(String displayName) { * Get the roleTemplateId property: The id of the directoryRoleTemplate that this role is based on. The property * must be specified when activating a directory role in a tenant with a POST operation. After the directory role * has been activated, the property is read only. - * + * * @return the roleTemplateId value. */ public String roleTemplateId() { @@ -119,7 +118,7 @@ public String roleTemplateId() { * Set the roleTemplateId property: The id of the directoryRoleTemplate that this role is based on. The property * must be specified when activating a directory role in a tenant with a POST operation. After the directory role * has been activated, the property is read only. - * + * * @param roleTemplateId the roleTemplateId value to set. * @return the MicrosoftGraphDirectoryRole object itself. */ @@ -131,7 +130,7 @@ public MicrosoftGraphDirectoryRole withRoleTemplateId(String roleTemplateId) { /** * Get the members property: Users that are members of this directory role. HTTP Methods: GET, POST, DELETE. * Read-only. Nullable. - * + * * @return the members value. */ public List members() { @@ -141,7 +140,7 @@ public List members() { /** * Set the members property: Users that are members of this directory role. HTTP Methods: GET, POST, DELETE. * Read-only. Nullable. - * + * * @param members the members value to set. * @return the MicrosoftGraphDirectoryRole object itself. */ @@ -152,7 +151,7 @@ public MicrosoftGraphDirectoryRole withMembers(List scopedMembers() { @@ -161,7 +160,7 @@ public List scopedMembers() { /** * Set the scopedMembers property: The scopedMembers property. - * + * * @param scopedMembers the scopedMembers value to set. * @return the MicrosoftGraphDirectoryRole object itself. */ @@ -173,10 +172,9 @@ public MicrosoftGraphDirectoryRole withScopedMembers(List additionalProperties() { return this.additionalProperties; } @@ -184,7 +182,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDirectoryRole object itself. */ @@ -193,22 +191,18 @@ public MicrosoftGraphDirectoryRole withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDirectoryRole withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDirectoryRole withId(String id) { super.withId(id); @@ -217,7 +211,7 @@ public MicrosoftGraphDirectoryRole withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -230,4 +224,75 @@ public void validate() { scopedMembers().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("roleTemplateId", this.roleTemplateId); + jsonWriter.writeArrayField("members", this.members, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("scopedMembers", this.scopedMembers, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDirectoryRole from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDirectoryRole 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 MicrosoftGraphDirectoryRole. + */ + public static MicrosoftGraphDirectoryRole fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDirectoryRole deserializedMicrosoftGraphDirectoryRole = new MicrosoftGraphDirectoryRole(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryRole.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryRole.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryRole.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryRole.displayName = reader.getString(); + } else if ("roleTemplateId".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryRole.roleTemplateId = reader.getString(); + } else if ("members".equals(fieldName)) { + List members + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphDirectoryRole.members = members; + } else if ("scopedMembers".equals(fieldName)) { + List scopedMembers + = reader.readArray(reader1 -> MicrosoftGraphScopedRoleMembership.fromJson(reader1)); + deserializedMicrosoftGraphDirectoryRole.scopedMembers = scopedMembers; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDirectoryRole.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDirectoryRole; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryRoleTemplate.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryRoleTemplate.java index 700062bf40771..266aeccd1697a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryRoleTemplate.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDirectoryRoleTemplate.java @@ -5,18 +5,20 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; /** * directoryRoleTemplate - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -24,28 +26,28 @@ public final class MicrosoftGraphDirectoryRoleTemplate extends MicrosoftGraphDir /* * The description to set for the directory role. Read-only. */ - @JsonProperty(value = "description") private String description; /* * The display name to set for the directory role. Read-only. */ - @JsonProperty(value = "displayName") private String displayName; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDirectoryRoleTemplate class. */ + /** + * Creates an instance of MicrosoftGraphDirectoryRoleTemplate class. + */ public MicrosoftGraphDirectoryRoleTemplate() { } /** * Get the description property: The description to set for the directory role. Read-only. - * + * * @return the description value. */ public String description() { @@ -54,7 +56,7 @@ public String description() { /** * Set the description property: The description to set for the directory role. Read-only. - * + * * @param description the description value to set. * @return the MicrosoftGraphDirectoryRoleTemplate object itself. */ @@ -65,7 +67,7 @@ public MicrosoftGraphDirectoryRoleTemplate withDescription(String description) { /** * Get the displayName property: The display name to set for the directory role. Read-only. - * + * * @return the displayName value. */ public String displayName() { @@ -74,7 +76,7 @@ public String displayName() { /** * Set the displayName property: The display name to set for the directory role. Read-only. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphDirectoryRoleTemplate object itself. */ @@ -86,10 +88,9 @@ public MicrosoftGraphDirectoryRoleTemplate withDisplayName(String displayName) { /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -97,7 +98,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDirectoryRoleTemplate object itself. */ @@ -106,22 +107,18 @@ public MicrosoftGraphDirectoryRoleTemplate withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDirectoryRoleTemplate withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDirectoryRoleTemplate withId(String id) { super.withId(id); @@ -130,11 +127,70 @@ public MicrosoftGraphDirectoryRoleTemplate withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDirectoryRoleTemplate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDirectoryRoleTemplate 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 MicrosoftGraphDirectoryRoleTemplate. + */ + public static MicrosoftGraphDirectoryRoleTemplate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDirectoryRoleTemplate deserializedMicrosoftGraphDirectoryRoleTemplate + = new MicrosoftGraphDirectoryRoleTemplate(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryRoleTemplate.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryRoleTemplate.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryRoleTemplate.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphDirectoryRoleTemplate.displayName = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDirectoryRoleTemplate.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDirectoryRoleTemplate; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainDnsRecord.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainDnsRecord.java index fc43f805d62c9..667c09a33a05a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainDnsRecord.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainDnsRecord.java @@ -5,34 +5,33 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** domainDnsRecord. */ +/** + * domainDnsRecord. + */ @Fluent public final class MicrosoftGraphDomainDnsRecord extends MicrosoftGraphEntity { /* - * If false, this record must be configured by the customer at the DNS host for Microsoft Online Services to - * operate correctly with the domain. + * If false, this record must be configured by the customer at the DNS host for Microsoft Online Services to operate + * correctly with the domain. */ - @JsonProperty(value = "isOptional") private Boolean isOptional; /* * Value used when configuring the name of the DNS record at the DNS host. */ - @JsonProperty(value = "label") private String label; /* * Indicates what type of DNS record this entity represents.The value can be one of the following: CName, Mx, Srv, * TxtKey */ - @JsonProperty(value = "recordType") private String recordType; /* @@ -40,28 +39,28 @@ public final class MicrosoftGraphDomainDnsRecord extends MicrosoftGraphEntity { * null, Email, Sharepoint, EmailInternalRelayOnly, OfficeCommunicationsOnline, SharePointDefaultDomain, * FullRedelegation, SharePointPublic, OrgIdAuthentication, Yammer, Intune */ - @JsonProperty(value = "supportedService") private String supportedService; /* * Value to use when configuring the time-to-live (ttl) property of the DNS record at the DNS host. Not nullable */ - @JsonProperty(value = "ttl") private Integer ttl; /* * domainDnsRecord */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDomainDnsRecord class. */ + /** + * Creates an instance of MicrosoftGraphDomainDnsRecord class. + */ public MicrosoftGraphDomainDnsRecord() { } /** * Get the isOptional property: If false, this record must be configured by the customer at the DNS host for * Microsoft Online Services to operate correctly with the domain. - * + * * @return the isOptional value. */ public Boolean isOptional() { @@ -71,7 +70,7 @@ public Boolean isOptional() { /** * Set the isOptional property: If false, this record must be configured by the customer at the DNS host for * Microsoft Online Services to operate correctly with the domain. - * + * * @param isOptional the isOptional value to set. * @return the MicrosoftGraphDomainDnsRecord object itself. */ @@ -82,7 +81,7 @@ public MicrosoftGraphDomainDnsRecord withIsOptional(Boolean isOptional) { /** * Get the label property: Value used when configuring the name of the DNS record at the DNS host. - * + * * @return the label value. */ public String label() { @@ -91,7 +90,7 @@ public String label() { /** * Set the label property: Value used when configuring the name of the DNS record at the DNS host. - * + * * @param label the label value to set. * @return the MicrosoftGraphDomainDnsRecord object itself. */ @@ -103,7 +102,7 @@ public MicrosoftGraphDomainDnsRecord withLabel(String label) { /** * Get the recordType property: Indicates what type of DNS record this entity represents.The value can be one of the * following: CName, Mx, Srv, TxtKey. - * + * * @return the recordType value. */ public String recordType() { @@ -113,7 +112,7 @@ public String recordType() { /** * Set the recordType property: Indicates what type of DNS record this entity represents.The value can be one of the * following: CName, Mx, Srv, TxtKey. - * + * * @param recordType the recordType value to set. * @return the MicrosoftGraphDomainDnsRecord object itself. */ @@ -127,7 +126,7 @@ public MicrosoftGraphDomainDnsRecord withRecordType(String recordType) { * record.Can be one of the following values: null, Email, Sharepoint, EmailInternalRelayOnly, * OfficeCommunicationsOnline, SharePointDefaultDomain, FullRedelegation, SharePointPublic, OrgIdAuthentication, * Yammer, Intune. - * + * * @return the supportedService value. */ public String supportedService() { @@ -139,7 +138,7 @@ public String supportedService() { * record.Can be one of the following values: null, Email, Sharepoint, EmailInternalRelayOnly, * OfficeCommunicationsOnline, SharePointDefaultDomain, FullRedelegation, SharePointPublic, OrgIdAuthentication, * Yammer, Intune. - * + * * @param supportedService the supportedService value to set. * @return the MicrosoftGraphDomainDnsRecord object itself. */ @@ -151,7 +150,7 @@ public MicrosoftGraphDomainDnsRecord withSupportedService(String supportedServic /** * Get the ttl property: Value to use when configuring the time-to-live (ttl) property of the DNS record at the DNS * host. Not nullable. - * + * * @return the ttl value. */ public Integer ttl() { @@ -161,7 +160,7 @@ public Integer ttl() { /** * Set the ttl property: Value to use when configuring the time-to-live (ttl) property of the DNS record at the DNS * host. Not nullable. - * + * * @param ttl the ttl value to set. * @return the MicrosoftGraphDomainDnsRecord object itself. */ @@ -172,17 +171,16 @@ public MicrosoftGraphDomainDnsRecord withTtl(Integer ttl) { /** * Get the additionalProperties property: domainDnsRecord. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: domainDnsRecord. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDomainDnsRecord object itself. */ @@ -191,15 +189,9 @@ public MicrosoftGraphDomainDnsRecord withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDomainDnsRecord withId(String id) { super.withId(id); @@ -208,11 +200,74 @@ public MicrosoftGraphDomainDnsRecord withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeBooleanField("isOptional", this.isOptional); + jsonWriter.writeStringField("label", this.label); + jsonWriter.writeStringField("recordType", this.recordType); + jsonWriter.writeStringField("supportedService", this.supportedService); + jsonWriter.writeNumberField("ttl", this.ttl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDomainDnsRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDomainDnsRecord 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 MicrosoftGraphDomainDnsRecord. + */ + public static MicrosoftGraphDomainDnsRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDomainDnsRecord deserializedMicrosoftGraphDomainDnsRecord + = new MicrosoftGraphDomainDnsRecord(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDomainDnsRecord.withId(reader.getString()); + } else if ("isOptional".equals(fieldName)) { + deserializedMicrosoftGraphDomainDnsRecord.isOptional = reader.getNullable(JsonReader::getBoolean); + } else if ("label".equals(fieldName)) { + deserializedMicrosoftGraphDomainDnsRecord.label = reader.getString(); + } else if ("recordType".equals(fieldName)) { + deserializedMicrosoftGraphDomainDnsRecord.recordType = reader.getString(); + } else if ("supportedService".equals(fieldName)) { + deserializedMicrosoftGraphDomainDnsRecord.supportedService = reader.getString(); + } else if ("ttl".equals(fieldName)) { + deserializedMicrosoftGraphDomainDnsRecord.ttl = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDomainDnsRecord.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDomainDnsRecord; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainInner.java index 5e6086af772f2..c6f18ca39cfb9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainInner.java @@ -5,15 +5,17 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** domain. */ +/** + * domain. + */ @Fluent public final class MicrosoftGraphDomainInner extends MicrosoftGraphEntity { /* @@ -22,7 +24,6 @@ public final class MicrosoftGraphDomainInner extends MicrosoftGraphEntity { * is federated with an identity provider such as the tenant's on-premises Active Directory via Active Directory * Federation Services. This property is read-only and is not nullable. */ - @JsonProperty(value = "authenticationType") private String authenticationType; /* @@ -30,73 +31,62 @@ public final class MicrosoftGraphDomainInner extends MicrosoftGraphEntity { * entity is returned in the response. The availabilityStatus property of the domain entity in the response is * either AvailableImmediately or EmailVerifiedDomainTakeoverScheduled. */ - @JsonProperty(value = "availabilityStatus") private String availabilityStatus; /* * The value of the property is false if the DNS record management of the domain has been delegated to Microsoft * 365. Otherwise, the value is true. Not nullable */ - @JsonProperty(value = "isAdminManaged") private Boolean isAdminManaged; /* * True if this is the default domain that is used for user creation. There is only one default domain per company. * Not nullable */ - @JsonProperty(value = "isDefault") private Boolean isDefault; /* * True if this is the initial domain created by Microsoft Online Services (companyname.onmicrosoft.com). There is * only one initial domain per company. Not nullable */ - @JsonProperty(value = "isInitial") private Boolean isInitial; /* * True if the domain is a verified root domain. Otherwise, false if the domain is a subdomain or unverified. Not * nullable */ - @JsonProperty(value = "isRoot") private Boolean isRoot; /* * True if the domain has completed domain ownership verification. Not nullable */ - @JsonProperty(value = "isVerified") private Boolean isVerified; /* * The manufacturer property. */ - @JsonProperty(value = "manufacturer") private String manufacturer; /* * The model property. */ - @JsonProperty(value = "model") private String model; /* - * Specifies the number of days before a user receives notification that their password will expire. If the - * property is not set, a default value of 14 days will be used. + * Specifies the number of days before a user receives notification that their password will expire. If the property + * is not set, a default value of 14 days will be used. */ - @JsonProperty(value = "passwordNotificationWindowInDays") private Integer passwordNotificationWindowInDays; /* * Specifies the length of time that a password is valid before it must be changed. If the property is not set, a * default value of 90 days will be used. */ - @JsonProperty(value = "passwordValidityPeriodInDays") private Integer passwordValidityPeriodInDays; /* * domainState */ - @JsonProperty(value = "state") private MicrosoftGraphDomainState state; /* @@ -105,35 +95,33 @@ public final class MicrosoftGraphDomainInner extends MicrosoftGraphEntity { * OrgIdAuthentication, Yammer, Intune The values which you can add/remove using Graph API include: Email, * OfficeCommunicationsOnline, YammerNot nullable */ - @JsonProperty(value = "supportedServices") private List supportedServices; /* * Read-only, Nullable */ - @JsonProperty(value = "domainNameReferences") private List domainNameReferences; /* * DNS records the customer adds to the DNS zone file of the domain before the domain can be used by Microsoft * Online services.Read-only, Nullable */ - @JsonProperty(value = "serviceConfigurationRecords") private List serviceConfigurationRecords; /* * DNS records that the customer adds to the DNS zone file of the domain before the customer can complete domain * ownership verification with Azure AD.Read-only, Nullable */ - @JsonProperty(value = "verificationDnsRecords") private List verificationDnsRecords; /* * domain */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDomainInner class. */ + /** + * Creates an instance of MicrosoftGraphDomainInner class. + */ public MicrosoftGraphDomainInner() { } @@ -143,7 +131,7 @@ public MicrosoftGraphDomainInner() { * authentication.Federated indicates authentication is federated with an identity provider such as the tenant's * on-premises Active Directory via Active Directory Federation Services. This property is read-only and is not * nullable. - * + * * @return the authenticationType value. */ public String authenticationType() { @@ -156,7 +144,7 @@ public String authenticationType() { * authentication.Federated indicates authentication is federated with an identity provider such as the tenant's * on-premises Active Directory via Active Directory Federation Services. This property is read-only and is not * nullable. - * + * * @param authenticationType the authenticationType value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -169,7 +157,7 @@ public MicrosoftGraphDomainInner withAuthenticationType(String authenticationTyp * Get the availabilityStatus property: This property is always null except when the verify action is used. When the * verify action is used, a domain entity is returned in the response. The availabilityStatus property of the domain * entity in the response is either AvailableImmediately or EmailVerifiedDomainTakeoverScheduled. - * + * * @return the availabilityStatus value. */ public String availabilityStatus() { @@ -180,7 +168,7 @@ public String availabilityStatus() { * Set the availabilityStatus property: This property is always null except when the verify action is used. When the * verify action is used, a domain entity is returned in the response. The availabilityStatus property of the domain * entity in the response is either AvailableImmediately or EmailVerifiedDomainTakeoverScheduled. - * + * * @param availabilityStatus the availabilityStatus value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -192,7 +180,7 @@ public MicrosoftGraphDomainInner withAvailabilityStatus(String availabilityStatu /** * Get the isAdminManaged property: The value of the property is false if the DNS record management of the domain * has been delegated to Microsoft 365. Otherwise, the value is true. Not nullable. - * + * * @return the isAdminManaged value. */ public Boolean isAdminManaged() { @@ -202,7 +190,7 @@ public Boolean isAdminManaged() { /** * Set the isAdminManaged property: The value of the property is false if the DNS record management of the domain * has been delegated to Microsoft 365. Otherwise, the value is true. Not nullable. - * + * * @param isAdminManaged the isAdminManaged value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -214,7 +202,7 @@ public MicrosoftGraphDomainInner withIsAdminManaged(Boolean isAdminManaged) { /** * Get the isDefault property: True if this is the default domain that is used for user creation. There is only one * default domain per company. Not nullable. - * + * * @return the isDefault value. */ public Boolean isDefault() { @@ -224,7 +212,7 @@ public Boolean isDefault() { /** * Set the isDefault property: True if this is the default domain that is used for user creation. There is only one * default domain per company. Not nullable. - * + * * @param isDefault the isDefault value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -236,7 +224,7 @@ public MicrosoftGraphDomainInner withIsDefault(Boolean isDefault) { /** * Get the isInitial property: True if this is the initial domain created by Microsoft Online Services * (companyname.onmicrosoft.com). There is only one initial domain per company. Not nullable. - * + * * @return the isInitial value. */ public Boolean isInitial() { @@ -246,7 +234,7 @@ public Boolean isInitial() { /** * Set the isInitial property: True if this is the initial domain created by Microsoft Online Services * (companyname.onmicrosoft.com). There is only one initial domain per company. Not nullable. - * + * * @param isInitial the isInitial value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -258,7 +246,7 @@ public MicrosoftGraphDomainInner withIsInitial(Boolean isInitial) { /** * Get the isRoot property: True if the domain is a verified root domain. Otherwise, false if the domain is a * subdomain or unverified. Not nullable. - * + * * @return the isRoot value. */ public Boolean isRoot() { @@ -268,7 +256,7 @@ public Boolean isRoot() { /** * Set the isRoot property: True if the domain is a verified root domain. Otherwise, false if the domain is a * subdomain or unverified. Not nullable. - * + * * @param isRoot the isRoot value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -279,7 +267,7 @@ public MicrosoftGraphDomainInner withIsRoot(Boolean isRoot) { /** * Get the isVerified property: True if the domain has completed domain ownership verification. Not nullable. - * + * * @return the isVerified value. */ public Boolean isVerified() { @@ -288,7 +276,7 @@ public Boolean isVerified() { /** * Set the isVerified property: True if the domain has completed domain ownership verification. Not nullable. - * + * * @param isVerified the isVerified value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -299,7 +287,7 @@ public MicrosoftGraphDomainInner withIsVerified(Boolean isVerified) { /** * Get the manufacturer property: The manufacturer property. - * + * * @return the manufacturer value. */ public String manufacturer() { @@ -308,7 +296,7 @@ public String manufacturer() { /** * Set the manufacturer property: The manufacturer property. - * + * * @param manufacturer the manufacturer value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -319,7 +307,7 @@ public MicrosoftGraphDomainInner withManufacturer(String manufacturer) { /** * Get the model property: The model property. - * + * * @return the model value. */ public String model() { @@ -328,7 +316,7 @@ public String model() { /** * Set the model property: The model property. - * + * * @param model the model value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -341,7 +329,7 @@ public MicrosoftGraphDomainInner withModel(String model) { * Get the passwordNotificationWindowInDays property: Specifies the number of days before a user receives * notification that their password will expire. If the property is not set, a default value of 14 days will be * used. - * + * * @return the passwordNotificationWindowInDays value. */ public Integer passwordNotificationWindowInDays() { @@ -352,7 +340,7 @@ public Integer passwordNotificationWindowInDays() { * Set the passwordNotificationWindowInDays property: Specifies the number of days before a user receives * notification that their password will expire. If the property is not set, a default value of 14 days will be * used. - * + * * @param passwordNotificationWindowInDays the passwordNotificationWindowInDays value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -364,7 +352,7 @@ public MicrosoftGraphDomainInner withPasswordNotificationWindowInDays(Integer pa /** * Get the passwordValidityPeriodInDays property: Specifies the length of time that a password is valid before it * must be changed. If the property is not set, a default value of 90 days will be used. - * + * * @return the passwordValidityPeriodInDays value. */ public Integer passwordValidityPeriodInDays() { @@ -374,7 +362,7 @@ public Integer passwordValidityPeriodInDays() { /** * Set the passwordValidityPeriodInDays property: Specifies the length of time that a password is valid before it * must be changed. If the property is not set, a default value of 90 days will be used. - * + * * @param passwordValidityPeriodInDays the passwordValidityPeriodInDays value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -385,7 +373,7 @@ public MicrosoftGraphDomainInner withPasswordValidityPeriodInDays(Integer passwo /** * Get the state property: domainState. - * + * * @return the state value. */ public MicrosoftGraphDomainState state() { @@ -394,7 +382,7 @@ public MicrosoftGraphDomainState state() { /** * Set the state property: domainState. - * + * * @param state the state value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -408,7 +396,7 @@ public MicrosoftGraphDomainInner withState(MicrosoftGraphDomainState state) { * values: Email, Sharepoint, EmailInternalRelayOnly, OfficeCommunicationsOnline, SharePointDefaultDomain, * FullRedelegation, SharePointPublic, OrgIdAuthentication, Yammer, Intune The values which you can add/remove using * Graph API include: Email, OfficeCommunicationsOnline, YammerNot nullable. - * + * * @return the supportedServices value. */ public List supportedServices() { @@ -420,7 +408,7 @@ public List supportedServices() { * values: Email, Sharepoint, EmailInternalRelayOnly, OfficeCommunicationsOnline, SharePointDefaultDomain, * FullRedelegation, SharePointPublic, OrgIdAuthentication, Yammer, Intune The values which you can add/remove using * Graph API include: Email, OfficeCommunicationsOnline, YammerNot nullable. - * + * * @param supportedServices the supportedServices value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -431,7 +419,7 @@ public MicrosoftGraphDomainInner withSupportedServices(List supportedSer /** * Get the domainNameReferences property: Read-only, Nullable. - * + * * @return the domainNameReferences value. */ public List domainNameReferences() { @@ -440,12 +428,12 @@ public List domainNameReferences() { /** * Set the domainNameReferences property: Read-only, Nullable. - * + * * @param domainNameReferences the domainNameReferences value to set. * @return the MicrosoftGraphDomainInner object itself. */ - public MicrosoftGraphDomainInner withDomainNameReferences( - List domainNameReferences) { + public MicrosoftGraphDomainInner + withDomainNameReferences(List domainNameReferences) { this.domainNameReferences = domainNameReferences; return this; } @@ -453,7 +441,7 @@ public MicrosoftGraphDomainInner withDomainNameReferences( /** * Get the serviceConfigurationRecords property: DNS records the customer adds to the DNS zone file of the domain * before the domain can be used by Microsoft Online services.Read-only, Nullable. - * + * * @return the serviceConfigurationRecords value. */ public List serviceConfigurationRecords() { @@ -463,12 +451,12 @@ public List serviceConfigurationRecords() { /** * Set the serviceConfigurationRecords property: DNS records the customer adds to the DNS zone file of the domain * before the domain can be used by Microsoft Online services.Read-only, Nullable. - * + * * @param serviceConfigurationRecords the serviceConfigurationRecords value to set. * @return the MicrosoftGraphDomainInner object itself. */ - public MicrosoftGraphDomainInner withServiceConfigurationRecords( - List serviceConfigurationRecords) { + public MicrosoftGraphDomainInner + withServiceConfigurationRecords(List serviceConfigurationRecords) { this.serviceConfigurationRecords = serviceConfigurationRecords; return this; } @@ -476,7 +464,7 @@ public MicrosoftGraphDomainInner withServiceConfigurationRecords( /** * Get the verificationDnsRecords property: DNS records that the customer adds to the DNS zone file of the domain * before the customer can complete domain ownership verification with Azure AD.Read-only, Nullable. - * + * * @return the verificationDnsRecords value. */ public List verificationDnsRecords() { @@ -486,29 +474,28 @@ public List verificationDnsRecords() { /** * Set the verificationDnsRecords property: DNS records that the customer adds to the DNS zone file of the domain * before the customer can complete domain ownership verification with Azure AD.Read-only, Nullable. - * + * * @param verificationDnsRecords the verificationDnsRecords value to set. * @return the MicrosoftGraphDomainInner object itself. */ - public MicrosoftGraphDomainInner withVerificationDnsRecords( - List verificationDnsRecords) { + public MicrosoftGraphDomainInner + withVerificationDnsRecords(List verificationDnsRecords) { this.verificationDnsRecords = verificationDnsRecords; return this; } /** * Get the additionalProperties property: domain. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: domain. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDomainInner object itself. */ @@ -517,15 +504,9 @@ public MicrosoftGraphDomainInner withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDomainInner withId(String id) { super.withId(id); @@ -534,7 +515,7 @@ public MicrosoftGraphDomainInner withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -553,4 +534,112 @@ public void validate() { verificationDnsRecords().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("authenticationType", this.authenticationType); + jsonWriter.writeStringField("availabilityStatus", this.availabilityStatus); + jsonWriter.writeBooleanField("isAdminManaged", this.isAdminManaged); + jsonWriter.writeBooleanField("isDefault", this.isDefault); + jsonWriter.writeBooleanField("isInitial", this.isInitial); + jsonWriter.writeBooleanField("isRoot", this.isRoot); + jsonWriter.writeBooleanField("isVerified", this.isVerified); + jsonWriter.writeStringField("manufacturer", this.manufacturer); + jsonWriter.writeStringField("model", this.model); + jsonWriter.writeNumberField("passwordNotificationWindowInDays", this.passwordNotificationWindowInDays); + jsonWriter.writeNumberField("passwordValidityPeriodInDays", this.passwordValidityPeriodInDays); + jsonWriter.writeJsonField("state", this.state); + jsonWriter.writeArrayField("supportedServices", this.supportedServices, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("domainNameReferences", this.domainNameReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("serviceConfigurationRecords", this.serviceConfigurationRecords, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("verificationDnsRecords", this.verificationDnsRecords, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDomainInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDomainInner 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 MicrosoftGraphDomainInner. + */ + public static MicrosoftGraphDomainInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDomainInner deserializedMicrosoftGraphDomainInner = new MicrosoftGraphDomainInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.withId(reader.getString()); + } else if ("authenticationType".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.authenticationType = reader.getString(); + } else if ("availabilityStatus".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.availabilityStatus = reader.getString(); + } else if ("isAdminManaged".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.isAdminManaged = reader.getNullable(JsonReader::getBoolean); + } else if ("isDefault".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("isInitial".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.isInitial = reader.getNullable(JsonReader::getBoolean); + } else if ("isRoot".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.isRoot = reader.getNullable(JsonReader::getBoolean); + } else if ("isVerified".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.isVerified = reader.getNullable(JsonReader::getBoolean); + } else if ("manufacturer".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.manufacturer = reader.getString(); + } else if ("model".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.model = reader.getString(); + } else if ("passwordNotificationWindowInDays".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.passwordNotificationWindowInDays + = reader.getNullable(JsonReader::getInt); + } else if ("passwordValidityPeriodInDays".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.passwordValidityPeriodInDays + = reader.getNullable(JsonReader::getInt); + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphDomainInner.state = MicrosoftGraphDomainState.fromJson(reader); + } else if ("supportedServices".equals(fieldName)) { + List supportedServices = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphDomainInner.supportedServices = supportedServices; + } else if ("domainNameReferences".equals(fieldName)) { + List domainNameReferences + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphDomainInner.domainNameReferences = domainNameReferences; + } else if ("serviceConfigurationRecords".equals(fieldName)) { + List serviceConfigurationRecords + = reader.readArray(reader1 -> MicrosoftGraphDomainDnsRecord.fromJson(reader1)); + deserializedMicrosoftGraphDomainInner.serviceConfigurationRecords = serviceConfigurationRecords; + } else if ("verificationDnsRecords".equals(fieldName)) { + List verificationDnsRecords + = reader.readArray(reader1 -> MicrosoftGraphDomainDnsRecord.fromJson(reader1)); + deserializedMicrosoftGraphDomainInner.verificationDnsRecords = verificationDnsRecords; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDomainInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDomainInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainState.java index 71bd39787f6b1..09bde2a9c7f64 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDomainState.java @@ -5,50 +5,54 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** domainState. */ +/** + * domainState. + */ @Fluent -public final class MicrosoftGraphDomainState { +public final class MicrosoftGraphDomainState implements JsonSerializable { /* * Timestamp for when the last activity occurred. The value is updated when an operation is scheduled, the * asynchronous task starts, and when the operation completes. */ - @JsonProperty(value = "lastActionDateTime") private OffsetDateTime lastActionDateTime; /* * Type of asynchronous operation. The values can be ForceDelete or Verification */ - @JsonProperty(value = "operation") private String operation; /* - * Current status of the operation. Scheduled - Operation has been scheduled but has not started. InProgress - - * Task has started and is in progress. Failed - Operation has failed. + * Current status of the operation. Scheduled - Operation has been scheduled but has not started. InProgress - Task + * has started and is in progress. Failed - Operation has failed. */ - @JsonProperty(value = "status") private String status; /* * domainState */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDomainState class. */ + /** + * Creates an instance of MicrosoftGraphDomainState class. + */ public MicrosoftGraphDomainState() { } /** * Get the lastActionDateTime property: Timestamp for when the last activity occurred. The value is updated when an * operation is scheduled, the asynchronous task starts, and when the operation completes. - * + * * @return the lastActionDateTime value. */ public OffsetDateTime lastActionDateTime() { @@ -58,7 +62,7 @@ public OffsetDateTime lastActionDateTime() { /** * Set the lastActionDateTime property: Timestamp for when the last activity occurred. The value is updated when an * operation is scheduled, the asynchronous task starts, and when the operation completes. - * + * * @param lastActionDateTime the lastActionDateTime value to set. * @return the MicrosoftGraphDomainState object itself. */ @@ -69,7 +73,7 @@ public MicrosoftGraphDomainState withLastActionDateTime(OffsetDateTime lastActio /** * Get the operation property: Type of asynchronous operation. The values can be ForceDelete or Verification. - * + * * @return the operation value. */ public String operation() { @@ -78,7 +82,7 @@ public String operation() { /** * Set the operation property: Type of asynchronous operation. The values can be ForceDelete or Verification. - * + * * @param operation the operation value to set. * @return the MicrosoftGraphDomainState object itself. */ @@ -90,7 +94,7 @@ public MicrosoftGraphDomainState withOperation(String operation) { /** * Get the status property: Current status of the operation. Scheduled - Operation has been scheduled but has not * started. InProgress - Task has started and is in progress. Failed - Operation has failed. - * + * * @return the status value. */ public String status() { @@ -100,7 +104,7 @@ public String status() { /** * Set the status property: Current status of the operation. Scheduled - Operation has been scheduled but has not * started. InProgress - Task has started and is in progress. Failed - Operation has failed. - * + * * @param status the status value to set. * @return the MicrosoftGraphDomainState object itself. */ @@ -111,17 +115,16 @@ public MicrosoftGraphDomainState withStatus(String status) { /** * Get the additionalProperties property: domainState. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: domainState. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDomainState object itself. */ @@ -130,19 +133,68 @@ public MicrosoftGraphDomainState withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("lastActionDateTime", + this.lastActionDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastActionDateTime)); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("status", this.status); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDomainState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDomainState 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 MicrosoftGraphDomainState. + */ + public static MicrosoftGraphDomainState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDomainState deserializedMicrosoftGraphDomainState = new MicrosoftGraphDomainState(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("lastActionDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDomainState.lastActionDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operation".equals(fieldName)) { + deserializedMicrosoftGraphDomainState.operation = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedMicrosoftGraphDomainState.status = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDomainState.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDomainState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDrive.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDrive.java index 232c12ac4e538..1f8b86f1d929b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDrive.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDrive.java @@ -5,88 +5,81 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** drive. */ +/** + * drive. + */ @Fluent public final class MicrosoftGraphDrive extends MicrosoftGraphBaseItemInner { /* - * Describes the type of drive represented by this resource. OneDrive personal drives will return personal. - * OneDrive for Business will return business. SharePoint document libraries will return documentLibrary. - * Read-only. + * Describes the type of drive represented by this resource. OneDrive personal drives will return personal. OneDrive + * for Business will return business. SharePoint document libraries will return documentLibrary. Read-only. */ - @JsonProperty(value = "driveType") private String driveType; /* * identitySet */ - @JsonProperty(value = "owner") private MicrosoftGraphIdentitySet owner; /* * quota */ - @JsonProperty(value = "quota") private MicrosoftGraphQuota quota; /* * sharepointIds */ - @JsonProperty(value = "sharePointIds") private MicrosoftGraphSharepointIds sharePointIds; /* * systemFacet */ - @JsonProperty(value = "system") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map system; /* * The list of items the user is following. Only in OneDrive for Business. */ - @JsonProperty(value = "following") private List following; /* * All items contained in the drive. Read-only. Nullable. */ - @JsonProperty(value = "items") private List items; /* * list */ - @JsonProperty(value = "list") private MicrosoftGraphList list; /* * driveItem */ - @JsonProperty(value = "root") private MicrosoftGraphDriveItem root; /* * Collection of common folders available in OneDrive. Read-only. Nullable. */ - @JsonProperty(value = "special") private List special; /* * drive */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDrive class. */ + /** + * Creates an instance of MicrosoftGraphDrive class. + */ public MicrosoftGraphDrive() { } @@ -94,7 +87,7 @@ public MicrosoftGraphDrive() { * Get the driveType property: Describes the type of drive represented by this resource. OneDrive personal drives * will return personal. OneDrive for Business will return business. SharePoint document libraries will return * documentLibrary. Read-only. - * + * * @return the driveType value. */ public String driveType() { @@ -105,7 +98,7 @@ public String driveType() { * Set the driveType property: Describes the type of drive represented by this resource. OneDrive personal drives * will return personal. OneDrive for Business will return business. SharePoint document libraries will return * documentLibrary. Read-only. - * + * * @param driveType the driveType value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -116,7 +109,7 @@ public MicrosoftGraphDrive withDriveType(String driveType) { /** * Get the owner property: identitySet. - * + * * @return the owner value. */ public MicrosoftGraphIdentitySet owner() { @@ -125,7 +118,7 @@ public MicrosoftGraphIdentitySet owner() { /** * Set the owner property: identitySet. - * + * * @param owner the owner value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -136,7 +129,7 @@ public MicrosoftGraphDrive withOwner(MicrosoftGraphIdentitySet owner) { /** * Get the quota property: quota. - * + * * @return the quota value. */ public MicrosoftGraphQuota quota() { @@ -145,7 +138,7 @@ public MicrosoftGraphQuota quota() { /** * Set the quota property: quota. - * + * * @param quota the quota value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -156,7 +149,7 @@ public MicrosoftGraphDrive withQuota(MicrosoftGraphQuota quota) { /** * Get the sharePointIds property: sharepointIds. - * + * * @return the sharePointIds value. */ public MicrosoftGraphSharepointIds sharePointIds() { @@ -165,7 +158,7 @@ public MicrosoftGraphSharepointIds sharePointIds() { /** * Set the sharePointIds property: sharepointIds. - * + * * @param sharePointIds the sharePointIds value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -176,7 +169,7 @@ public MicrosoftGraphDrive withSharePointIds(MicrosoftGraphSharepointIds sharePo /** * Get the system property: systemFacet. - * + * * @return the system value. */ public Map system() { @@ -185,7 +178,7 @@ public Map system() { /** * Set the system property: systemFacet. - * + * * @param system the system value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -196,7 +189,7 @@ public MicrosoftGraphDrive withSystem(Map system) { /** * Get the following property: The list of items the user is following. Only in OneDrive for Business. - * + * * @return the following value. */ public List following() { @@ -205,7 +198,7 @@ public List following() { /** * Set the following property: The list of items the user is following. Only in OneDrive for Business. - * + * * @param following the following value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -216,7 +209,7 @@ public MicrosoftGraphDrive withFollowing(List following /** * Get the items property: All items contained in the drive. Read-only. Nullable. - * + * * @return the items value. */ public List items() { @@ -225,7 +218,7 @@ public List items() { /** * Set the items property: All items contained in the drive. Read-only. Nullable. - * + * * @param items the items value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -236,7 +229,7 @@ public MicrosoftGraphDrive withItems(List items) { /** * Get the list property: list. - * + * * @return the list value. */ public MicrosoftGraphList list() { @@ -245,7 +238,7 @@ public MicrosoftGraphList list() { /** * Set the list property: list. - * + * * @param list the list value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -256,7 +249,7 @@ public MicrosoftGraphDrive withList(MicrosoftGraphList list) { /** * Get the root property: driveItem. - * + * * @return the root value. */ public MicrosoftGraphDriveItem root() { @@ -265,7 +258,7 @@ public MicrosoftGraphDriveItem root() { /** * Set the root property: driveItem. - * + * * @param root the root value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -276,7 +269,7 @@ public MicrosoftGraphDrive withRoot(MicrosoftGraphDriveItem root) { /** * Get the special property: Collection of common folders available in OneDrive. Read-only. Nullable. - * + * * @return the special value. */ public List special() { @@ -285,7 +278,7 @@ public List special() { /** * Set the special property: Collection of common folders available in OneDrive. Read-only. Nullable. - * + * * @param special the special value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -296,17 +289,16 @@ public MicrosoftGraphDrive withSpecial(List special) { /** * Get the additionalProperties property: drive. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: drive. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDrive object itself. */ @@ -315,92 +307,108 @@ public MicrosoftGraphDrive withAdditionalProperties(Map addition return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withCreatedBy(MicrosoftGraphIdentitySet createdBy) { super.withCreatedBy(createdBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withEtag(String etag) { super.withEtag(etag); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withName(String name) { super.withName(name); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withParentReference(MicrosoftGraphItemReference parentReference) { super.withParentReference(parentReference); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withWebUrl(String webUrl) { super.withWebUrl(webUrl); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withCreatedByUser(MicrosoftGraphUserInner createdByUser) { super.withCreatedByUser(createdByUser); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withLastModifiedByUser(MicrosoftGraphUserInner lastModifiedByUser) { super.withLastModifiedByUser(lastModifiedByUser); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDrive withId(String id) { super.withId(id); @@ -409,7 +417,7 @@ public MicrosoftGraphDrive withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -440,4 +448,127 @@ public void validate() { special().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("createdBy", createdBy()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("eTag", etag()); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeJsonField("parentReference", parentReference()); + jsonWriter.writeStringField("webUrl", webUrl()); + jsonWriter.writeJsonField("createdByUser", createdByUser()); + jsonWriter.writeJsonField("lastModifiedByUser", lastModifiedByUser()); + jsonWriter.writeStringField("driveType", this.driveType); + jsonWriter.writeJsonField("owner", this.owner); + jsonWriter.writeJsonField("quota", this.quota); + jsonWriter.writeJsonField("sharePointIds", this.sharePointIds); + jsonWriter.writeMapField("system", this.system, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeArrayField("following", this.following, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("list", this.list); + jsonWriter.writeJsonField("root", this.root); + jsonWriter.writeArrayField("special", this.special, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDrive from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDrive 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 MicrosoftGraphDrive. + */ + public static MicrosoftGraphDrive fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDrive deserializedMicrosoftGraphDrive = new MicrosoftGraphDrive(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withId(reader.getString()); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withCreatedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withDescription(reader.getString()); + } else if ("eTag".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withEtag(reader.getString()); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withName(reader.getString()); + } else if ("parentReference".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withParentReference(MicrosoftGraphItemReference.fromJson(reader)); + } else if ("webUrl".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withWebUrl(reader.getString()); + } else if ("createdByUser".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withCreatedByUser(MicrosoftGraphUserInner.fromJson(reader)); + } else if ("lastModifiedByUser".equals(fieldName)) { + deserializedMicrosoftGraphDrive.withLastModifiedByUser(MicrosoftGraphUserInner.fromJson(reader)); + } else if ("driveType".equals(fieldName)) { + deserializedMicrosoftGraphDrive.driveType = reader.getString(); + } else if ("owner".equals(fieldName)) { + deserializedMicrosoftGraphDrive.owner = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("quota".equals(fieldName)) { + deserializedMicrosoftGraphDrive.quota = MicrosoftGraphQuota.fromJson(reader); + } else if ("sharePointIds".equals(fieldName)) { + deserializedMicrosoftGraphDrive.sharePointIds = MicrosoftGraphSharepointIds.fromJson(reader); + } else if ("system".equals(fieldName)) { + Map system = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphDrive.system = system; + } else if ("following".equals(fieldName)) { + List following + = reader.readArray(reader1 -> MicrosoftGraphDriveItem.fromJson(reader1)); + deserializedMicrosoftGraphDrive.following = following; + } else if ("items".equals(fieldName)) { + List items + = reader.readArray(reader1 -> MicrosoftGraphDriveItem.fromJson(reader1)); + deserializedMicrosoftGraphDrive.items = items; + } else if ("list".equals(fieldName)) { + deserializedMicrosoftGraphDrive.list = MicrosoftGraphList.fromJson(reader); + } else if ("root".equals(fieldName)) { + deserializedMicrosoftGraphDrive.root = MicrosoftGraphDriveItem.fromJson(reader); + } else if ("special".equals(fieldName)) { + List special + = reader.readArray(reader1 -> MicrosoftGraphDriveItem.fromJson(reader1)); + deserializedMicrosoftGraphDrive.special = special; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDrive.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDrive; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDriveItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDriveItem.java index 4d1c20475289b..3facfd3a6c67c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDriveItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDriveItem.java @@ -7,17 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.Base64Url; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -/** driveItem. */ +/** + * driveItem. + */ @Fluent public final class MicrosoftGraphDriveItem extends MicrosoftGraphBaseItemInner { private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; @@ -25,200 +28,170 @@ public final class MicrosoftGraphDriveItem extends MicrosoftGraphBaseItemInner { /* * audio */ - @JsonProperty(value = "audio") private MicrosoftGraphAudio audio; /* * The content stream, if the item represents a file. */ - @JsonProperty(value = "content") private Base64Url content; /* - * An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This - * property is not returned if the item is a folder. Read-only. + * An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property + * is not returned if the item is a folder. Read-only. */ - @JsonProperty(value = "cTag") private String cTag; /* * deleted */ - @JsonProperty(value = "deleted") private MicrosoftGraphDeleted deleted; /* * file */ - @JsonProperty(value = "file") private MicrosoftGraphFile file; /* * fileSystemInfo */ - @JsonProperty(value = "fileSystemInfo") private MicrosoftGraphFileSystemInfo fileSystemInfo; /* * folder */ - @JsonProperty(value = "folder") private MicrosoftGraphFolder folder; /* * image */ - @JsonProperty(value = "image") private MicrosoftGraphImage image; /* * geoCoordinates */ - @JsonProperty(value = "location") private MicrosoftGraphGeoCoordinates location; /* * package */ - @JsonProperty(value = "package") private MicrosoftGraphPackage packageProperty; /* * pendingOperations */ - @JsonProperty(value = "pendingOperations") private MicrosoftGraphPendingOperations pendingOperations; /* * photo */ - @JsonProperty(value = "photo") private MicrosoftGraphPhoto photo; /* * publicationFacet */ - @JsonProperty(value = "publication") private MicrosoftGraphPublicationFacet publication; /* * remoteItem */ - @JsonProperty(value = "remoteItem") private MicrosoftGraphRemoteItem remoteItem; /* * root */ - @JsonProperty(value = "root") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map root; /* * searchResult */ - @JsonProperty(value = "searchResult") private MicrosoftGraphSearchResult searchResult; /* * shared */ - @JsonProperty(value = "shared") private MicrosoftGraphShared shared; /* * sharepointIds */ - @JsonProperty(value = "sharepointIds") private MicrosoftGraphSharepointIds sharepointIds; /* * Size of the item in bytes. Read-only. */ - @JsonProperty(value = "size") private Long size; /* * specialFolder */ - @JsonProperty(value = "specialFolder") private MicrosoftGraphSpecialFolder specialFolder; /* * video */ - @JsonProperty(value = "video") private MicrosoftGraphVideo video; /* * WebDAV compatible URL for the item. */ - @JsonProperty(value = "webDavUrl") private String webDavUrl; /* * workbook */ - @JsonProperty(value = "workbook") private MicrosoftGraphWorkbook workbook; /* * itemAnalytics */ - @JsonProperty(value = "analytics") private MicrosoftGraphItemAnalytics analytics; /* * Collection containing Item objects for the immediate children of Item. Only items representing folders have * children. Read-only. Nullable. */ - @JsonProperty(value = "children") private List children; /* * listItem */ - @JsonProperty(value = "listItem") private MicrosoftGraphListItem listItem; /* * The set of permissions for the item. Read-only. Nullable. */ - @JsonProperty(value = "permissions") private List permissions; /* * The set of subscriptions on the item. Only supported on the root of a drive. */ - @JsonProperty(value = "subscriptions") private List subscriptions; /* * Collection containing [ThumbnailSet][] objects associated with the item. For more info, see [getting * thumbnails][]. Read-only. Nullable. */ - @JsonProperty(value = "thumbnails") private List thumbnails; /* - * The list of previous versions of the item. For more info, see [getting previous versions][]. Read-only. - * Nullable. + * The list of previous versions of the item. For more info, see [getting previous versions][]. Read-only. Nullable. */ - @JsonProperty(value = "versions") private List versions; /* * driveItem */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDriveItem class. */ + /** + * Creates an instance of MicrosoftGraphDriveItem class. + */ public MicrosoftGraphDriveItem() { } /** * Get the audio property: audio. - * + * * @return the audio value. */ public MicrosoftGraphAudio audio() { @@ -227,7 +200,7 @@ public MicrosoftGraphAudio audio() { /** * Set the audio property: audio. - * + * * @param audio the audio value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -238,7 +211,7 @@ public MicrosoftGraphDriveItem withAudio(MicrosoftGraphAudio audio) { /** * Get the content property: The content stream, if the item represents a file. - * + * * @return the content value. */ public byte[] content() { @@ -250,7 +223,7 @@ public byte[] content() { /** * Set the content property: The content stream, if the item represents a file. - * + * * @param content the content value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -266,7 +239,7 @@ public MicrosoftGraphDriveItem withContent(byte[] content) { /** * Get the cTag property: An eTag for the content of the item. This eTag is not changed if only the metadata is * changed. Note This property is not returned if the item is a folder. Read-only. - * + * * @return the cTag value. */ public String cTag() { @@ -276,7 +249,7 @@ public String cTag() { /** * Set the cTag property: An eTag for the content of the item. This eTag is not changed if only the metadata is * changed. Note This property is not returned if the item is a folder. Read-only. - * + * * @param cTag the cTag value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -287,7 +260,7 @@ public MicrosoftGraphDriveItem withCTag(String cTag) { /** * Get the deleted property: deleted. - * + * * @return the deleted value. */ public MicrosoftGraphDeleted deleted() { @@ -296,7 +269,7 @@ public MicrosoftGraphDeleted deleted() { /** * Set the deleted property: deleted. - * + * * @param deleted the deleted value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -307,7 +280,7 @@ public MicrosoftGraphDriveItem withDeleted(MicrosoftGraphDeleted deleted) { /** * Get the file property: file. - * + * * @return the file value. */ public MicrosoftGraphFile file() { @@ -316,7 +289,7 @@ public MicrosoftGraphFile file() { /** * Set the file property: file. - * + * * @param file the file value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -327,7 +300,7 @@ public MicrosoftGraphDriveItem withFile(MicrosoftGraphFile file) { /** * Get the fileSystemInfo property: fileSystemInfo. - * + * * @return the fileSystemInfo value. */ public MicrosoftGraphFileSystemInfo fileSystemInfo() { @@ -336,7 +309,7 @@ public MicrosoftGraphFileSystemInfo fileSystemInfo() { /** * Set the fileSystemInfo property: fileSystemInfo. - * + * * @param fileSystemInfo the fileSystemInfo value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -347,7 +320,7 @@ public MicrosoftGraphDriveItem withFileSystemInfo(MicrosoftGraphFileSystemInfo f /** * Get the folder property: folder. - * + * * @return the folder value. */ public MicrosoftGraphFolder folder() { @@ -356,7 +329,7 @@ public MicrosoftGraphFolder folder() { /** * Set the folder property: folder. - * + * * @param folder the folder value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -367,7 +340,7 @@ public MicrosoftGraphDriveItem withFolder(MicrosoftGraphFolder folder) { /** * Get the image property: image. - * + * * @return the image value. */ public MicrosoftGraphImage image() { @@ -376,7 +349,7 @@ public MicrosoftGraphImage image() { /** * Set the image property: image. - * + * * @param image the image value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -387,7 +360,7 @@ public MicrosoftGraphDriveItem withImage(MicrosoftGraphImage image) { /** * Get the location property: geoCoordinates. - * + * * @return the location value. */ public MicrosoftGraphGeoCoordinates location() { @@ -396,7 +369,7 @@ public MicrosoftGraphGeoCoordinates location() { /** * Set the location property: geoCoordinates. - * + * * @param location the location value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -407,7 +380,7 @@ public MicrosoftGraphDriveItem withLocation(MicrosoftGraphGeoCoordinates locatio /** * Get the packageProperty property: package. - * + * * @return the packageProperty value. */ public MicrosoftGraphPackage packageProperty() { @@ -416,7 +389,7 @@ public MicrosoftGraphPackage packageProperty() { /** * Set the packageProperty property: package. - * + * * @param packageProperty the packageProperty value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -427,7 +400,7 @@ public MicrosoftGraphDriveItem withPackageProperty(MicrosoftGraphPackage package /** * Get the pendingOperations property: pendingOperations. - * + * * @return the pendingOperations value. */ public MicrosoftGraphPendingOperations pendingOperations() { @@ -436,7 +409,7 @@ public MicrosoftGraphPendingOperations pendingOperations() { /** * Set the pendingOperations property: pendingOperations. - * + * * @param pendingOperations the pendingOperations value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -447,7 +420,7 @@ public MicrosoftGraphDriveItem withPendingOperations(MicrosoftGraphPendingOperat /** * Get the photo property: photo. - * + * * @return the photo value. */ public MicrosoftGraphPhoto photo() { @@ -456,7 +429,7 @@ public MicrosoftGraphPhoto photo() { /** * Set the photo property: photo. - * + * * @param photo the photo value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -467,7 +440,7 @@ public MicrosoftGraphDriveItem withPhoto(MicrosoftGraphPhoto photo) { /** * Get the publication property: publicationFacet. - * + * * @return the publication value. */ public MicrosoftGraphPublicationFacet publication() { @@ -476,7 +449,7 @@ public MicrosoftGraphPublicationFacet publication() { /** * Set the publication property: publicationFacet. - * + * * @param publication the publication value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -487,7 +460,7 @@ public MicrosoftGraphDriveItem withPublication(MicrosoftGraphPublicationFacet pu /** * Get the remoteItem property: remoteItem. - * + * * @return the remoteItem value. */ public MicrosoftGraphRemoteItem remoteItem() { @@ -496,7 +469,7 @@ public MicrosoftGraphRemoteItem remoteItem() { /** * Set the remoteItem property: remoteItem. - * + * * @param remoteItem the remoteItem value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -507,7 +480,7 @@ public MicrosoftGraphDriveItem withRemoteItem(MicrosoftGraphRemoteItem remoteIte /** * Get the root property: root. - * + * * @return the root value. */ public Map root() { @@ -516,7 +489,7 @@ public Map root() { /** * Set the root property: root. - * + * * @param root the root value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -527,7 +500,7 @@ public MicrosoftGraphDriveItem withRoot(Map root) { /** * Get the searchResult property: searchResult. - * + * * @return the searchResult value. */ public MicrosoftGraphSearchResult searchResult() { @@ -536,7 +509,7 @@ public MicrosoftGraphSearchResult searchResult() { /** * Set the searchResult property: searchResult. - * + * * @param searchResult the searchResult value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -547,7 +520,7 @@ public MicrosoftGraphDriveItem withSearchResult(MicrosoftGraphSearchResult searc /** * Get the shared property: shared. - * + * * @return the shared value. */ public MicrosoftGraphShared shared() { @@ -556,7 +529,7 @@ public MicrosoftGraphShared shared() { /** * Set the shared property: shared. - * + * * @param shared the shared value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -567,7 +540,7 @@ public MicrosoftGraphDriveItem withShared(MicrosoftGraphShared shared) { /** * Get the sharepointIds property: sharepointIds. - * + * * @return the sharepointIds value. */ public MicrosoftGraphSharepointIds sharepointIds() { @@ -576,7 +549,7 @@ public MicrosoftGraphSharepointIds sharepointIds() { /** * Set the sharepointIds property: sharepointIds. - * + * * @param sharepointIds the sharepointIds value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -587,7 +560,7 @@ public MicrosoftGraphDriveItem withSharepointIds(MicrosoftGraphSharepointIds sha /** * Get the size property: Size of the item in bytes. Read-only. - * + * * @return the size value. */ public Long size() { @@ -596,7 +569,7 @@ public Long size() { /** * Set the size property: Size of the item in bytes. Read-only. - * + * * @param size the size value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -607,7 +580,7 @@ public MicrosoftGraphDriveItem withSize(Long size) { /** * Get the specialFolder property: specialFolder. - * + * * @return the specialFolder value. */ public MicrosoftGraphSpecialFolder specialFolder() { @@ -616,7 +589,7 @@ public MicrosoftGraphSpecialFolder specialFolder() { /** * Set the specialFolder property: specialFolder. - * + * * @param specialFolder the specialFolder value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -627,7 +600,7 @@ public MicrosoftGraphDriveItem withSpecialFolder(MicrosoftGraphSpecialFolder spe /** * Get the video property: video. - * + * * @return the video value. */ public MicrosoftGraphVideo video() { @@ -636,7 +609,7 @@ public MicrosoftGraphVideo video() { /** * Set the video property: video. - * + * * @param video the video value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -647,7 +620,7 @@ public MicrosoftGraphDriveItem withVideo(MicrosoftGraphVideo video) { /** * Get the webDavUrl property: WebDAV compatible URL for the item. - * + * * @return the webDavUrl value. */ public String webDavUrl() { @@ -656,7 +629,7 @@ public String webDavUrl() { /** * Set the webDavUrl property: WebDAV compatible URL for the item. - * + * * @param webDavUrl the webDavUrl value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -667,7 +640,7 @@ public MicrosoftGraphDriveItem withWebDavUrl(String webDavUrl) { /** * Get the workbook property: workbook. - * + * * @return the workbook value. */ public MicrosoftGraphWorkbook workbook() { @@ -676,7 +649,7 @@ public MicrosoftGraphWorkbook workbook() { /** * Set the workbook property: workbook. - * + * * @param workbook the workbook value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -687,7 +660,7 @@ public MicrosoftGraphDriveItem withWorkbook(MicrosoftGraphWorkbook workbook) { /** * Get the analytics property: itemAnalytics. - * + * * @return the analytics value. */ public MicrosoftGraphItemAnalytics analytics() { @@ -696,7 +669,7 @@ public MicrosoftGraphItemAnalytics analytics() { /** * Set the analytics property: itemAnalytics. - * + * * @param analytics the analytics value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -708,7 +681,7 @@ public MicrosoftGraphDriveItem withAnalytics(MicrosoftGraphItemAnalytics analyti /** * Get the children property: Collection containing Item objects for the immediate children of Item. Only items * representing folders have children. Read-only. Nullable. - * + * * @return the children value. */ public List children() { @@ -718,7 +691,7 @@ public List children() { /** * Set the children property: Collection containing Item objects for the immediate children of Item. Only items * representing folders have children. Read-only. Nullable. - * + * * @param children the children value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -729,7 +702,7 @@ public MicrosoftGraphDriveItem withChildren(List childr /** * Get the listItem property: listItem. - * + * * @return the listItem value. */ public MicrosoftGraphListItem listItem() { @@ -738,7 +711,7 @@ public MicrosoftGraphListItem listItem() { /** * Set the listItem property: listItem. - * + * * @param listItem the listItem value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -749,7 +722,7 @@ public MicrosoftGraphDriveItem withListItem(MicrosoftGraphListItem listItem) { /** * Get the permissions property: The set of permissions for the item. Read-only. Nullable. - * + * * @return the permissions value. */ public List permissions() { @@ -758,7 +731,7 @@ public List permissions() { /** * Set the permissions property: The set of permissions for the item. Read-only. Nullable. - * + * * @param permissions the permissions value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -769,7 +742,7 @@ public MicrosoftGraphDriveItem withPermissions(List pe /** * Get the subscriptions property: The set of subscriptions on the item. Only supported on the root of a drive. - * + * * @return the subscriptions value. */ public List subscriptions() { @@ -778,7 +751,7 @@ public List subscriptions() { /** * Set the subscriptions property: The set of subscriptions on the item. Only supported on the root of a drive. - * + * * @param subscriptions the subscriptions value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -790,7 +763,7 @@ public MicrosoftGraphDriveItem withSubscriptions(List thumbnails() { @@ -800,7 +773,7 @@ public List thumbnails() { /** * Set the thumbnails property: Collection containing [ThumbnailSet][] objects associated with the item. For more * info, see [getting thumbnails][]. Read-only. Nullable. - * + * * @param thumbnails the thumbnails value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -812,7 +785,7 @@ public MicrosoftGraphDriveItem withThumbnails(List t /** * Get the versions property: The list of previous versions of the item. For more info, see [getting previous * versions][]. Read-only. Nullable. - * + * * @return the versions value. */ public List versions() { @@ -822,7 +795,7 @@ public List versions() { /** * Set the versions property: The list of previous versions of the item. For more info, see [getting previous * versions][]. Read-only. Nullable. - * + * * @param versions the versions value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -833,17 +806,16 @@ public MicrosoftGraphDriveItem withVersions(List /** * Get the additionalProperties property: driveItem. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: driveItem. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDriveItem object itself. */ @@ -852,92 +824,108 @@ public MicrosoftGraphDriveItem withAdditionalProperties(Map addi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withCreatedBy(MicrosoftGraphIdentitySet createdBy) { super.withCreatedBy(createdBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withEtag(String etag) { super.withEtag(etag); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withName(String name) { super.withName(name); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withParentReference(MicrosoftGraphItemReference parentReference) { super.withParentReference(parentReference); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withWebUrl(String webUrl) { super.withWebUrl(webUrl); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withCreatedByUser(MicrosoftGraphUserInner createdByUser) { super.withCreatedByUser(createdByUser); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withLastModifiedByUser(MicrosoftGraphUserInner lastModifiedByUser) { super.withLastModifiedByUser(lastModifiedByUser); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItem withId(String id) { super.withId(id); @@ -946,7 +934,7 @@ public MicrosoftGraphDriveItem withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -1028,4 +1016,195 @@ public void validate() { versions().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("createdBy", createdBy()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("eTag", etag()); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeJsonField("parentReference", parentReference()); + jsonWriter.writeStringField("webUrl", webUrl()); + jsonWriter.writeJsonField("createdByUser", createdByUser()); + jsonWriter.writeJsonField("lastModifiedByUser", lastModifiedByUser()); + jsonWriter.writeJsonField("audio", this.audio); + jsonWriter.writeStringField("content", Objects.toString(this.content, null)); + jsonWriter.writeStringField("cTag", this.cTag); + jsonWriter.writeJsonField("deleted", this.deleted); + jsonWriter.writeJsonField("file", this.file); + jsonWriter.writeJsonField("fileSystemInfo", this.fileSystemInfo); + jsonWriter.writeJsonField("folder", this.folder); + jsonWriter.writeJsonField("image", this.image); + jsonWriter.writeJsonField("location", this.location); + jsonWriter.writeJsonField("package", this.packageProperty); + jsonWriter.writeJsonField("pendingOperations", this.pendingOperations); + jsonWriter.writeJsonField("photo", this.photo); + jsonWriter.writeJsonField("publication", this.publication); + jsonWriter.writeJsonField("remoteItem", this.remoteItem); + jsonWriter.writeMapField("root", this.root, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeJsonField("searchResult", this.searchResult); + jsonWriter.writeJsonField("shared", this.shared); + jsonWriter.writeJsonField("sharepointIds", this.sharepointIds); + jsonWriter.writeNumberField("size", this.size); + jsonWriter.writeJsonField("specialFolder", this.specialFolder); + jsonWriter.writeJsonField("video", this.video); + jsonWriter.writeStringField("webDavUrl", this.webDavUrl); + jsonWriter.writeJsonField("workbook", this.workbook); + jsonWriter.writeJsonField("analytics", this.analytics); + jsonWriter.writeArrayField("children", this.children, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("listItem", this.listItem); + jsonWriter.writeArrayField("permissions", this.permissions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("subscriptions", this.subscriptions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("thumbnails", this.thumbnails, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("versions", this.versions, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDriveItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDriveItem 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 MicrosoftGraphDriveItem. + */ + public static MicrosoftGraphDriveItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDriveItem deserializedMicrosoftGraphDriveItem = new MicrosoftGraphDriveItem(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.withId(reader.getString()); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.withCreatedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.withDescription(reader.getString()); + } else if ("eTag".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.withEtag(reader.getString()); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.withName(reader.getString()); + } else if ("parentReference".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem + .withParentReference(MicrosoftGraphItemReference.fromJson(reader)); + } else if ("webUrl".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.withWebUrl(reader.getString()); + } else if ("createdByUser".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.withCreatedByUser(MicrosoftGraphUserInner.fromJson(reader)); + } else if ("lastModifiedByUser".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem + .withLastModifiedByUser(MicrosoftGraphUserInner.fromJson(reader)); + } else if ("audio".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.audio = MicrosoftGraphAudio.fromJson(reader); + } else if ("content".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.content + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("cTag".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.cTag = reader.getString(); + } else if ("deleted".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.deleted = MicrosoftGraphDeleted.fromJson(reader); + } else if ("file".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.file = MicrosoftGraphFile.fromJson(reader); + } else if ("fileSystemInfo".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.fileSystemInfo = MicrosoftGraphFileSystemInfo.fromJson(reader); + } else if ("folder".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.folder = MicrosoftGraphFolder.fromJson(reader); + } else if ("image".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.image = MicrosoftGraphImage.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.location = MicrosoftGraphGeoCoordinates.fromJson(reader); + } else if ("package".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.packageProperty = MicrosoftGraphPackage.fromJson(reader); + } else if ("pendingOperations".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.pendingOperations + = MicrosoftGraphPendingOperations.fromJson(reader); + } else if ("photo".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.photo = MicrosoftGraphPhoto.fromJson(reader); + } else if ("publication".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.publication = MicrosoftGraphPublicationFacet.fromJson(reader); + } else if ("remoteItem".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.remoteItem = MicrosoftGraphRemoteItem.fromJson(reader); + } else if ("root".equals(fieldName)) { + Map root = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphDriveItem.root = root; + } else if ("searchResult".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.searchResult = MicrosoftGraphSearchResult.fromJson(reader); + } else if ("shared".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.shared = MicrosoftGraphShared.fromJson(reader); + } else if ("sharepointIds".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.sharepointIds = MicrosoftGraphSharepointIds.fromJson(reader); + } else if ("size".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.size = reader.getNullable(JsonReader::getLong); + } else if ("specialFolder".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.specialFolder = MicrosoftGraphSpecialFolder.fromJson(reader); + } else if ("video".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.video = MicrosoftGraphVideo.fromJson(reader); + } else if ("webDavUrl".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.webDavUrl = reader.getString(); + } else if ("workbook".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.workbook = MicrosoftGraphWorkbook.fromJson(reader); + } else if ("analytics".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.analytics = MicrosoftGraphItemAnalytics.fromJson(reader); + } else if ("children".equals(fieldName)) { + List children + = reader.readArray(reader1 -> MicrosoftGraphDriveItem.fromJson(reader1)); + deserializedMicrosoftGraphDriveItem.children = children; + } else if ("listItem".equals(fieldName)) { + deserializedMicrosoftGraphDriveItem.listItem = MicrosoftGraphListItem.fromJson(reader); + } else if ("permissions".equals(fieldName)) { + List permissions + = reader.readArray(reader1 -> MicrosoftGraphPermission.fromJson(reader1)); + deserializedMicrosoftGraphDriveItem.permissions = permissions; + } else if ("subscriptions".equals(fieldName)) { + List subscriptions + = reader.readArray(reader1 -> MicrosoftGraphSubscription.fromJson(reader1)); + deserializedMicrosoftGraphDriveItem.subscriptions = subscriptions; + } else if ("thumbnails".equals(fieldName)) { + List thumbnails + = reader.readArray(reader1 -> MicrosoftGraphThumbnailSet.fromJson(reader1)); + deserializedMicrosoftGraphDriveItem.thumbnails = thumbnails; + } else if ("versions".equals(fieldName)) { + List versions + = reader.readArray(reader1 -> MicrosoftGraphDriveItemVersion.fromJson(reader1)); + deserializedMicrosoftGraphDriveItem.versions = versions; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDriveItem.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDriveItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDriveItemVersion.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDriveItemVersion.java index a99c418395442..a03e426ccc74b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDriveItemVersion.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphDriveItemVersion.java @@ -7,15 +7,19 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.Base64Url; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; -/** driveItemVersion. */ +/** + * driveItemVersion. + */ @Fluent public final class MicrosoftGraphDriveItemVersion extends MicrosoftGraphBaseItemVersion { private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; @@ -23,27 +27,27 @@ public final class MicrosoftGraphDriveItemVersion extends MicrosoftGraphBaseItem /* * The content stream for this version of the item. */ - @JsonProperty(value = "content") private Base64Url content; /* * Indicates the size of the content stream for this version of the item. */ - @JsonProperty(value = "size") private Long size; /* * driveItemVersion */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphDriveItemVersion class. */ + /** + * Creates an instance of MicrosoftGraphDriveItemVersion class. + */ public MicrosoftGraphDriveItemVersion() { } /** * Get the content property: The content stream for this version of the item. - * + * * @return the content value. */ public byte[] content() { @@ -55,7 +59,7 @@ public byte[] content() { /** * Set the content property: The content stream for this version of the item. - * + * * @param content the content value to set. * @return the MicrosoftGraphDriveItemVersion object itself. */ @@ -70,7 +74,7 @@ public MicrosoftGraphDriveItemVersion withContent(byte[] content) { /** * Get the size property: Indicates the size of the content stream for this version of the item. - * + * * @return the size value. */ public Long size() { @@ -79,7 +83,7 @@ public Long size() { /** * Set the size property: Indicates the size of the content stream for this version of the item. - * + * * @param size the size value to set. * @return the MicrosoftGraphDriveItemVersion object itself. */ @@ -90,17 +94,16 @@ public MicrosoftGraphDriveItemVersion withSize(Long size) { /** * Get the additionalProperties property: driveItemVersion. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: driveItemVersion. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphDriveItemVersion object itself. */ @@ -109,36 +112,36 @@ public MicrosoftGraphDriveItemVersion withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItemVersion withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItemVersion withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItemVersion withPublication(MicrosoftGraphPublicationFacet publication) { super.withPublication(publication); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphDriveItemVersion withId(String id) { super.withId(id); @@ -147,11 +150,81 @@ public MicrosoftGraphDriveItemVersion withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeJsonField("publication", publication()); + jsonWriter.writeStringField("content", Objects.toString(this.content, null)); + jsonWriter.writeNumberField("size", this.size); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphDriveItemVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphDriveItemVersion 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 MicrosoftGraphDriveItemVersion. + */ + public static MicrosoftGraphDriveItemVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphDriveItemVersion deserializedMicrosoftGraphDriveItemVersion + = new MicrosoftGraphDriveItemVersion(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphDriveItemVersion.withId(reader.getString()); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphDriveItemVersion + .withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphDriveItemVersion.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("publication".equals(fieldName)) { + deserializedMicrosoftGraphDriveItemVersion + .withPublication(MicrosoftGraphPublicationFacet.fromJson(reader)); + } else if ("content".equals(fieldName)) { + deserializedMicrosoftGraphDriveItemVersion.content + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("size".equals(fieldName)) { + deserializedMicrosoftGraphDriveItemVersion.size = reader.getNullable(JsonReader::getLong); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphDriveItemVersion.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphDriveItemVersion; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEmailAddress.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEmailAddress.java index 878c16c8b8424..b57075242c079 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEmailAddress.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEmailAddress.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** emailAddress. */ +/** + * emailAddress. + */ @Fluent -public final class MicrosoftGraphEmailAddress { +public final class MicrosoftGraphEmailAddress implements JsonSerializable { /* * The email address of the person or entity. */ - @JsonProperty(value = "address") private String address; /* * The display name of the person or entity. */ - @JsonProperty(value = "name") private String name; /* * emailAddress */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphEmailAddress class. */ + /** + * Creates an instance of MicrosoftGraphEmailAddress class. + */ public MicrosoftGraphEmailAddress() { } /** * Get the address property: The email address of the person or entity. - * + * * @return the address value. */ public String address() { @@ -47,7 +50,7 @@ public String address() { /** * Set the address property: The email address of the person or entity. - * + * * @param address the address value to set. * @return the MicrosoftGraphEmailAddress object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphEmailAddress withAddress(String address) { /** * Get the name property: The display name of the person or entity. - * + * * @return the name value. */ public String name() { @@ -67,7 +70,7 @@ public String name() { /** * Set the name property: The display name of the person or entity. - * + * * @param name the name value to set. * @return the MicrosoftGraphEmailAddress object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphEmailAddress withName(String name) { /** * Get the additionalProperties property: emailAddress. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: emailAddress. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphEmailAddress object itself. */ @@ -97,19 +99,61 @@ public MicrosoftGraphEmailAddress withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeStringField("name", this.name); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphEmailAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphEmailAddress 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 MicrosoftGraphEmailAddress. + */ + public static MicrosoftGraphEmailAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphEmailAddress deserializedMicrosoftGraphEmailAddress = new MicrosoftGraphEmailAddress(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedMicrosoftGraphEmailAddress.address = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphEmailAddress.name = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphEmailAddress.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphEmailAddress; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEmployeeOrgData.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEmployeeOrgData.java index e716771482e6a..c66e6dae1a832 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEmployeeOrgData.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEmployeeOrgData.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** employeeOrgData. */ +/** + * employeeOrgData. + */ @Fluent -public final class MicrosoftGraphEmployeeOrgData { +public final class MicrosoftGraphEmployeeOrgData implements JsonSerializable { /* * The cost center associated with the user. Returned only on $select. Supports $filter. */ - @JsonProperty(value = "costCenter") private String costCenter; /* * The name of the division in which the user works. Returned only on $select. Supports $filter. */ - @JsonProperty(value = "division") private String division; /* * employeeOrgData */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphEmployeeOrgData class. */ + /** + * Creates an instance of MicrosoftGraphEmployeeOrgData class. + */ public MicrosoftGraphEmployeeOrgData() { } /** * Get the costCenter property: The cost center associated with the user. Returned only on $select. Supports * $filter. - * + * * @return the costCenter value. */ public String costCenter() { @@ -49,7 +52,7 @@ public String costCenter() { /** * Set the costCenter property: The cost center associated with the user. Returned only on $select. Supports * $filter. - * + * * @param costCenter the costCenter value to set. * @return the MicrosoftGraphEmployeeOrgData object itself. */ @@ -61,7 +64,7 @@ public MicrosoftGraphEmployeeOrgData withCostCenter(String costCenter) { /** * Get the division property: The name of the division in which the user works. Returned only on $select. Supports * $filter. - * + * * @return the division value. */ public String division() { @@ -71,7 +74,7 @@ public String division() { /** * Set the division property: The name of the division in which the user works. Returned only on $select. Supports * $filter. - * + * * @param division the division value to set. * @return the MicrosoftGraphEmployeeOrgData object itself. */ @@ -82,17 +85,16 @@ public MicrosoftGraphEmployeeOrgData withDivision(String division) { /** * Get the additionalProperties property: employeeOrgData. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: employeeOrgData. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphEmployeeOrgData object itself. */ @@ -101,19 +103,62 @@ public MicrosoftGraphEmployeeOrgData withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("costCenter", this.costCenter); + jsonWriter.writeStringField("division", this.division); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphEmployeeOrgData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphEmployeeOrgData 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 MicrosoftGraphEmployeeOrgData. + */ + public static MicrosoftGraphEmployeeOrgData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphEmployeeOrgData deserializedMicrosoftGraphEmployeeOrgData + = new MicrosoftGraphEmployeeOrgData(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("costCenter".equals(fieldName)) { + deserializedMicrosoftGraphEmployeeOrgData.costCenter = reader.getString(); + } else if ("division".equals(fieldName)) { + deserializedMicrosoftGraphEmployeeOrgData.division = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphEmployeeOrgData.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphEmployeeOrgData; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEndpoint.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEndpoint.java index 818e103cb5832..d81f5aa74cb80 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEndpoint.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEndpoint.java @@ -5,68 +5,67 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; /** * endpoint - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent public final class MicrosoftGraphEndpoint extends MicrosoftGraphDirectoryObjectInner { /* - * Describes the capability that is associated with this resource. (e.g. Messages, Conversations, etc.) Not + * Describes the capability that is associated with this resource. (e.g. Messages, Conversations, etc.) Not * nullable. Read-only. */ - @JsonProperty(value = "capability") private String capability; /* * Application id of the publishing underlying service. Not nullable. Read-only. */ - @JsonProperty(value = "providerId") private String providerId; /* * Name of the publishing underlying service. Read-only. */ - @JsonProperty(value = "providerName") private String providerName; /* * For Microsoft 365 groups, this is set to a well-known name for the resource (e.g. Yammer.FeedURL etc.). Not * nullable. Read-only. */ - @JsonProperty(value = "providerResourceId") private String providerResourceId; /* * URL of the published resource. Not nullable. Read-only. */ - @JsonProperty(value = "uri") private String uri; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphEndpoint class. */ + /** + * Creates an instance of MicrosoftGraphEndpoint class. + */ public MicrosoftGraphEndpoint() { } /** * Get the capability property: Describes the capability that is associated with this resource. (e.g. Messages, * Conversations, etc.) Not nullable. Read-only. - * + * * @return the capability value. */ public String capability() { @@ -76,7 +75,7 @@ public String capability() { /** * Set the capability property: Describes the capability that is associated with this resource. (e.g. Messages, * Conversations, etc.) Not nullable. Read-only. - * + * * @param capability the capability value to set. * @return the MicrosoftGraphEndpoint object itself. */ @@ -87,7 +86,7 @@ public MicrosoftGraphEndpoint withCapability(String capability) { /** * Get the providerId property: Application id of the publishing underlying service. Not nullable. Read-only. - * + * * @return the providerId value. */ public String providerId() { @@ -96,7 +95,7 @@ public String providerId() { /** * Set the providerId property: Application id of the publishing underlying service. Not nullable. Read-only. - * + * * @param providerId the providerId value to set. * @return the MicrosoftGraphEndpoint object itself. */ @@ -107,7 +106,7 @@ public MicrosoftGraphEndpoint withProviderId(String providerId) { /** * Get the providerName property: Name of the publishing underlying service. Read-only. - * + * * @return the providerName value. */ public String providerName() { @@ -116,7 +115,7 @@ public String providerName() { /** * Set the providerName property: Name of the publishing underlying service. Read-only. - * + * * @param providerName the providerName value to set. * @return the MicrosoftGraphEndpoint object itself. */ @@ -128,7 +127,7 @@ public MicrosoftGraphEndpoint withProviderName(String providerName) { /** * Get the providerResourceId property: For Microsoft 365 groups, this is set to a well-known name for the resource * (e.g. Yammer.FeedURL etc.). Not nullable. Read-only. - * + * * @return the providerResourceId value. */ public String providerResourceId() { @@ -138,7 +137,7 @@ public String providerResourceId() { /** * Set the providerResourceId property: For Microsoft 365 groups, this is set to a well-known name for the resource * (e.g. Yammer.FeedURL etc.). Not nullable. Read-only. - * + * * @param providerResourceId the providerResourceId value to set. * @return the MicrosoftGraphEndpoint object itself. */ @@ -149,7 +148,7 @@ public MicrosoftGraphEndpoint withProviderResourceId(String providerResourceId) /** * Get the uri property: URL of the published resource. Not nullable. Read-only. - * + * * @return the uri value. */ public String uri() { @@ -158,7 +157,7 @@ public String uri() { /** * Set the uri property: URL of the published resource. Not nullable. Read-only. - * + * * @param uri the uri value to set. * @return the MicrosoftGraphEndpoint object itself. */ @@ -170,10 +169,9 @@ public MicrosoftGraphEndpoint withUri(String uri) { /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -181,7 +179,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphEndpoint object itself. */ @@ -190,22 +188,18 @@ public MicrosoftGraphEndpoint withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphEndpoint withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphEndpoint withId(String id) { super.withId(id); @@ -214,11 +208,78 @@ public MicrosoftGraphEndpoint withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("capability", this.capability); + jsonWriter.writeStringField("providerId", this.providerId); + jsonWriter.writeStringField("providerName", this.providerName); + jsonWriter.writeStringField("providerResourceId", this.providerResourceId); + jsonWriter.writeStringField("uri", this.uri); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphEndpoint 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 MicrosoftGraphEndpoint. + */ + public static MicrosoftGraphEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphEndpoint deserializedMicrosoftGraphEndpoint = new MicrosoftGraphEndpoint(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphEndpoint.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphEndpoint.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("capability".equals(fieldName)) { + deserializedMicrosoftGraphEndpoint.capability = reader.getString(); + } else if ("providerId".equals(fieldName)) { + deserializedMicrosoftGraphEndpoint.providerId = reader.getString(); + } else if ("providerName".equals(fieldName)) { + deserializedMicrosoftGraphEndpoint.providerName = reader.getString(); + } else if ("providerResourceId".equals(fieldName)) { + deserializedMicrosoftGraphEndpoint.providerResourceId = reader.getString(); + } else if ("uri".equals(fieldName)) { + deserializedMicrosoftGraphEndpoint.uri = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphEndpoint.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphEndpoint; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEntity.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEntity.java index 4288e7c25fa45..ddbe405bd971e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEntity.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEntity.java @@ -5,34 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** entity. */ +/** + * entity. + */ @Fluent -public class MicrosoftGraphEntity { +public class MicrosoftGraphEntity implements JsonSerializable { /* * Read-only. */ - @JsonProperty(value = "id") private String id; /* * entity */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphEntity class. */ + /** + * Creates an instance of MicrosoftGraphEntity class. + */ public MicrosoftGraphEntity() { } /** * Get the id property: Read-only. - * + * * @return the id value. */ public String id() { @@ -41,7 +45,7 @@ public String id() { /** * Set the id property: Read-only. - * + * * @param id the id value to set. * @return the MicrosoftGraphEntity object itself. */ @@ -52,17 +56,16 @@ public MicrosoftGraphEntity withId(String id) { /** * Get the additionalProperties property: entity. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: entity. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphEntity object itself. */ @@ -71,19 +74,58 @@ public MicrosoftGraphEntity withAdditionalProperties(Map additio return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphEntity 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 MicrosoftGraphEntity. + */ + public static MicrosoftGraphEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphEntity deserializedMicrosoftGraphEntity = new MicrosoftGraphEntity(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphEntity.id = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphEntity.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphEntity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEvent.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEvent.java index b26f27576d587..f6c1ebeb6957a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEvent.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEvent.java @@ -5,116 +5,104 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** event. */ +/** + * event. + */ @Fluent public final class MicrosoftGraphEvent extends MicrosoftGraphOutlookItem { /* * True if the meeting organizer allows invitees to propose a new time when responding, false otherwise. Optional. * Default is true. */ - @JsonProperty(value = "allowNewTimeProposals") private Boolean allowNewTimeProposals; /* * The collection of attendees for the event. */ - @JsonProperty(value = "attendees") private List attendees; /* * itemBody */ - @JsonProperty(value = "body") private MicrosoftGraphItemBody body; /* * The preview of the message associated with the event. It is in text format. */ - @JsonProperty(value = "bodyPreview") private String bodyPreview; /* * dateTimeTimeZone */ - @JsonProperty(value = "end") private MicrosoftGraphDateTimeZone end; /* * Set to true if the event has attachments. */ - @JsonProperty(value = "hasAttachments") private Boolean hasAttachments; /* * The hideAttendees property. */ - @JsonProperty(value = "hideAttendees") private Boolean hideAttendees; /* * A unique identifier for an event across calendars. This ID is different for each occurrence in a recurring * series. Read-only. */ - @JsonProperty(value = "iCalUId") private String iCalUId; /* * importance */ - @JsonProperty(value = "importance") private MicrosoftGraphImportance importance; /* * Set to true if the event lasts all day. */ - @JsonProperty(value = "isAllDay") private Boolean isAllDay; /* * Set to true if the event has been canceled. */ - @JsonProperty(value = "isCancelled") private Boolean isCancelled; /* * The isDraft property. */ - @JsonProperty(value = "isDraft") private Boolean isDraft; /* * True if this event has online meeting information, false otherwise. Default is false. Optional. */ - @JsonProperty(value = "isOnlineMeeting") private Boolean isOnlineMeeting; /* - * Set to true if the calendar owner (specified by the owner property of the calendar) is the organizer of the - * event (specified by the organizer property of the event). This also applies if a delegate organized the event on - * behalf of the owner. + * Set to true if the calendar owner (specified by the owner property of the calendar) is the organizer of the event + * (specified by the organizer property of the event). This also applies if a delegate organized the event on behalf + * of the owner. */ - @JsonProperty(value = "isOrganizer") private Boolean isOrganizer; /* * Set to true if an alert is set to remind the user of the event. */ - @JsonProperty(value = "isReminderOn") private Boolean isReminderOn; /* * location */ - @JsonProperty(value = "location") private MicrosoftGraphLocation location; /* @@ -122,123 +110,104 @@ public final class MicrosoftGraphEvent extends MicrosoftGraphOutlookItem { * with each other. If you update the location property, any prior locations in the locations collection would be * removed and replaced by the new location value. */ - @JsonProperty(value = "locations") private List locations; /* * onlineMeetingInfo */ - @JsonProperty(value = "onlineMeeting") private MicrosoftGraphOnlineMeetingInfo onlineMeeting; /* * onlineMeetingProviderType */ - @JsonProperty(value = "onlineMeetingProvider") private MicrosoftGraphOnlineMeetingProviderType onlineMeetingProvider; /* * A URL for an online meeting. The property is set only when an organizer specifies an event as an online meeting * such as a Skype meeting. Read-only. */ - @JsonProperty(value = "onlineMeetingUrl") private String onlineMeetingUrl; /* * recipient */ - @JsonProperty(value = "organizer") private MicrosoftGraphRecipient organizer; /* * The end time zone that was set when the event was created. A value of tzone://Microsoft/Custom indicates that a * legacy custom time zone was set in desktop Outlook. */ - @JsonProperty(value = "originalEndTimeZone") private String originalEndTimeZone; /* * The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "originalStart") private OffsetDateTime originalStart; /* - * The start time zone that was set when the event was created. A value of tzone://Microsoft/Custom indicates that - * a legacy custom time zone was set in desktop Outlook. + * The start time zone that was set when the event was created. A value of tzone://Microsoft/Custom indicates that a + * legacy custom time zone was set in desktop Outlook. */ - @JsonProperty(value = "originalStartTimeZone") private String originalStartTimeZone; /* * patternedRecurrence */ - @JsonProperty(value = "recurrence") private MicrosoftGraphPatternedRecurrence recurrence; /* * The number of minutes before the event start time that the reminder alert occurs. */ - @JsonProperty(value = "reminderMinutesBeforeStart") private Integer reminderMinutesBeforeStart; /* * Default is true, which represents the organizer would like an invitee to send a response to the event. */ - @JsonProperty(value = "responseRequested") private Boolean responseRequested; /* * responseStatus */ - @JsonProperty(value = "responseStatus") private MicrosoftGraphResponseStatus responseStatus; /* * sensitivity */ - @JsonProperty(value = "sensitivity") private MicrosoftGraphSensitivity sensitivity; /* * The ID for the recurring series master item, if this event is part of a recurring series. */ - @JsonProperty(value = "seriesMasterId") private String seriesMasterId; /* * freeBusyStatus */ - @JsonProperty(value = "showAs") private MicrosoftGraphFreeBusyStatus showAs; /* * dateTimeTimeZone */ - @JsonProperty(value = "start") private MicrosoftGraphDateTimeZone start; /* * The text of the event's subject line. */ - @JsonProperty(value = "subject") private String subject; /* - * A custom identifier specified by a client app for the server to avoid redundant POST operations in case of - * client retries to create the same event. This is useful when low network connectivity causes the client to time - * out before receiving a response from the server for the client's prior create-event request. After you set + * A custom identifier specified by a client app for the server to avoid redundant POST operations in case of client + * retries to create the same event. This is useful when low network connectivity causes the client to time out + * before receiving a response from the server for the client's prior create-event request. After you set * transactionId when creating an event, you cannot change transactionId in a subsequent update. This property is * only returned in a response payload if an app has set it. Optional. */ - @JsonProperty(value = "transactionId") private String transactionId; /* * eventType */ - @JsonProperty(value = "type") private MicrosoftGraphEventType type; /* @@ -246,59 +215,54 @@ public final class MicrosoftGraphEvent extends MicrosoftGraphOutlookItem { * signed in to your mailbox. Otherwise, Outlook on the web prompts you to sign in.This URL cannot be accessed from * within an iFrame. */ - @JsonProperty(value = "webLink") private String webLink; /* * The collection of fileAttachment and itemAttachment attachments for the event. Navigation property. Read-only. * Nullable. */ - @JsonProperty(value = "attachments") private List attachments; /* * calendar */ - @JsonProperty(value = "calendar") private MicrosoftGraphCalendar calendar; /* * The collection of open extensions defined for the event. Read-only. Nullable. */ - @JsonProperty(value = "extensions") private List extensions; /* * The instances of the event. Navigation property. Read-only. Nullable. */ - @JsonProperty(value = "instances") private List instances; /* * The collection of multi-value extended properties defined for the event. Read-only. Nullable. */ - @JsonProperty(value = "multiValueExtendedProperties") private List multiValueExtendedProperties; /* * The collection of single-value extended properties defined for the event. Read-only. Nullable. */ - @JsonProperty(value = "singleValueExtendedProperties") private List singleValueExtendedProperties; /* * event */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphEvent class. */ + /** + * Creates an instance of MicrosoftGraphEvent class. + */ public MicrosoftGraphEvent() { } /** * Get the allowNewTimeProposals property: True if the meeting organizer allows invitees to propose a new time when * responding, false otherwise. Optional. Default is true. - * + * * @return the allowNewTimeProposals value. */ public Boolean allowNewTimeProposals() { @@ -308,7 +272,7 @@ public Boolean allowNewTimeProposals() { /** * Set the allowNewTimeProposals property: True if the meeting organizer allows invitees to propose a new time when * responding, false otherwise. Optional. Default is true. - * + * * @param allowNewTimeProposals the allowNewTimeProposals value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -319,7 +283,7 @@ public MicrosoftGraphEvent withAllowNewTimeProposals(Boolean allowNewTimeProposa /** * Get the attendees property: The collection of attendees for the event. - * + * * @return the attendees value. */ public List attendees() { @@ -328,7 +292,7 @@ public List attendees() { /** * Set the attendees property: The collection of attendees for the event. - * + * * @param attendees the attendees value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -339,7 +303,7 @@ public MicrosoftGraphEvent withAttendees(List attendees) /** * Get the body property: itemBody. - * + * * @return the body value. */ public MicrosoftGraphItemBody body() { @@ -348,7 +312,7 @@ public MicrosoftGraphItemBody body() { /** * Set the body property: itemBody. - * + * * @param body the body value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -359,7 +323,7 @@ public MicrosoftGraphEvent withBody(MicrosoftGraphItemBody body) { /** * Get the bodyPreview property: The preview of the message associated with the event. It is in text format. - * + * * @return the bodyPreview value. */ public String bodyPreview() { @@ -368,7 +332,7 @@ public String bodyPreview() { /** * Set the bodyPreview property: The preview of the message associated with the event. It is in text format. - * + * * @param bodyPreview the bodyPreview value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -379,7 +343,7 @@ public MicrosoftGraphEvent withBodyPreview(String bodyPreview) { /** * Get the end property: dateTimeTimeZone. - * + * * @return the end value. */ public MicrosoftGraphDateTimeZone end() { @@ -388,7 +352,7 @@ public MicrosoftGraphDateTimeZone end() { /** * Set the end property: dateTimeTimeZone. - * + * * @param end the end value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -399,7 +363,7 @@ public MicrosoftGraphEvent withEnd(MicrosoftGraphDateTimeZone end) { /** * Get the hasAttachments property: Set to true if the event has attachments. - * + * * @return the hasAttachments value. */ public Boolean hasAttachments() { @@ -408,7 +372,7 @@ public Boolean hasAttachments() { /** * Set the hasAttachments property: Set to true if the event has attachments. - * + * * @param hasAttachments the hasAttachments value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -419,7 +383,7 @@ public MicrosoftGraphEvent withHasAttachments(Boolean hasAttachments) { /** * Get the hideAttendees property: The hideAttendees property. - * + * * @return the hideAttendees value. */ public Boolean hideAttendees() { @@ -428,7 +392,7 @@ public Boolean hideAttendees() { /** * Set the hideAttendees property: The hideAttendees property. - * + * * @param hideAttendees the hideAttendees value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -440,7 +404,7 @@ public MicrosoftGraphEvent withHideAttendees(Boolean hideAttendees) { /** * Get the iCalUId property: A unique identifier for an event across calendars. This ID is different for each * occurrence in a recurring series. Read-only. - * + * * @return the iCalUId value. */ public String iCalUId() { @@ -450,7 +414,7 @@ public String iCalUId() { /** * Set the iCalUId property: A unique identifier for an event across calendars. This ID is different for each * occurrence in a recurring series. Read-only. - * + * * @param iCalUId the iCalUId value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -461,7 +425,7 @@ public MicrosoftGraphEvent withICalUId(String iCalUId) { /** * Get the importance property: importance. - * + * * @return the importance value. */ public MicrosoftGraphImportance importance() { @@ -470,7 +434,7 @@ public MicrosoftGraphImportance importance() { /** * Set the importance property: importance. - * + * * @param importance the importance value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -481,7 +445,7 @@ public MicrosoftGraphEvent withImportance(MicrosoftGraphImportance importance) { /** * Get the isAllDay property: Set to true if the event lasts all day. - * + * * @return the isAllDay value. */ public Boolean isAllDay() { @@ -490,7 +454,7 @@ public Boolean isAllDay() { /** * Set the isAllDay property: Set to true if the event lasts all day. - * + * * @param isAllDay the isAllDay value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -501,7 +465,7 @@ public MicrosoftGraphEvent withIsAllDay(Boolean isAllDay) { /** * Get the isCancelled property: Set to true if the event has been canceled. - * + * * @return the isCancelled value. */ public Boolean isCancelled() { @@ -510,7 +474,7 @@ public Boolean isCancelled() { /** * Set the isCancelled property: Set to true if the event has been canceled. - * + * * @param isCancelled the isCancelled value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -521,7 +485,7 @@ public MicrosoftGraphEvent withIsCancelled(Boolean isCancelled) { /** * Get the isDraft property: The isDraft property. - * + * * @return the isDraft value. */ public Boolean isDraft() { @@ -530,7 +494,7 @@ public Boolean isDraft() { /** * Set the isDraft property: The isDraft property. - * + * * @param isDraft the isDraft value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -542,7 +506,7 @@ public MicrosoftGraphEvent withIsDraft(Boolean isDraft) { /** * Get the isOnlineMeeting property: True if this event has online meeting information, false otherwise. Default is * false. Optional. - * + * * @return the isOnlineMeeting value. */ public Boolean isOnlineMeeting() { @@ -552,7 +516,7 @@ public Boolean isOnlineMeeting() { /** * Set the isOnlineMeeting property: True if this event has online meeting information, false otherwise. Default is * false. Optional. - * + * * @param isOnlineMeeting the isOnlineMeeting value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -565,7 +529,7 @@ public MicrosoftGraphEvent withIsOnlineMeeting(Boolean isOnlineMeeting) { * Get the isOrganizer property: Set to true if the calendar owner (specified by the owner property of the calendar) * is the organizer of the event (specified by the organizer property of the event). This also applies if a delegate * organized the event on behalf of the owner. - * + * * @return the isOrganizer value. */ public Boolean isOrganizer() { @@ -576,7 +540,7 @@ public Boolean isOrganizer() { * Set the isOrganizer property: Set to true if the calendar owner (specified by the owner property of the calendar) * is the organizer of the event (specified by the organizer property of the event). This also applies if a delegate * organized the event on behalf of the owner. - * + * * @param isOrganizer the isOrganizer value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -587,7 +551,7 @@ public MicrosoftGraphEvent withIsOrganizer(Boolean isOrganizer) { /** * Get the isReminderOn property: Set to true if an alert is set to remind the user of the event. - * + * * @return the isReminderOn value. */ public Boolean isReminderOn() { @@ -596,7 +560,7 @@ public Boolean isReminderOn() { /** * Set the isReminderOn property: Set to true if an alert is set to remind the user of the event. - * + * * @param isReminderOn the isReminderOn value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -607,7 +571,7 @@ public MicrosoftGraphEvent withIsReminderOn(Boolean isReminderOn) { /** * Get the location property: location. - * + * * @return the location value. */ public MicrosoftGraphLocation location() { @@ -616,7 +580,7 @@ public MicrosoftGraphLocation location() { /** * Set the location property: location. - * + * * @param location the location value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -629,7 +593,7 @@ public MicrosoftGraphEvent withLocation(MicrosoftGraphLocation location) { * Get the locations property: The locations where the event is held or attended from. The location and locations * properties always correspond with each other. If you update the location property, any prior locations in the * locations collection would be removed and replaced by the new location value. - * + * * @return the locations value. */ public List locations() { @@ -640,7 +604,7 @@ public List locations() { * Set the locations property: The locations where the event is held or attended from. The location and locations * properties always correspond with each other. If you update the location property, any prior locations in the * locations collection would be removed and replaced by the new location value. - * + * * @param locations the locations value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -651,7 +615,7 @@ public MicrosoftGraphEvent withLocations(List locations) /** * Get the onlineMeeting property: onlineMeetingInfo. - * + * * @return the onlineMeeting value. */ public MicrosoftGraphOnlineMeetingInfo onlineMeeting() { @@ -660,7 +624,7 @@ public MicrosoftGraphOnlineMeetingInfo onlineMeeting() { /** * Set the onlineMeeting property: onlineMeetingInfo. - * + * * @param onlineMeeting the onlineMeeting value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -671,7 +635,7 @@ public MicrosoftGraphEvent withOnlineMeeting(MicrosoftGraphOnlineMeetingInfo onl /** * Get the onlineMeetingProvider property: onlineMeetingProviderType. - * + * * @return the onlineMeetingProvider value. */ public MicrosoftGraphOnlineMeetingProviderType onlineMeetingProvider() { @@ -680,12 +644,12 @@ public MicrosoftGraphOnlineMeetingProviderType onlineMeetingProvider() { /** * Set the onlineMeetingProvider property: onlineMeetingProviderType. - * + * * @param onlineMeetingProvider the onlineMeetingProvider value to set. * @return the MicrosoftGraphEvent object itself. */ - public MicrosoftGraphEvent withOnlineMeetingProvider( - MicrosoftGraphOnlineMeetingProviderType onlineMeetingProvider) { + public MicrosoftGraphEvent + withOnlineMeetingProvider(MicrosoftGraphOnlineMeetingProviderType onlineMeetingProvider) { this.onlineMeetingProvider = onlineMeetingProvider; return this; } @@ -693,7 +657,7 @@ public MicrosoftGraphEvent withOnlineMeetingProvider( /** * Get the onlineMeetingUrl property: A URL for an online meeting. The property is set only when an organizer * specifies an event as an online meeting such as a Skype meeting. Read-only. - * + * * @return the onlineMeetingUrl value. */ public String onlineMeetingUrl() { @@ -703,7 +667,7 @@ public String onlineMeetingUrl() { /** * Set the onlineMeetingUrl property: A URL for an online meeting. The property is set only when an organizer * specifies an event as an online meeting such as a Skype meeting. Read-only. - * + * * @param onlineMeetingUrl the onlineMeetingUrl value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -714,7 +678,7 @@ public MicrosoftGraphEvent withOnlineMeetingUrl(String onlineMeetingUrl) { /** * Get the organizer property: recipient. - * + * * @return the organizer value. */ public MicrosoftGraphRecipient organizer() { @@ -723,7 +687,7 @@ public MicrosoftGraphRecipient organizer() { /** * Set the organizer property: recipient. - * + * * @param organizer the organizer value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -735,7 +699,7 @@ public MicrosoftGraphEvent withOrganizer(MicrosoftGraphRecipient organizer) { /** * Get the originalEndTimeZone property: The end time zone that was set when the event was created. A value of * tzone://Microsoft/Custom indicates that a legacy custom time zone was set in desktop Outlook. - * + * * @return the originalEndTimeZone value. */ public String originalEndTimeZone() { @@ -745,7 +709,7 @@ public String originalEndTimeZone() { /** * Set the originalEndTimeZone property: The end time zone that was set when the event was created. A value of * tzone://Microsoft/Custom indicates that a legacy custom time zone was set in desktop Outlook. - * + * * @param originalEndTimeZone the originalEndTimeZone value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -757,7 +721,7 @@ public MicrosoftGraphEvent withOriginalEndTimeZone(String originalEndTimeZone) { /** * Get the originalStart property: The Timestamp type represents date and time information using ISO 8601 format and * is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @return the originalStart value. */ public OffsetDateTime originalStart() { @@ -767,7 +731,7 @@ public OffsetDateTime originalStart() { /** * Set the originalStart property: The Timestamp type represents date and time information using ISO 8601 format and * is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @param originalStart the originalStart value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -779,7 +743,7 @@ public MicrosoftGraphEvent withOriginalStart(OffsetDateTime originalStart) { /** * Get the originalStartTimeZone property: The start time zone that was set when the event was created. A value of * tzone://Microsoft/Custom indicates that a legacy custom time zone was set in desktop Outlook. - * + * * @return the originalStartTimeZone value. */ public String originalStartTimeZone() { @@ -789,7 +753,7 @@ public String originalStartTimeZone() { /** * Set the originalStartTimeZone property: The start time zone that was set when the event was created. A value of * tzone://Microsoft/Custom indicates that a legacy custom time zone was set in desktop Outlook. - * + * * @param originalStartTimeZone the originalStartTimeZone value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -800,7 +764,7 @@ public MicrosoftGraphEvent withOriginalStartTimeZone(String originalStartTimeZon /** * Get the recurrence property: patternedRecurrence. - * + * * @return the recurrence value. */ public MicrosoftGraphPatternedRecurrence recurrence() { @@ -809,7 +773,7 @@ public MicrosoftGraphPatternedRecurrence recurrence() { /** * Set the recurrence property: patternedRecurrence. - * + * * @param recurrence the recurrence value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -821,7 +785,7 @@ public MicrosoftGraphEvent withRecurrence(MicrosoftGraphPatternedRecurrence recu /** * Get the reminderMinutesBeforeStart property: The number of minutes before the event start time that the reminder * alert occurs. - * + * * @return the reminderMinutesBeforeStart value. */ public Integer reminderMinutesBeforeStart() { @@ -831,7 +795,7 @@ public Integer reminderMinutesBeforeStart() { /** * Set the reminderMinutesBeforeStart property: The number of minutes before the event start time that the reminder * alert occurs. - * + * * @param reminderMinutesBeforeStart the reminderMinutesBeforeStart value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -843,7 +807,7 @@ public MicrosoftGraphEvent withReminderMinutesBeforeStart(Integer reminderMinute /** * Get the responseRequested property: Default is true, which represents the organizer would like an invitee to send * a response to the event. - * + * * @return the responseRequested value. */ public Boolean responseRequested() { @@ -853,7 +817,7 @@ public Boolean responseRequested() { /** * Set the responseRequested property: Default is true, which represents the organizer would like an invitee to send * a response to the event. - * + * * @param responseRequested the responseRequested value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -864,7 +828,7 @@ public MicrosoftGraphEvent withResponseRequested(Boolean responseRequested) { /** * Get the responseStatus property: responseStatus. - * + * * @return the responseStatus value. */ public MicrosoftGraphResponseStatus responseStatus() { @@ -873,7 +837,7 @@ public MicrosoftGraphResponseStatus responseStatus() { /** * Set the responseStatus property: responseStatus. - * + * * @param responseStatus the responseStatus value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -884,7 +848,7 @@ public MicrosoftGraphEvent withResponseStatus(MicrosoftGraphResponseStatus respo /** * Get the sensitivity property: sensitivity. - * + * * @return the sensitivity value. */ public MicrosoftGraphSensitivity sensitivity() { @@ -893,7 +857,7 @@ public MicrosoftGraphSensitivity sensitivity() { /** * Set the sensitivity property: sensitivity. - * + * * @param sensitivity the sensitivity value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -905,7 +869,7 @@ public MicrosoftGraphEvent withSensitivity(MicrosoftGraphSensitivity sensitivity /** * Get the seriesMasterId property: The ID for the recurring series master item, if this event is part of a * recurring series. - * + * * @return the seriesMasterId value. */ public String seriesMasterId() { @@ -915,7 +879,7 @@ public String seriesMasterId() { /** * Set the seriesMasterId property: The ID for the recurring series master item, if this event is part of a * recurring series. - * + * * @param seriesMasterId the seriesMasterId value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -926,7 +890,7 @@ public MicrosoftGraphEvent withSeriesMasterId(String seriesMasterId) { /** * Get the showAs property: freeBusyStatus. - * + * * @return the showAs value. */ public MicrosoftGraphFreeBusyStatus showAs() { @@ -935,7 +899,7 @@ public MicrosoftGraphFreeBusyStatus showAs() { /** * Set the showAs property: freeBusyStatus. - * + * * @param showAs the showAs value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -946,7 +910,7 @@ public MicrosoftGraphEvent withShowAs(MicrosoftGraphFreeBusyStatus showAs) { /** * Get the start property: dateTimeTimeZone. - * + * * @return the start value. */ public MicrosoftGraphDateTimeZone start() { @@ -955,7 +919,7 @@ public MicrosoftGraphDateTimeZone start() { /** * Set the start property: dateTimeTimeZone. - * + * * @param start the start value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -966,7 +930,7 @@ public MicrosoftGraphEvent withStart(MicrosoftGraphDateTimeZone start) { /** * Get the subject property: The text of the event's subject line. - * + * * @return the subject value. */ public String subject() { @@ -975,7 +939,7 @@ public String subject() { /** * Set the subject property: The text of the event's subject line. - * + * * @param subject the subject value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -990,7 +954,7 @@ public MicrosoftGraphEvent withSubject(String subject) { * causes the client to time out before receiving a response from the server for the client's prior create-event * request. After you set transactionId when creating an event, you cannot change transactionId in a subsequent * update. This property is only returned in a response payload if an app has set it. Optional. - * + * * @return the transactionId value. */ public String transactionId() { @@ -1003,7 +967,7 @@ public String transactionId() { * causes the client to time out before receiving a response from the server for the client's prior create-event * request. After you set transactionId when creating an event, you cannot change transactionId in a subsequent * update. This property is only returned in a response payload if an app has set it. Optional. - * + * * @param transactionId the transactionId value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -1014,7 +978,7 @@ public MicrosoftGraphEvent withTransactionId(String transactionId) { /** * Get the type property: eventType. - * + * * @return the type value. */ public MicrosoftGraphEventType type() { @@ -1023,7 +987,7 @@ public MicrosoftGraphEventType type() { /** * Set the type property: eventType. - * + * * @param type the type value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -1036,7 +1000,7 @@ public MicrosoftGraphEvent withType(MicrosoftGraphEventType type) { * Get the webLink property: The URL to open the event in Outlook on the web.Outlook on the web opens the event in * the browser if you are signed in to your mailbox. Otherwise, Outlook on the web prompts you to sign in.This URL * cannot be accessed from within an iFrame. - * + * * @return the webLink value. */ public String webLink() { @@ -1047,7 +1011,7 @@ public String webLink() { * Set the webLink property: The URL to open the event in Outlook on the web.Outlook on the web opens the event in * the browser if you are signed in to your mailbox. Otherwise, Outlook on the web prompts you to sign in.This URL * cannot be accessed from within an iFrame. - * + * * @param webLink the webLink value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -1059,7 +1023,7 @@ public MicrosoftGraphEvent withWebLink(String webLink) { /** * Get the attachments property: The collection of fileAttachment and itemAttachment attachments for the event. * Navigation property. Read-only. Nullable. - * + * * @return the attachments value. */ public List attachments() { @@ -1069,7 +1033,7 @@ public List attachments() { /** * Set the attachments property: The collection of fileAttachment and itemAttachment attachments for the event. * Navigation property. Read-only. Nullable. - * + * * @param attachments the attachments value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -1080,7 +1044,7 @@ public MicrosoftGraphEvent withAttachments(List attach /** * Get the calendar property: calendar. - * + * * @return the calendar value. */ public MicrosoftGraphCalendar calendar() { @@ -1089,7 +1053,7 @@ public MicrosoftGraphCalendar calendar() { /** * Set the calendar property: calendar. - * + * * @param calendar the calendar value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -1100,7 +1064,7 @@ public MicrosoftGraphEvent withCalendar(MicrosoftGraphCalendar calendar) { /** * Get the extensions property: The collection of open extensions defined for the event. Read-only. Nullable. - * + * * @return the extensions value. */ public List extensions() { @@ -1109,7 +1073,7 @@ public List extensions() { /** * Set the extensions property: The collection of open extensions defined for the event. Read-only. Nullable. - * + * * @param extensions the extensions value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -1120,7 +1084,7 @@ public MicrosoftGraphEvent withExtensions(List extensio /** * Get the instances property: The instances of the event. Navigation property. Read-only. Nullable. - * + * * @return the instances value. */ public List instances() { @@ -1129,7 +1093,7 @@ public List instances() { /** * Set the instances property: The instances of the event. Navigation property. Read-only. Nullable. - * + * * @param instances the instances value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -1141,7 +1105,7 @@ public MicrosoftGraphEvent withInstances(List instances) { /** * Get the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * event. Read-only. Nullable. - * + * * @return the multiValueExtendedProperties value. */ public List multiValueExtendedProperties() { @@ -1151,7 +1115,7 @@ public List multiValueExtendedPr /** * Set the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * event. Read-only. Nullable. - * + * * @param multiValueExtendedProperties the multiValueExtendedProperties value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -1164,7 +1128,7 @@ public MicrosoftGraphEvent withMultiValueExtendedProperties( /** * Get the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the event. Read-only. Nullable. - * + * * @return the singleValueExtendedProperties value. */ public List singleValueExtendedProperties() { @@ -1174,7 +1138,7 @@ public List singleValueExtended /** * Set the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the event. Read-only. Nullable. - * + * * @param singleValueExtendedProperties the singleValueExtendedProperties value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -1186,17 +1150,16 @@ public MicrosoftGraphEvent withSingleValueExtendedProperties( /** * Get the additionalProperties property: event. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: event. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphEvent object itself. */ @@ -1205,43 +1168,45 @@ public MicrosoftGraphEvent withAdditionalProperties(Map addition return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphEvent withCategories(List categories) { super.withCategories(categories); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphEvent withChangeKey(String changeKey) { super.withChangeKey(changeKey); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphEvent withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphEvent withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphEvent withId(String id) { super.withId(id); @@ -1250,7 +1215,7 @@ public MicrosoftGraphEvent withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -1305,4 +1270,219 @@ public void validate() { singleValueExtendedProperties().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("categories", categories(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("changeKey", changeKey()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeBooleanField("allowNewTimeProposals", this.allowNewTimeProposals); + jsonWriter.writeArrayField("attendees", this.attendees, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("body", this.body); + jsonWriter.writeStringField("bodyPreview", this.bodyPreview); + jsonWriter.writeJsonField("end", this.end); + jsonWriter.writeBooleanField("hasAttachments", this.hasAttachments); + jsonWriter.writeBooleanField("hideAttendees", this.hideAttendees); + jsonWriter.writeStringField("iCalUId", this.iCalUId); + jsonWriter.writeStringField("importance", this.importance == null ? null : this.importance.toString()); + jsonWriter.writeBooleanField("isAllDay", this.isAllDay); + jsonWriter.writeBooleanField("isCancelled", this.isCancelled); + jsonWriter.writeBooleanField("isDraft", this.isDraft); + jsonWriter.writeBooleanField("isOnlineMeeting", this.isOnlineMeeting); + jsonWriter.writeBooleanField("isOrganizer", this.isOrganizer); + jsonWriter.writeBooleanField("isReminderOn", this.isReminderOn); + jsonWriter.writeJsonField("location", this.location); + jsonWriter.writeArrayField("locations", this.locations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("onlineMeeting", this.onlineMeeting); + jsonWriter.writeStringField("onlineMeetingProvider", + this.onlineMeetingProvider == null ? null : this.onlineMeetingProvider.toString()); + jsonWriter.writeStringField("onlineMeetingUrl", this.onlineMeetingUrl); + jsonWriter.writeJsonField("organizer", this.organizer); + jsonWriter.writeStringField("originalEndTimeZone", this.originalEndTimeZone); + jsonWriter.writeStringField("originalStart", + this.originalStart == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.originalStart)); + jsonWriter.writeStringField("originalStartTimeZone", this.originalStartTimeZone); + jsonWriter.writeJsonField("recurrence", this.recurrence); + jsonWriter.writeNumberField("reminderMinutesBeforeStart", this.reminderMinutesBeforeStart); + jsonWriter.writeBooleanField("responseRequested", this.responseRequested); + jsonWriter.writeJsonField("responseStatus", this.responseStatus); + jsonWriter.writeStringField("sensitivity", this.sensitivity == null ? null : this.sensitivity.toString()); + jsonWriter.writeStringField("seriesMasterId", this.seriesMasterId); + jsonWriter.writeStringField("showAs", this.showAs == null ? null : this.showAs.toString()); + jsonWriter.writeJsonField("start", this.start); + jsonWriter.writeStringField("subject", this.subject); + jsonWriter.writeStringField("transactionId", this.transactionId); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("webLink", this.webLink); + jsonWriter.writeArrayField("attachments", this.attachments, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("calendar", this.calendar); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("instances", this.instances, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("multiValueExtendedProperties", this.multiValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("singleValueExtendedProperties", this.singleValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphEvent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphEvent 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 MicrosoftGraphEvent. + */ + public static MicrosoftGraphEvent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphEvent deserializedMicrosoftGraphEvent = new MicrosoftGraphEvent(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphEvent.withId(reader.getString()); + } else if ("categories".equals(fieldName)) { + List categories = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphEvent.withCategories(categories); + } else if ("changeKey".equals(fieldName)) { + deserializedMicrosoftGraphEvent.withChangeKey(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphEvent.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphEvent.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("allowNewTimeProposals".equals(fieldName)) { + deserializedMicrosoftGraphEvent.allowNewTimeProposals = reader.getNullable(JsonReader::getBoolean); + } else if ("attendees".equals(fieldName)) { + List attendees + = reader.readArray(reader1 -> MicrosoftGraphAttendee.fromJson(reader1)); + deserializedMicrosoftGraphEvent.attendees = attendees; + } else if ("body".equals(fieldName)) { + deserializedMicrosoftGraphEvent.body = MicrosoftGraphItemBody.fromJson(reader); + } else if ("bodyPreview".equals(fieldName)) { + deserializedMicrosoftGraphEvent.bodyPreview = reader.getString(); + } else if ("end".equals(fieldName)) { + deserializedMicrosoftGraphEvent.end = MicrosoftGraphDateTimeZone.fromJson(reader); + } else if ("hasAttachments".equals(fieldName)) { + deserializedMicrosoftGraphEvent.hasAttachments = reader.getNullable(JsonReader::getBoolean); + } else if ("hideAttendees".equals(fieldName)) { + deserializedMicrosoftGraphEvent.hideAttendees = reader.getNullable(JsonReader::getBoolean); + } else if ("iCalUId".equals(fieldName)) { + deserializedMicrosoftGraphEvent.iCalUId = reader.getString(); + } else if ("importance".equals(fieldName)) { + deserializedMicrosoftGraphEvent.importance + = MicrosoftGraphImportance.fromString(reader.getString()); + } else if ("isAllDay".equals(fieldName)) { + deserializedMicrosoftGraphEvent.isAllDay = reader.getNullable(JsonReader::getBoolean); + } else if ("isCancelled".equals(fieldName)) { + deserializedMicrosoftGraphEvent.isCancelled = reader.getNullable(JsonReader::getBoolean); + } else if ("isDraft".equals(fieldName)) { + deserializedMicrosoftGraphEvent.isDraft = reader.getNullable(JsonReader::getBoolean); + } else if ("isOnlineMeeting".equals(fieldName)) { + deserializedMicrosoftGraphEvent.isOnlineMeeting = reader.getNullable(JsonReader::getBoolean); + } else if ("isOrganizer".equals(fieldName)) { + deserializedMicrosoftGraphEvent.isOrganizer = reader.getNullable(JsonReader::getBoolean); + } else if ("isReminderOn".equals(fieldName)) { + deserializedMicrosoftGraphEvent.isReminderOn = reader.getNullable(JsonReader::getBoolean); + } else if ("location".equals(fieldName)) { + deserializedMicrosoftGraphEvent.location = MicrosoftGraphLocation.fromJson(reader); + } else if ("locations".equals(fieldName)) { + List locations + = reader.readArray(reader1 -> MicrosoftGraphLocation.fromJson(reader1)); + deserializedMicrosoftGraphEvent.locations = locations; + } else if ("onlineMeeting".equals(fieldName)) { + deserializedMicrosoftGraphEvent.onlineMeeting = MicrosoftGraphOnlineMeetingInfo.fromJson(reader); + } else if ("onlineMeetingProvider".equals(fieldName)) { + deserializedMicrosoftGraphEvent.onlineMeetingProvider + = MicrosoftGraphOnlineMeetingProviderType.fromString(reader.getString()); + } else if ("onlineMeetingUrl".equals(fieldName)) { + deserializedMicrosoftGraphEvent.onlineMeetingUrl = reader.getString(); + } else if ("organizer".equals(fieldName)) { + deserializedMicrosoftGraphEvent.organizer = MicrosoftGraphRecipient.fromJson(reader); + } else if ("originalEndTimeZone".equals(fieldName)) { + deserializedMicrosoftGraphEvent.originalEndTimeZone = reader.getString(); + } else if ("originalStart".equals(fieldName)) { + deserializedMicrosoftGraphEvent.originalStart = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("originalStartTimeZone".equals(fieldName)) { + deserializedMicrosoftGraphEvent.originalStartTimeZone = reader.getString(); + } else if ("recurrence".equals(fieldName)) { + deserializedMicrosoftGraphEvent.recurrence = MicrosoftGraphPatternedRecurrence.fromJson(reader); + } else if ("reminderMinutesBeforeStart".equals(fieldName)) { + deserializedMicrosoftGraphEvent.reminderMinutesBeforeStart = reader.getNullable(JsonReader::getInt); + } else if ("responseRequested".equals(fieldName)) { + deserializedMicrosoftGraphEvent.responseRequested = reader.getNullable(JsonReader::getBoolean); + } else if ("responseStatus".equals(fieldName)) { + deserializedMicrosoftGraphEvent.responseStatus = MicrosoftGraphResponseStatus.fromJson(reader); + } else if ("sensitivity".equals(fieldName)) { + deserializedMicrosoftGraphEvent.sensitivity + = MicrosoftGraphSensitivity.fromString(reader.getString()); + } else if ("seriesMasterId".equals(fieldName)) { + deserializedMicrosoftGraphEvent.seriesMasterId = reader.getString(); + } else if ("showAs".equals(fieldName)) { + deserializedMicrosoftGraphEvent.showAs + = MicrosoftGraphFreeBusyStatus.fromString(reader.getString()); + } else if ("start".equals(fieldName)) { + deserializedMicrosoftGraphEvent.start = MicrosoftGraphDateTimeZone.fromJson(reader); + } else if ("subject".equals(fieldName)) { + deserializedMicrosoftGraphEvent.subject = reader.getString(); + } else if ("transactionId".equals(fieldName)) { + deserializedMicrosoftGraphEvent.transactionId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphEvent.type = MicrosoftGraphEventType.fromString(reader.getString()); + } else if ("webLink".equals(fieldName)) { + deserializedMicrosoftGraphEvent.webLink = reader.getString(); + } else if ("attachments".equals(fieldName)) { + List attachments + = reader.readArray(reader1 -> MicrosoftGraphAttachment.fromJson(reader1)); + deserializedMicrosoftGraphEvent.attachments = attachments; + } else if ("calendar".equals(fieldName)) { + deserializedMicrosoftGraphEvent.calendar = MicrosoftGraphCalendar.fromJson(reader); + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> MicrosoftGraphExtension.fromJson(reader1)); + deserializedMicrosoftGraphEvent.extensions = extensions; + } else if ("instances".equals(fieldName)) { + List instances + = reader.readArray(reader1 -> MicrosoftGraphEvent.fromJson(reader1)); + deserializedMicrosoftGraphEvent.instances = instances; + } else if ("multiValueExtendedProperties".equals(fieldName)) { + List multiValueExtendedProperties + = reader.readArray(reader1 -> MicrosoftGraphMultiValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphEvent.multiValueExtendedProperties = multiValueExtendedProperties; + } else if ("singleValueExtendedProperties".equals(fieldName)) { + List singleValueExtendedProperties = reader + .readArray(reader1 -> MicrosoftGraphSingleValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphEvent.singleValueExtendedProperties = singleValueExtendedProperties; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphEvent.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphEvent; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEventType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEventType.java index 9cdde10b7f0f3..fa2e6e326e833 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEventType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphEventType.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** eventType. */ +/** + * eventType. + */ public final class MicrosoftGraphEventType extends ExpandableStringEnum { - /** Static value singleInstance for MicrosoftGraphEventType. */ + /** + * Static value singleInstance for MicrosoftGraphEventType. + */ public static final MicrosoftGraphEventType SINGLE_INSTANCE = fromString("singleInstance"); - /** Static value occurrence for MicrosoftGraphEventType. */ + /** + * Static value occurrence for MicrosoftGraphEventType. + */ public static final MicrosoftGraphEventType OCCURRENCE = fromString("occurrence"); - /** Static value exception for MicrosoftGraphEventType. */ + /** + * Static value exception for MicrosoftGraphEventType. + */ public static final MicrosoftGraphEventType EXCEPTION = fromString("exception"); - /** Static value seriesMaster for MicrosoftGraphEventType. */ + /** + * Static value seriesMaster for MicrosoftGraphEventType. + */ public static final MicrosoftGraphEventType SERIES_MASTER = fromString("seriesMaster"); /** * Creates a new instance of MicrosoftGraphEventType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public MicrosoftGraphEventType() { /** * Creates or finds a MicrosoftGraphEventType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphEventType. */ - @JsonCreator public static MicrosoftGraphEventType fromString(String name) { return fromString(name, MicrosoftGraphEventType.class); } /** * Gets known MicrosoftGraphEventType values. - * + * * @return known MicrosoftGraphEventType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExtension.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExtension.java index 1a7a4b40bc6ea..0e80c67fdfb5c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExtension.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExtension.java @@ -5,37 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** extension. */ +/** + * extension. + */ @Fluent public final class MicrosoftGraphExtension extends MicrosoftGraphEntity { /* * extension */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphExtension class. */ + /** + * Creates an instance of MicrosoftGraphExtension class. + */ public MicrosoftGraphExtension() { } /** * Get the additionalProperties property: extension. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: extension. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphExtension object itself. */ @@ -44,15 +48,9 @@ public MicrosoftGraphExtension withAdditionalProperties(Map addi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphExtension withId(String id) { super.withId(id); @@ -61,11 +59,58 @@ public MicrosoftGraphExtension withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphExtension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphExtension 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 MicrosoftGraphExtension. + */ + public static MicrosoftGraphExtension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphExtension deserializedMicrosoftGraphExtension = new MicrosoftGraphExtension(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphExtension.withId(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphExtension.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphExtension; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExtensionPropertyInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExtensionPropertyInner.java index 54c1d23bf721b..40e8d2786c782 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExtensionPropertyInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExtensionPropertyInner.java @@ -5,19 +5,21 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * extensionProperty - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -25,7 +27,6 @@ public final class MicrosoftGraphExtensionPropertyInner extends MicrosoftGraphDi /* * Display name of the application object on which this extension property is defined. Read-only. */ - @JsonProperty(value = "appDisplayName") private String appDisplayName; /* @@ -33,41 +34,39 @@ public final class MicrosoftGraphExtensionPropertyInner extends MicrosoftGraphDi * nullable. Binary - 256 bytes maximumBooleanDateTime - Must be specified in ISO 8601 format. Will be stored in * UTC.Integer - 32-bit value.LargeInteger - 64-bit value.String - 256 characters maximum */ - @JsonProperty(value = "dataType") private String dataType; /* * Indicates if this extension property was sycned from onpremises directory using Azure AD Connect. Read-only. */ - @JsonProperty(value = "isSyncedFromOnPremises") private Boolean isSyncedFromOnPremises; /* * Name of the extension property. Not nullable. */ - @JsonProperty(value = "name") private String name; /* * Following values are supported. Not nullable. UserGroupOrganizationDeviceApplication */ - @JsonProperty(value = "targetObjects") private List targetObjects; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphExtensionPropertyInner class. */ + /** + * Creates an instance of MicrosoftGraphExtensionPropertyInner class. + */ public MicrosoftGraphExtensionPropertyInner() { } /** * Get the appDisplayName property: Display name of the application object on which this extension property is * defined. Read-only. - * + * * @return the appDisplayName value. */ public String appDisplayName() { @@ -77,7 +76,7 @@ public String appDisplayName() { /** * Set the appDisplayName property: Display name of the application object on which this extension property is * defined. Read-only. - * + * * @param appDisplayName the appDisplayName value to set. * @return the MicrosoftGraphExtensionPropertyInner object itself. */ @@ -90,7 +89,7 @@ public MicrosoftGraphExtensionPropertyInner withAppDisplayName(String appDisplay * Get the dataType property: Specifies the data type of the value the extension property can hold. Following values * are supported. Not nullable. Binary - 256 bytes maximumBooleanDateTime - Must be specified in ISO 8601 format. * Will be stored in UTC.Integer - 32-bit value.LargeInteger - 64-bit value.String - 256 characters maximum. - * + * * @return the dataType value. */ public String dataType() { @@ -101,7 +100,7 @@ public String dataType() { * Set the dataType property: Specifies the data type of the value the extension property can hold. Following values * are supported. Not nullable. Binary - 256 bytes maximumBooleanDateTime - Must be specified in ISO 8601 format. * Will be stored in UTC.Integer - 32-bit value.LargeInteger - 64-bit value.String - 256 characters maximum. - * + * * @param dataType the dataType value to set. * @return the MicrosoftGraphExtensionPropertyInner object itself. */ @@ -113,7 +112,7 @@ public MicrosoftGraphExtensionPropertyInner withDataType(String dataType) { /** * Get the isSyncedFromOnPremises property: Indicates if this extension property was sycned from onpremises * directory using Azure AD Connect. Read-only. - * + * * @return the isSyncedFromOnPremises value. */ public Boolean isSyncedFromOnPremises() { @@ -123,7 +122,7 @@ public Boolean isSyncedFromOnPremises() { /** * Set the isSyncedFromOnPremises property: Indicates if this extension property was sycned from onpremises * directory using Azure AD Connect. Read-only. - * + * * @param isSyncedFromOnPremises the isSyncedFromOnPremises value to set. * @return the MicrosoftGraphExtensionPropertyInner object itself. */ @@ -134,7 +133,7 @@ public MicrosoftGraphExtensionPropertyInner withIsSyncedFromOnPremises(Boolean i /** * Get the name property: Name of the extension property. Not nullable. - * + * * @return the name value. */ public String name() { @@ -143,7 +142,7 @@ public String name() { /** * Set the name property: Name of the extension property. Not nullable. - * + * * @param name the name value to set. * @return the MicrosoftGraphExtensionPropertyInner object itself. */ @@ -155,7 +154,7 @@ public MicrosoftGraphExtensionPropertyInner withName(String name) { /** * Get the targetObjects property: Following values are supported. Not nullable. * UserGroupOrganizationDeviceApplication. - * + * * @return the targetObjects value. */ public List targetObjects() { @@ -165,7 +164,7 @@ public List targetObjects() { /** * Set the targetObjects property: Following values are supported. Not nullable. * UserGroupOrganizationDeviceApplication. - * + * * @param targetObjects the targetObjects value to set. * @return the MicrosoftGraphExtensionPropertyInner object itself. */ @@ -177,10 +176,9 @@ public MicrosoftGraphExtensionPropertyInner withTargetObjects(List targe /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -188,7 +186,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphExtensionPropertyInner object itself. */ @@ -197,22 +195,18 @@ public MicrosoftGraphExtensionPropertyInner withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphExtensionPropertyInner withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphExtensionPropertyInner withId(String id) { super.withId(id); @@ -221,11 +215,82 @@ public MicrosoftGraphExtensionPropertyInner withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("appDisplayName", this.appDisplayName); + jsonWriter.writeStringField("dataType", this.dataType); + jsonWriter.writeBooleanField("isSyncedFromOnPremises", this.isSyncedFromOnPremises); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("targetObjects", this.targetObjects, + (writer, element) -> writer.writeString(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphExtensionPropertyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphExtensionPropertyInner 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 MicrosoftGraphExtensionPropertyInner. + */ + public static MicrosoftGraphExtensionPropertyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphExtensionPropertyInner deserializedMicrosoftGraphExtensionPropertyInner + = new MicrosoftGraphExtensionPropertyInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphExtensionPropertyInner.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphExtensionPropertyInner.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("appDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphExtensionPropertyInner.appDisplayName = reader.getString(); + } else if ("dataType".equals(fieldName)) { + deserializedMicrosoftGraphExtensionPropertyInner.dataType = reader.getString(); + } else if ("isSyncedFromOnPremises".equals(fieldName)) { + deserializedMicrosoftGraphExtensionPropertyInner.isSyncedFromOnPremises + = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphExtensionPropertyInner.name = reader.getString(); + } else if ("targetObjects".equals(fieldName)) { + List targetObjects = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphExtensionPropertyInner.targetObjects = targetObjects; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphExtensionPropertyInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphExtensionPropertyInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExternalAudienceScope.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExternalAudienceScope.java index 175cb1913453b..cd8d93691f052 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExternalAudienceScope.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExternalAudienceScope.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** externalAudienceScope. */ +/** + * externalAudienceScope. + */ public final class MicrosoftGraphExternalAudienceScope extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphExternalAudienceScope. */ + /** + * Static value none for MicrosoftGraphExternalAudienceScope. + */ public static final MicrosoftGraphExternalAudienceScope NONE = fromString("none"); - /** Static value contactsOnly for MicrosoftGraphExternalAudienceScope. */ + /** + * Static value contactsOnly for MicrosoftGraphExternalAudienceScope. + */ public static final MicrosoftGraphExternalAudienceScope CONTACTS_ONLY = fromString("contactsOnly"); - /** Static value all for MicrosoftGraphExternalAudienceScope. */ + /** + * Static value all for MicrosoftGraphExternalAudienceScope. + */ public static final MicrosoftGraphExternalAudienceScope ALL = fromString("all"); /** * Creates a new instance of MicrosoftGraphExternalAudienceScope value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +38,17 @@ public MicrosoftGraphExternalAudienceScope() { /** * Creates or finds a MicrosoftGraphExternalAudienceScope from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphExternalAudienceScope. */ - @JsonCreator public static MicrosoftGraphExternalAudienceScope fromString(String name) { return fromString(name, MicrosoftGraphExternalAudienceScope.class); } /** * Gets known MicrosoftGraphExternalAudienceScope values. - * + * * @return known MicrosoftGraphExternalAudienceScope values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExternalLink.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExternalLink.java index b775918bd8b2f..95aa231cc532d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExternalLink.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphExternalLink.java @@ -5,34 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** externalLink. */ +/** + * externalLink. + */ @Fluent -public final class MicrosoftGraphExternalLink { +public final class MicrosoftGraphExternalLink implements JsonSerializable { /* * The url of the link. */ - @JsonProperty(value = "href") private String href; /* * externalLink */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphExternalLink class. */ + /** + * Creates an instance of MicrosoftGraphExternalLink class. + */ public MicrosoftGraphExternalLink() { } /** * Get the href property: The url of the link. - * + * * @return the href value. */ public String href() { @@ -41,7 +45,7 @@ public String href() { /** * Set the href property: The url of the link. - * + * * @param href the href value to set. * @return the MicrosoftGraphExternalLink object itself. */ @@ -52,17 +56,16 @@ public MicrosoftGraphExternalLink withHref(String href) { /** * Get the additionalProperties property: externalLink. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: externalLink. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphExternalLink object itself. */ @@ -71,19 +74,58 @@ public MicrosoftGraphExternalLink withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("href", this.href); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphExternalLink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphExternalLink 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 MicrosoftGraphExternalLink. + */ + public static MicrosoftGraphExternalLink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphExternalLink deserializedMicrosoftGraphExternalLink = new MicrosoftGraphExternalLink(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("href".equals(fieldName)) { + deserializedMicrosoftGraphExternalLink.href = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphExternalLink.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphExternalLink; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFieldValueSet.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFieldValueSet.java index c7d2e53f434d5..c0bd0e714ab74 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFieldValueSet.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFieldValueSet.java @@ -5,37 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** fieldValueSet. */ +/** + * fieldValueSet. + */ @Fluent public final class MicrosoftGraphFieldValueSet extends MicrosoftGraphEntity { /* * fieldValueSet */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphFieldValueSet class. */ + /** + * Creates an instance of MicrosoftGraphFieldValueSet class. + */ public MicrosoftGraphFieldValueSet() { } /** * Get the additionalProperties property: fieldValueSet. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: fieldValueSet. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphFieldValueSet object itself. */ @@ -44,15 +48,9 @@ public MicrosoftGraphFieldValueSet withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphFieldValueSet withId(String id) { super.withId(id); @@ -61,11 +59,58 @@ public MicrosoftGraphFieldValueSet withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphFieldValueSet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphFieldValueSet 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 MicrosoftGraphFieldValueSet. + */ + public static MicrosoftGraphFieldValueSet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphFieldValueSet deserializedMicrosoftGraphFieldValueSet = new MicrosoftGraphFieldValueSet(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphFieldValueSet.withId(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphFieldValueSet.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphFieldValueSet; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFile.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFile.java index 92a83c00790b6..18f68cfd95bee 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFile.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFile.java @@ -5,47 +5,49 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** file. */ +/** + * file. + */ @Fluent -public final class MicrosoftGraphFile { +public final class MicrosoftGraphFile implements JsonSerializable { /* * hashes */ - @JsonProperty(value = "hashes") private MicrosoftGraphHashes hashes; /* * The MIME type for the file. This is determined by logic on the server and might not be the value provided when * the file was uploaded. Read-only. */ - @JsonProperty(value = "mimeType") private String mimeType; /* * The processingMetadata property. */ - @JsonProperty(value = "processingMetadata") private Boolean processingMetadata; /* * file */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphFile class. */ + /** + * Creates an instance of MicrosoftGraphFile class. + */ public MicrosoftGraphFile() { } /** * Get the hashes property: hashes. - * + * * @return the hashes value. */ public MicrosoftGraphHashes hashes() { @@ -54,7 +56,7 @@ public MicrosoftGraphHashes hashes() { /** * Set the hashes property: hashes. - * + * * @param hashes the hashes value to set. * @return the MicrosoftGraphFile object itself. */ @@ -66,7 +68,7 @@ public MicrosoftGraphFile withHashes(MicrosoftGraphHashes hashes) { /** * Get the mimeType property: The MIME type for the file. This is determined by logic on the server and might not be * the value provided when the file was uploaded. Read-only. - * + * * @return the mimeType value. */ public String mimeType() { @@ -76,7 +78,7 @@ public String mimeType() { /** * Set the mimeType property: The MIME type for the file. This is determined by logic on the server and might not be * the value provided when the file was uploaded. Read-only. - * + * * @param mimeType the mimeType value to set. * @return the MicrosoftGraphFile object itself. */ @@ -87,7 +89,7 @@ public MicrosoftGraphFile withMimeType(String mimeType) { /** * Get the processingMetadata property: The processingMetadata property. - * + * * @return the processingMetadata value. */ public Boolean processingMetadata() { @@ -96,7 +98,7 @@ public Boolean processingMetadata() { /** * Set the processingMetadata property: The processingMetadata property. - * + * * @param processingMetadata the processingMetadata value to set. * @return the MicrosoftGraphFile object itself. */ @@ -107,17 +109,16 @@ public MicrosoftGraphFile withProcessingMetadata(Boolean processingMetadata) { /** * Get the additionalProperties property: file. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: file. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphFile object itself. */ @@ -126,17 +127,9 @@ public MicrosoftGraphFile withAdditionalProperties(Map additiona return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -144,4 +137,57 @@ public void validate() { hashes().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("hashes", this.hashes); + jsonWriter.writeStringField("mimeType", this.mimeType); + jsonWriter.writeBooleanField("processingMetadata", this.processingMetadata); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphFile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphFile 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 MicrosoftGraphFile. + */ + public static MicrosoftGraphFile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphFile deserializedMicrosoftGraphFile = new MicrosoftGraphFile(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hashes".equals(fieldName)) { + deserializedMicrosoftGraphFile.hashes = MicrosoftGraphHashes.fromJson(reader); + } else if ("mimeType".equals(fieldName)) { + deserializedMicrosoftGraphFile.mimeType = reader.getString(); + } else if ("processingMetadata".equals(fieldName)) { + deserializedMicrosoftGraphFile.processingMetadata = reader.getNullable(JsonReader::getBoolean); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphFile.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphFile; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFileSystemInfo.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFileSystemInfo.java index 1311c9c2a06f2..a4425d3d1961a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFileSystemInfo.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFileSystemInfo.java @@ -5,47 +5,51 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** fileSystemInfo. */ +/** + * fileSystemInfo. + */ @Fluent -public final class MicrosoftGraphFileSystemInfo { +public final class MicrosoftGraphFileSystemInfo implements JsonSerializable { /* * The UTC date and time the file was created on a client. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * The UTC date and time the file was last accessed. Available for the recent file list only. */ - @JsonProperty(value = "lastAccessedDateTime") private OffsetDateTime lastAccessedDateTime; /* * The UTC date and time the file was last modified on a client. */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * fileSystemInfo */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphFileSystemInfo class. */ + /** + * Creates an instance of MicrosoftGraphFileSystemInfo class. + */ public MicrosoftGraphFileSystemInfo() { } /** * Get the createdDateTime property: The UTC date and time the file was created on a client. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -54,7 +58,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: The UTC date and time the file was created on a client. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphFileSystemInfo object itself. */ @@ -66,7 +70,7 @@ public MicrosoftGraphFileSystemInfo withCreatedDateTime(OffsetDateTime createdDa /** * Get the lastAccessedDateTime property: The UTC date and time the file was last accessed. Available for the recent * file list only. - * + * * @return the lastAccessedDateTime value. */ public OffsetDateTime lastAccessedDateTime() { @@ -76,7 +80,7 @@ public OffsetDateTime lastAccessedDateTime() { /** * Set the lastAccessedDateTime property: The UTC date and time the file was last accessed. Available for the recent * file list only. - * + * * @param lastAccessedDateTime the lastAccessedDateTime value to set. * @return the MicrosoftGraphFileSystemInfo object itself. */ @@ -87,7 +91,7 @@ public MicrosoftGraphFileSystemInfo withLastAccessedDateTime(OffsetDateTime last /** * Get the lastModifiedDateTime property: The UTC date and time the file was last modified on a client. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -96,7 +100,7 @@ public OffsetDateTime lastModifiedDateTime() { /** * Set the lastModifiedDateTime property: The UTC date and time the file was last modified on a client. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphFileSystemInfo object itself. */ @@ -107,17 +111,16 @@ public MicrosoftGraphFileSystemInfo withLastModifiedDateTime(OffsetDateTime last /** * Get the additionalProperties property: fileSystemInfo. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: fileSystemInfo. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphFileSystemInfo object itself. */ @@ -126,19 +129,74 @@ public MicrosoftGraphFileSystemInfo withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastAccessedDateTime", + this.lastAccessedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastAccessedDateTime)); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphFileSystemInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphFileSystemInfo 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 MicrosoftGraphFileSystemInfo. + */ + public static MicrosoftGraphFileSystemInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphFileSystemInfo deserializedMicrosoftGraphFileSystemInfo = new MicrosoftGraphFileSystemInfo(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphFileSystemInfo.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastAccessedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphFileSystemInfo.lastAccessedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphFileSystemInfo.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphFileSystemInfo.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphFileSystemInfo; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFolder.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFolder.java index 55014fa7a72de..a43b9144b5e17 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFolder.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFolder.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** folder. */ +/** + * folder. + */ @Fluent -public final class MicrosoftGraphFolder { +public final class MicrosoftGraphFolder implements JsonSerializable { /* * Number of children contained immediately within this container. */ - @JsonProperty(value = "childCount") private Integer childCount; /* * folderView */ - @JsonProperty(value = "view") private MicrosoftGraphFolderView view; /* * folder */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphFolder class. */ + /** + * Creates an instance of MicrosoftGraphFolder class. + */ public MicrosoftGraphFolder() { } /** * Get the childCount property: Number of children contained immediately within this container. - * + * * @return the childCount value. */ public Integer childCount() { @@ -47,7 +50,7 @@ public Integer childCount() { /** * Set the childCount property: Number of children contained immediately within this container. - * + * * @param childCount the childCount value to set. * @return the MicrosoftGraphFolder object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphFolder withChildCount(Integer childCount) { /** * Get the view property: folderView. - * + * * @return the view value. */ public MicrosoftGraphFolderView view() { @@ -67,7 +70,7 @@ public MicrosoftGraphFolderView view() { /** * Set the view property: folderView. - * + * * @param view the view value to set. * @return the MicrosoftGraphFolder object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphFolder withView(MicrosoftGraphFolderView view) { /** * Get the additionalProperties property: folder. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: folder. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphFolder object itself. */ @@ -97,17 +99,9 @@ public MicrosoftGraphFolder withAdditionalProperties(Map additio return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -115,4 +109,54 @@ public void validate() { view().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("childCount", this.childCount); + jsonWriter.writeJsonField("view", this.view); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphFolder from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphFolder 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 MicrosoftGraphFolder. + */ + public static MicrosoftGraphFolder fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphFolder deserializedMicrosoftGraphFolder = new MicrosoftGraphFolder(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("childCount".equals(fieldName)) { + deserializedMicrosoftGraphFolder.childCount = reader.getNullable(JsonReader::getInt); + } else if ("view".equals(fieldName)) { + deserializedMicrosoftGraphFolder.view = MicrosoftGraphFolderView.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphFolder.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphFolder; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFolderView.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFolderView.java index 8390bbdc46128..fb6e09aec317b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFolderView.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFolderView.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** folderView. */ +/** + * folderView. + */ @Fluent -public final class MicrosoftGraphFolderView { +public final class MicrosoftGraphFolderView implements JsonSerializable { /* * The method by which the folder should be sorted. */ - @JsonProperty(value = "sortBy") private String sortBy; /* * If true, indicates that items should be sorted in descending order. Otherwise, items should be sorted ascending. */ - @JsonProperty(value = "sortOrder") private String sortOrder; /* * The type of view that should be used to represent the folder. */ - @JsonProperty(value = "viewType") private String viewType; /* * folderView */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphFolderView class. */ + /** + * Creates an instance of MicrosoftGraphFolderView class. + */ public MicrosoftGraphFolderView() { } /** * Get the sortBy property: The method by which the folder should be sorted. - * + * * @return the sortBy value. */ public String sortBy() { @@ -53,7 +55,7 @@ public String sortBy() { /** * Set the sortBy property: The method by which the folder should be sorted. - * + * * @param sortBy the sortBy value to set. * @return the MicrosoftGraphFolderView object itself. */ @@ -65,7 +67,7 @@ public MicrosoftGraphFolderView withSortBy(String sortBy) { /** * Get the sortOrder property: If true, indicates that items should be sorted in descending order. Otherwise, items * should be sorted ascending. - * + * * @return the sortOrder value. */ public String sortOrder() { @@ -75,7 +77,7 @@ public String sortOrder() { /** * Set the sortOrder property: If true, indicates that items should be sorted in descending order. Otherwise, items * should be sorted ascending. - * + * * @param sortOrder the sortOrder value to set. * @return the MicrosoftGraphFolderView object itself. */ @@ -86,7 +88,7 @@ public MicrosoftGraphFolderView withSortOrder(String sortOrder) { /** * Get the viewType property: The type of view that should be used to represent the folder. - * + * * @return the viewType value. */ public String viewType() { @@ -95,7 +97,7 @@ public String viewType() { /** * Set the viewType property: The type of view that should be used to represent the folder. - * + * * @param viewType the viewType value to set. * @return the MicrosoftGraphFolderView object itself. */ @@ -106,17 +108,16 @@ public MicrosoftGraphFolderView withViewType(String viewType) { /** * Get the additionalProperties property: folderView. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: folderView. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphFolderView object itself. */ @@ -125,19 +126,64 @@ public MicrosoftGraphFolderView withAdditionalProperties(Map add return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sortBy", this.sortBy); + jsonWriter.writeStringField("sortOrder", this.sortOrder); + jsonWriter.writeStringField("viewType", this.viewType); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphFolderView from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphFolderView 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 MicrosoftGraphFolderView. + */ + public static MicrosoftGraphFolderView fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphFolderView deserializedMicrosoftGraphFolderView = new MicrosoftGraphFolderView(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sortBy".equals(fieldName)) { + deserializedMicrosoftGraphFolderView.sortBy = reader.getString(); + } else if ("sortOrder".equals(fieldName)) { + deserializedMicrosoftGraphFolderView.sortOrder = reader.getString(); + } else if ("viewType".equals(fieldName)) { + deserializedMicrosoftGraphFolderView.viewType = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphFolderView.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphFolderView; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFollowupFlag.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFollowupFlag.java index 6555b355ea185..3a92ea0728594 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFollowupFlag.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFollowupFlag.java @@ -5,52 +5,53 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** followupFlag. */ +/** + * followupFlag. + */ @Fluent -public final class MicrosoftGraphFollowupFlag { +public final class MicrosoftGraphFollowupFlag implements JsonSerializable { /* * dateTimeTimeZone */ - @JsonProperty(value = "completedDateTime") private MicrosoftGraphDateTimeZone completedDateTime; /* * dateTimeTimeZone */ - @JsonProperty(value = "dueDateTime") private MicrosoftGraphDateTimeZone dueDateTime; /* * followupFlagStatus */ - @JsonProperty(value = "flagStatus") private MicrosoftGraphFollowupFlagStatus flagStatus; /* * dateTimeTimeZone */ - @JsonProperty(value = "startDateTime") private MicrosoftGraphDateTimeZone startDateTime; /* * followupFlag */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphFollowupFlag class. */ + /** + * Creates an instance of MicrosoftGraphFollowupFlag class. + */ public MicrosoftGraphFollowupFlag() { } /** * Get the completedDateTime property: dateTimeTimeZone. - * + * * @return the completedDateTime value. */ public MicrosoftGraphDateTimeZone completedDateTime() { @@ -59,7 +60,7 @@ public MicrosoftGraphDateTimeZone completedDateTime() { /** * Set the completedDateTime property: dateTimeTimeZone. - * + * * @param completedDateTime the completedDateTime value to set. * @return the MicrosoftGraphFollowupFlag object itself. */ @@ -70,7 +71,7 @@ public MicrosoftGraphFollowupFlag withCompletedDateTime(MicrosoftGraphDateTimeZo /** * Get the dueDateTime property: dateTimeTimeZone. - * + * * @return the dueDateTime value. */ public MicrosoftGraphDateTimeZone dueDateTime() { @@ -79,7 +80,7 @@ public MicrosoftGraphDateTimeZone dueDateTime() { /** * Set the dueDateTime property: dateTimeTimeZone. - * + * * @param dueDateTime the dueDateTime value to set. * @return the MicrosoftGraphFollowupFlag object itself. */ @@ -90,7 +91,7 @@ public MicrosoftGraphFollowupFlag withDueDateTime(MicrosoftGraphDateTimeZone due /** * Get the flagStatus property: followupFlagStatus. - * + * * @return the flagStatus value. */ public MicrosoftGraphFollowupFlagStatus flagStatus() { @@ -99,7 +100,7 @@ public MicrosoftGraphFollowupFlagStatus flagStatus() { /** * Set the flagStatus property: followupFlagStatus. - * + * * @param flagStatus the flagStatus value to set. * @return the MicrosoftGraphFollowupFlag object itself. */ @@ -110,7 +111,7 @@ public MicrosoftGraphFollowupFlag withFlagStatus(MicrosoftGraphFollowupFlagStatu /** * Get the startDateTime property: dateTimeTimeZone. - * + * * @return the startDateTime value. */ public MicrosoftGraphDateTimeZone startDateTime() { @@ -119,7 +120,7 @@ public MicrosoftGraphDateTimeZone startDateTime() { /** * Set the startDateTime property: dateTimeTimeZone. - * + * * @param startDateTime the startDateTime value to set. * @return the MicrosoftGraphFollowupFlag object itself. */ @@ -130,17 +131,16 @@ public MicrosoftGraphFollowupFlag withStartDateTime(MicrosoftGraphDateTimeZone s /** * Get the additionalProperties property: followupFlag. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: followupFlag. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphFollowupFlag object itself. */ @@ -149,17 +149,9 @@ public MicrosoftGraphFollowupFlag withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -173,4 +165,62 @@ public void validate() { startDateTime().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("completedDateTime", this.completedDateTime); + jsonWriter.writeJsonField("dueDateTime", this.dueDateTime); + jsonWriter.writeStringField("flagStatus", this.flagStatus == null ? null : this.flagStatus.toString()); + jsonWriter.writeJsonField("startDateTime", this.startDateTime); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphFollowupFlag from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphFollowupFlag 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 MicrosoftGraphFollowupFlag. + */ + public static MicrosoftGraphFollowupFlag fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphFollowupFlag deserializedMicrosoftGraphFollowupFlag = new MicrosoftGraphFollowupFlag(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("completedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphFollowupFlag.completedDateTime + = MicrosoftGraphDateTimeZone.fromJson(reader); + } else if ("dueDateTime".equals(fieldName)) { + deserializedMicrosoftGraphFollowupFlag.dueDateTime = MicrosoftGraphDateTimeZone.fromJson(reader); + } else if ("flagStatus".equals(fieldName)) { + deserializedMicrosoftGraphFollowupFlag.flagStatus + = MicrosoftGraphFollowupFlagStatus.fromString(reader.getString()); + } else if ("startDateTime".equals(fieldName)) { + deserializedMicrosoftGraphFollowupFlag.startDateTime = MicrosoftGraphDateTimeZone.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphFollowupFlag.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphFollowupFlag; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFollowupFlagStatus.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFollowupFlagStatus.java index 680a4d57f6712..d51fcb4469b66 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFollowupFlagStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFollowupFlagStatus.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** followupFlagStatus. */ +/** + * followupFlagStatus. + */ public final class MicrosoftGraphFollowupFlagStatus extends ExpandableStringEnum { - /** Static value notFlagged for MicrosoftGraphFollowupFlagStatus. */ + /** + * Static value notFlagged for MicrosoftGraphFollowupFlagStatus. + */ public static final MicrosoftGraphFollowupFlagStatus NOT_FLAGGED = fromString("notFlagged"); - /** Static value complete for MicrosoftGraphFollowupFlagStatus. */ + /** + * Static value complete for MicrosoftGraphFollowupFlagStatus. + */ public static final MicrosoftGraphFollowupFlagStatus COMPLETE = fromString("complete"); - /** Static value flagged for MicrosoftGraphFollowupFlagStatus. */ + /** + * Static value flagged for MicrosoftGraphFollowupFlagStatus. + */ public static final MicrosoftGraphFollowupFlagStatus FLAGGED = fromString("flagged"); /** * Creates a new instance of MicrosoftGraphFollowupFlagStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public MicrosoftGraphFollowupFlagStatus() { /** * Creates or finds a MicrosoftGraphFollowupFlagStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphFollowupFlagStatus. */ - @JsonCreator public static MicrosoftGraphFollowupFlagStatus fromString(String name) { return fromString(name, MicrosoftGraphFollowupFlagStatus.class); } /** * Gets known MicrosoftGraphFollowupFlagStatus values. - * + * * @return known MicrosoftGraphFollowupFlagStatus values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFreeBusyError.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFreeBusyError.java index 4176b00ae226d..c0b930f794cf3 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFreeBusyError.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFreeBusyError.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** freeBusyError. */ +/** + * freeBusyError. + */ @Fluent -public final class MicrosoftGraphFreeBusyError { +public final class MicrosoftGraphFreeBusyError implements JsonSerializable { /* * Describes the error. */ - @JsonProperty(value = "message") private String message; /* * The response code from querying for the availability of the user, distribution list, or resource. */ - @JsonProperty(value = "responseCode") private String responseCode; /* * freeBusyError */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphFreeBusyError class. */ + /** + * Creates an instance of MicrosoftGraphFreeBusyError class. + */ public MicrosoftGraphFreeBusyError() { } /** * Get the message property: Describes the error. - * + * * @return the message value. */ public String message() { @@ -47,7 +50,7 @@ public String message() { /** * Set the message property: Describes the error. - * + * * @param message the message value to set. * @return the MicrosoftGraphFreeBusyError object itself. */ @@ -59,7 +62,7 @@ public MicrosoftGraphFreeBusyError withMessage(String message) { /** * Get the responseCode property: The response code from querying for the availability of the user, distribution * list, or resource. - * + * * @return the responseCode value. */ public String responseCode() { @@ -69,7 +72,7 @@ public String responseCode() { /** * Set the responseCode property: The response code from querying for the availability of the user, distribution * list, or resource. - * + * * @param responseCode the responseCode value to set. * @return the MicrosoftGraphFreeBusyError object itself. */ @@ -80,17 +83,16 @@ public MicrosoftGraphFreeBusyError withResponseCode(String responseCode) { /** * Get the additionalProperties property: freeBusyError. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: freeBusyError. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphFreeBusyError object itself. */ @@ -99,19 +101,61 @@ public MicrosoftGraphFreeBusyError withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("responseCode", this.responseCode); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphFreeBusyError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphFreeBusyError 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 MicrosoftGraphFreeBusyError. + */ + public static MicrosoftGraphFreeBusyError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphFreeBusyError deserializedMicrosoftGraphFreeBusyError = new MicrosoftGraphFreeBusyError(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("message".equals(fieldName)) { + deserializedMicrosoftGraphFreeBusyError.message = reader.getString(); + } else if ("responseCode".equals(fieldName)) { + deserializedMicrosoftGraphFreeBusyError.responseCode = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphFreeBusyError.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphFreeBusyError; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFreeBusyStatus.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFreeBusyStatus.java index adfa81f9ccdf0..245d4e97f1858 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFreeBusyStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphFreeBusyStatus.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** freeBusyStatus. */ +/** + * freeBusyStatus. + */ public final class MicrosoftGraphFreeBusyStatus extends ExpandableStringEnum { - /** Static value unknown for MicrosoftGraphFreeBusyStatus. */ + /** + * Static value unknown for MicrosoftGraphFreeBusyStatus. + */ public static final MicrosoftGraphFreeBusyStatus UNKNOWN = fromString("unknown"); - /** Static value free for MicrosoftGraphFreeBusyStatus. */ + /** + * Static value free for MicrosoftGraphFreeBusyStatus. + */ public static final MicrosoftGraphFreeBusyStatus FREE = fromString("free"); - /** Static value tentative for MicrosoftGraphFreeBusyStatus. */ + /** + * Static value tentative for MicrosoftGraphFreeBusyStatus. + */ public static final MicrosoftGraphFreeBusyStatus TENTATIVE = fromString("tentative"); - /** Static value busy for MicrosoftGraphFreeBusyStatus. */ + /** + * Static value busy for MicrosoftGraphFreeBusyStatus. + */ public static final MicrosoftGraphFreeBusyStatus BUSY = fromString("busy"); - /** Static value oof for MicrosoftGraphFreeBusyStatus. */ + /** + * Static value oof for MicrosoftGraphFreeBusyStatus. + */ public static final MicrosoftGraphFreeBusyStatus OOF = fromString("oof"); - /** Static value workingElsewhere for MicrosoftGraphFreeBusyStatus. */ + /** + * Static value workingElsewhere for MicrosoftGraphFreeBusyStatus. + */ public static final MicrosoftGraphFreeBusyStatus WORKING_ELSEWHERE = fromString("workingElsewhere"); /** * Creates a new instance of MicrosoftGraphFreeBusyStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public MicrosoftGraphFreeBusyStatus() { /** * Creates or finds a MicrosoftGraphFreeBusyStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphFreeBusyStatus. */ - @JsonCreator public static MicrosoftGraphFreeBusyStatus fromString(String name) { return fromString(name, MicrosoftGraphFreeBusyStatus.class); } /** * Gets known MicrosoftGraphFreeBusyStatus values. - * + * * @return known MicrosoftGraphFreeBusyStatus values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGeoCoordinates.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGeoCoordinates.java index ad5afd03aa8d1..28a63f33c7e2d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGeoCoordinates.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGeoCoordinates.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** geoCoordinates. */ +/** + * geoCoordinates. + */ @Fluent -public final class MicrosoftGraphGeoCoordinates { +public final class MicrosoftGraphGeoCoordinates implements JsonSerializable { /* - * Optional. The altitude (height), in feet, above sea level for the item. Read-only. + * Optional. The altitude (height), in feet, above sea level for the item. Read-only. */ - @JsonProperty(value = "altitude") private Double altitude; /* * Optional. The latitude, in decimal, for the item. Read-only. */ - @JsonProperty(value = "latitude") private Double latitude; /* * Optional. The longitude, in decimal, for the item. Read-only. */ - @JsonProperty(value = "longitude") private Double longitude; /* * geoCoordinates */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphGeoCoordinates class. */ + /** + * Creates an instance of MicrosoftGraphGeoCoordinates class. + */ public MicrosoftGraphGeoCoordinates() { } /** * Get the altitude property: Optional. The altitude (height), in feet, above sea level for the item. Read-only. - * + * * @return the altitude value. */ public Double altitude() { @@ -53,7 +55,7 @@ public Double altitude() { /** * Set the altitude property: Optional. The altitude (height), in feet, above sea level for the item. Read-only. - * + * * @param altitude the altitude value to set. * @return the MicrosoftGraphGeoCoordinates object itself. */ @@ -64,7 +66,7 @@ public MicrosoftGraphGeoCoordinates withAltitude(Double altitude) { /** * Get the latitude property: Optional. The latitude, in decimal, for the item. Read-only. - * + * * @return the latitude value. */ public Double latitude() { @@ -73,7 +75,7 @@ public Double latitude() { /** * Set the latitude property: Optional. The latitude, in decimal, for the item. Read-only. - * + * * @param latitude the latitude value to set. * @return the MicrosoftGraphGeoCoordinates object itself. */ @@ -84,7 +86,7 @@ public MicrosoftGraphGeoCoordinates withLatitude(Double latitude) { /** * Get the longitude property: Optional. The longitude, in decimal, for the item. Read-only. - * + * * @return the longitude value. */ public Double longitude() { @@ -93,7 +95,7 @@ public Double longitude() { /** * Set the longitude property: Optional. The longitude, in decimal, for the item. Read-only. - * + * * @param longitude the longitude value to set. * @return the MicrosoftGraphGeoCoordinates object itself. */ @@ -104,17 +106,16 @@ public MicrosoftGraphGeoCoordinates withLongitude(Double longitude) { /** * Get the additionalProperties property: geoCoordinates. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: geoCoordinates. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphGeoCoordinates object itself. */ @@ -123,19 +124,64 @@ public MicrosoftGraphGeoCoordinates withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("altitude", this.altitude); + jsonWriter.writeNumberField("latitude", this.latitude); + jsonWriter.writeNumberField("longitude", this.longitude); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphGeoCoordinates from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphGeoCoordinates 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 MicrosoftGraphGeoCoordinates. + */ + public static MicrosoftGraphGeoCoordinates fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphGeoCoordinates deserializedMicrosoftGraphGeoCoordinates = new MicrosoftGraphGeoCoordinates(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("altitude".equals(fieldName)) { + deserializedMicrosoftGraphGeoCoordinates.altitude = reader.getNullable(JsonReader::getDouble); + } else if ("latitude".equals(fieldName)) { + deserializedMicrosoftGraphGeoCoordinates.latitude = reader.getNullable(JsonReader::getDouble); + } else if ("longitude".equals(fieldName)) { + deserializedMicrosoftGraphGeoCoordinates.longitude = reader.getNullable(JsonReader::getDouble); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphGeoCoordinates.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphGeoCoordinates; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGiphyRatingType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGiphyRatingType.java index 0fe4d90752c5b..0c6e5a25fc6ed 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGiphyRatingType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGiphyRatingType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** giphyRatingType. */ +/** + * giphyRatingType. + */ public final class MicrosoftGraphGiphyRatingType extends ExpandableStringEnum { - /** Static value strict for MicrosoftGraphGiphyRatingType. */ + /** + * Static value strict for MicrosoftGraphGiphyRatingType. + */ public static final MicrosoftGraphGiphyRatingType STRICT = fromString("strict"); - /** Static value moderate for MicrosoftGraphGiphyRatingType. */ + /** + * Static value moderate for MicrosoftGraphGiphyRatingType. + */ public static final MicrosoftGraphGiphyRatingType MODERATE = fromString("moderate"); - /** Static value unknownFutureValue for MicrosoftGraphGiphyRatingType. */ + /** + * Static value unknownFutureValue for MicrosoftGraphGiphyRatingType. + */ public static final MicrosoftGraphGiphyRatingType UNKNOWN_FUTURE_VALUE = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphGiphyRatingType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public MicrosoftGraphGiphyRatingType() { /** * Creates or finds a MicrosoftGraphGiphyRatingType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphGiphyRatingType. */ - @JsonCreator public static MicrosoftGraphGiphyRatingType fromString(String name) { return fromString(name, MicrosoftGraphGiphyRatingType.class); } /** * Gets known MicrosoftGraphGiphyRatingType values. - * + * * @return known MicrosoftGraphGiphyRatingType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupInner.java index 6725f02c24d11..b093c78caec56 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupInner.java @@ -5,19 +5,21 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * group - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -26,21 +28,18 @@ public final class MicrosoftGraphGroupInner extends MicrosoftGraphDirectoryObjec * The list of sensitivity label pairs (label ID, label name) associated with an Microsoft 365 group. Returned only * on $select. Read-only. */ - @JsonProperty(value = "assignedLabels") private List assignedLabels; /* * The licenses that are assigned to the group. Returned only on $select. Read-only. */ - @JsonProperty(value = "assignedLicenses") private List assignedLicenses; /* * Describes a classification for the group (such as low, medium or high business impact). Valid values for this - * property are defined by creating a ClassificationList setting value, based on the template definition.Returned - * by default. + * property are defined by creating a ClassificationList setting value, based on the template definition.Returned by + * default. */ - @JsonProperty(value = "classification") private String classification; /* @@ -49,38 +48,33 @@ public final class MicrosoftGraphGroupInner extends MicrosoftGraphDirectoryObjec * UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Returned by * default. Read-only. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * An optional description for the group. Returned by default. */ - @JsonProperty(value = "description") private String description; /* * The display name for the group. This property is required when a group is created and cannot be cleared during * updates. Returned by default. Supports $filter and $orderby. */ - @JsonProperty(value = "displayName") private String displayName; /* * Timestamp of when the group is set to expire. The value cannot be modified and is automatically populated when - * the group is created. The Timestamp type represents date and time information using ISO 8601 format and is - * always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * Returned by default. Read-only. + * the group is created. The Timestamp type represents date and time information using ISO 8601 format and is always + * in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Returned by + * default. Read-only. */ - @JsonProperty(value = "expirationDateTime") private OffsetDateTime expirationDateTime; /* - * Specifies the group type and its membership. If the collection contains Unified, the group is a Microsoft 365 + * Specifies the group type and its membership. If the collection contains Unified, the group is a Microsoft 365 * group; otherwise, it's either a security group or distribution group. For details, see groups overview.If the * collection includes DynamicMembership, the group has dynamic membership; otherwise, membership is static. * Returned by default. Supports $filter. */ - @JsonProperty(value = "groupTypes") private List groupTypes; /* @@ -88,32 +82,27 @@ public final class MicrosoftGraphGroupInner extends MicrosoftGraphDirectoryObjec * assignment. This property is never returned on a GET operation. You can use it as a $filter argument to get * groups that have members with license errors (that is, filter for this property being true). See an example. */ - @JsonProperty(value = "hasMembersWithLicenseErrors") private Boolean hasMembersWithLicenseErrors; /* * licenseProcessingState */ - @JsonProperty(value = "licenseProcessingState") private MicrosoftGraphLicenseProcessingState licenseProcessingState; /* * The SMTP address for the group, for example, 'serviceadmins@contoso.onmicrosoft.com'. Returned by default. * Read-only. Supports $filter. */ - @JsonProperty(value = "mail") private String mail; /* * Specifies whether the group is mail-enabled. Returned by default. */ - @JsonProperty(value = "mailEnabled") private Boolean mailEnabled; /* * The mailNickname property. */ - @JsonProperty(value = "mailNickname") private String mailNickname; /* @@ -121,38 +110,32 @@ public final class MicrosoftGraphGroupInner extends MicrosoftGraphDirectoryObjec * DynamicMembership). For more information about the syntax of the membership rule, see Membership Rules syntax. * Returned by default. */ - @JsonProperty(value = "membershipRule") private String membershipRule; /* * Indicates whether the dynamic membership processing is on or paused. Possible values are 'On' or 'Paused'. * Returned by default. */ - @JsonProperty(value = "membershipRuleProcessingState") private String membershipRuleProcessingState; /* * The onPremisesDomainName property. */ - @JsonProperty(value = "onPremisesDomainName") private String onPremisesDomainName; /* * The onPremisesLastSyncDateTime property. */ - @JsonProperty(value = "onPremisesLastSyncDateTime") private OffsetDateTime onPremisesLastSyncDateTime; /* * The onPremisesNetBiosName property. */ - @JsonProperty(value = "onPremisesNetBiosName") private String onPremisesNetBiosName; /* * The onPremisesProvisioningErrors property. */ - @JsonProperty(value = "onPremisesProvisioningErrors") private List onPremisesProvisioningErrors; /* @@ -160,14 +143,12 @@ public final class MicrosoftGraphGroupInner extends MicrosoftGraphDirectoryObjec * populated for customers who are synchronizing their on-premises directory to Azure Active Directory via Azure AD * Connect.Returned by default. Read-only. */ - @JsonProperty(value = "onPremisesSamAccountName") private String onPremisesSamAccountName; /* * Contains the on-premises security identifier (SID) for the group that was synchronized from on-premises to the * cloud. Returned by default. Read-only. */ - @JsonProperty(value = "onPremisesSecurityIdentifier") private String onPremisesSecurityIdentifier; /* @@ -175,27 +156,23 @@ public final class MicrosoftGraphGroupInner extends MicrosoftGraphDirectoryObjec * on-premises directory but is no longer synced; null if this object has never been synced from an on-premises * directory (default). Returned by default. Read-only. Supports $filter. */ - @JsonProperty(value = "onPremisesSyncEnabled") private Boolean onPremisesSyncEnabled; /* - * The preferred data location for the group. For more information, see OneDrive Online Multi-Geo. Returned by + * The preferred data location for the group. For more information, see OneDrive Online Multi-Geo. Returned by * default. */ - @JsonProperty(value = "preferredDataLocation") private String preferredDataLocation; /* - * The preferred language for an Microsoft 365 group. Should follow ISO 639-1 Code; for example 'en-US'. Returned - * by default. + * The preferred language for an Microsoft 365 group. Should follow ISO 639-1 Code; for example 'en-US'. Returned by + * default. */ - @JsonProperty(value = "preferredLanguage") private String preferredLanguage; /* * The proxyAddresses property. */ - @JsonProperty(value = "proxyAddresses") private List proxyAddresses; /* @@ -204,50 +181,43 @@ public final class MicrosoftGraphGroupInner extends MicrosoftGraphDirectoryObjec * UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Returned by * default. Read-only. */ - @JsonProperty(value = "renewedDateTime") private OffsetDateTime renewedDateTime; /* * Specifies whether the group is a security group. Returned by default. Supports $filter. */ - @JsonProperty(value = "securityEnabled") private Boolean securityEnabled; /* * Security identifier of the group, used in Windows scenarios. Returned by default. */ - @JsonProperty(value = "securityIdentifier") private String securityIdentifier; /* * Specifies an Microsoft 365 group's color theme. Possible values are Teal, Purple, Green, Blue, Pink, Orange or * Red. Returned by default. */ - @JsonProperty(value = "theme") private String theme; /* * Specifies the visibility of a Microsoft 365 group. Possible values are: Private, Public, or Hiddenmembership; - * blank values are treated as public. See group visibility options to learn more.Visibility can be set only when - * a group is created; it is not editable.Visibility is supported only for unified groups; it is not supported for + * blank values are treated as public. See group visibility options to learn more.Visibility can be set only when a + * group is created; it is not editable.Visibility is supported only for unified groups; it is not supported for * security groups. Returned by default. */ - @JsonProperty(value = "visibility") private String visibility; /* - * Indicates if people external to the organization can send messages to the group. Default value is false. - * Returned only on $select. + * Indicates if people external to the organization can send messages to the group. Default value is false. Returned + * only on $select. */ - @JsonProperty(value = "allowExternalSenders") private Boolean allowExternalSenders; /* * Indicates if new members added to the group will be auto-subscribed to receive email notifications. You can set - * this property in a PATCH request for the group; do not set it in the initial POST request that creates the - * group. Default value is false. Returned only on $select. + * this property in a PATCH request for the group; do not set it in the initial POST request that creates the group. + * Default value is false. Returned only on $select. */ - @JsonProperty(value = "autoSubscribeNewMembers") private Boolean autoSubscribeNewMembers; /* @@ -255,55 +225,45 @@ public final class MicrosoftGraphGroupInner extends MicrosoftGraphDirectoryObjec * selecting message recipients, and the Browse Groups dialog for searching groups; otherwise, false. Default value * is false. Returned only on $select. */ - @JsonProperty(value = "hideFromAddressLists") private Boolean hideFromAddressLists; /* * True if the group is not displayed in Outlook clients, such as Outlook for Windows and Outlook on the web; * otherwise, false. Default value is false. Returned only on $select. */ - @JsonProperty(value = "hideFromOutlookClients") private Boolean hideFromOutlookClients; /* * Indicates whether the signed-in user is subscribed to receive email conversations. Default value is true. * Returned only on $select. */ - @JsonProperty(value = "isSubscribedByMail") private Boolean isSubscribedByMail; /* * Count of conversations that have received new posts since the signed-in user last visited the group. Returned * only on $select. */ - @JsonProperty(value = "unseenCount") private Integer unseenCount; /* * The isArchived property. */ - @JsonProperty(value = "isArchived") private Boolean isArchived; /* * The appRoleAssignments property. */ - @JsonProperty(value = "appRoleAssignments") private List appRoleAssignments; /* - * directoryObject - * * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonProperty(value = "createdOnBehalfOf") private MicrosoftGraphDirectoryObjectInner createdOnBehalfOf; /* * Groups that this group is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. */ - @JsonProperty(value = "memberOf") private List memberOf; /* @@ -311,13 +271,11 @@ public final class MicrosoftGraphGroupInner extends MicrosoftGraphDirectoryObjec * for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 * groups and security groups) Nullable. */ - @JsonProperty(value = "members") private List members; /* * A list of group members with license errors from this group-based license assignment. Read-only. */ - @JsonProperty(value = "membersWithLicenseErrors") private List membersWithLicenseErrors; /* @@ -326,150 +284,130 @@ public final class MicrosoftGraphGroupInner extends MicrosoftGraphDirectoryObjec * groups and mail-enabled security groups), DELETE (supported for Microsoft 365 groups and security groups). * Nullable. */ - @JsonProperty(value = "owners") private List owners; /* * The permissionGrants property. */ - @JsonProperty(value = "permissionGrants") private List permissionGrants; /* * Read-only. Nullable. */ - @JsonProperty(value = "settings") private List settings; /* * The transitiveMemberOf property. */ - @JsonProperty(value = "transitiveMemberOf") private List transitiveMemberOf; /* * The transitiveMembers property. */ - @JsonProperty(value = "transitiveMembers") private List transitiveMembers; /* * The list of users or groups that are allowed to create post's or calendar events in this group. If this list is * non-empty then only users or groups listed here are allowed to post. */ - @JsonProperty(value = "acceptedSenders") private List acceptedSenders; /* * calendar */ - @JsonProperty(value = "calendar") private MicrosoftGraphCalendar calendar; /* * The calendar view for the calendar. Read-only. */ - @JsonProperty(value = "calendarView") private List calendarView; /* * The group's conversations. */ - @JsonProperty(value = "conversations") private List conversations; /* * The group's calendar events. */ - @JsonProperty(value = "events") private List events; /* * profilePhoto */ - @JsonProperty(value = "photo") private MicrosoftGraphProfilePhoto photo; /* * The profile photos owned by the group. Read-only. Nullable. */ - @JsonProperty(value = "photos") private List photos; /* * The list of users or groups that are not allowed to create posts or calendar events in this group. Nullable */ - @JsonProperty(value = "rejectedSenders") private List rejectedSenders; /* * The group's conversation threads. Nullable. */ - @JsonProperty(value = "threads") private List threads; /* * drive */ - @JsonProperty(value = "drive") private MicrosoftGraphDrive drive; /* * The group's drives. Read-only. */ - @JsonProperty(value = "drives") private List drives; /* * The list of SharePoint sites in this group. Access the default site with /sites/root. */ - @JsonProperty(value = "sites") private List sites; /* * The collection of open extensions defined for the group. Read-only. Nullable. */ - @JsonProperty(value = "extensions") private List extensions; /* * The collection of lifecycle policies for this group. Read-only. Nullable. */ - @JsonProperty(value = "groupLifecyclePolicies") private List groupLifecyclePolicies; /* * plannerGroup */ - @JsonProperty(value = "planner") private MicrosoftGraphPlannerGroup planner; /* * onenote */ - @JsonProperty(value = "onenote") private MicrosoftGraphOnenote onenote; /* * team */ - @JsonProperty(value = "team") private MicrosoftGraphTeamInner team; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphGroupInner class. */ + /** + * Creates an instance of MicrosoftGraphGroupInner class. + */ public MicrosoftGraphGroupInner() { } /** * Get the assignedLabels property: The list of sensitivity label pairs (label ID, label name) associated with an * Microsoft 365 group. Returned only on $select. Read-only. - * + * * @return the assignedLabels value. */ public List assignedLabels() { @@ -479,7 +417,7 @@ public List assignedLabels() { /** * Set the assignedLabels property: The list of sensitivity label pairs (label ID, label name) associated with an * Microsoft 365 group. Returned only on $select. Read-only. - * + * * @param assignedLabels the assignedLabels value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -491,7 +429,7 @@ public MicrosoftGraphGroupInner withAssignedLabels(List assignedLicenses() { @@ -501,7 +439,7 @@ public List assignedLicenses() { /** * Set the assignedLicenses property: The licenses that are assigned to the group. Returned only on $select. * Read-only. - * + * * @param assignedLicenses the assignedLicenses value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -514,7 +452,7 @@ public MicrosoftGraphGroupInner withAssignedLicenses(List groupTypes() { @@ -645,7 +583,7 @@ public List groupTypes() { * group is a Microsoft 365 group; otherwise, it's either a security group or distribution group. For details, see * groups overview.If the collection includes DynamicMembership, the group has dynamic membership; otherwise, * membership is static. Returned by default. Supports $filter. - * + * * @param groupTypes the groupTypes value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -659,7 +597,7 @@ public MicrosoftGraphGroupInner withGroupTypes(List groupTypes) { * errors from its group-based license assignment. This property is never returned on a GET operation. You can use * it as a $filter argument to get groups that have members with license errors (that is, filter for this property * being true). See an example. - * + * * @return the hasMembersWithLicenseErrors value. */ public Boolean hasMembersWithLicenseErrors() { @@ -671,7 +609,7 @@ public Boolean hasMembersWithLicenseErrors() { * errors from its group-based license assignment. This property is never returned on a GET operation. You can use * it as a $filter argument to get groups that have members with license errors (that is, filter for this property * being true). See an example. - * + * * @param hasMembersWithLicenseErrors the hasMembersWithLicenseErrors value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -682,7 +620,7 @@ public MicrosoftGraphGroupInner withHasMembersWithLicenseErrors(Boolean hasMembe /** * Get the licenseProcessingState property: licenseProcessingState. - * + * * @return the licenseProcessingState value. */ public MicrosoftGraphLicenseProcessingState licenseProcessingState() { @@ -691,20 +629,20 @@ public MicrosoftGraphLicenseProcessingState licenseProcessingState() { /** * Set the licenseProcessingState property: licenseProcessingState. - * + * * @param licenseProcessingState the licenseProcessingState value to set. * @return the MicrosoftGraphGroupInner object itself. */ - public MicrosoftGraphGroupInner withLicenseProcessingState( - MicrosoftGraphLicenseProcessingState licenseProcessingState) { + public MicrosoftGraphGroupInner + withLicenseProcessingState(MicrosoftGraphLicenseProcessingState licenseProcessingState) { this.licenseProcessingState = licenseProcessingState; return this; } /** - * Get the mail property: The SMTP address for the group, for example, 'serviceadmins@contoso.onmicrosoft.com'. + * Get the mail property: The SMTP address for the group, for example, 'serviceadmins@contoso.onmicrosoft.com'. * Returned by default. Read-only. Supports $filter. - * + * * @return the mail value. */ public String mail() { @@ -712,9 +650,9 @@ public String mail() { } /** - * Set the mail property: The SMTP address for the group, for example, 'serviceadmins@contoso.onmicrosoft.com'. + * Set the mail property: The SMTP address for the group, for example, 'serviceadmins@contoso.onmicrosoft.com'. * Returned by default. Read-only. Supports $filter. - * + * * @param mail the mail value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -725,7 +663,7 @@ public MicrosoftGraphGroupInner withMail(String mail) { /** * Get the mailEnabled property: Specifies whether the group is mail-enabled. Returned by default. - * + * * @return the mailEnabled value. */ public Boolean mailEnabled() { @@ -734,7 +672,7 @@ public Boolean mailEnabled() { /** * Set the mailEnabled property: Specifies whether the group is mail-enabled. Returned by default. - * + * * @param mailEnabled the mailEnabled value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -745,7 +683,7 @@ public MicrosoftGraphGroupInner withMailEnabled(Boolean mailEnabled) { /** * Get the mailNickname property: The mailNickname property. - * + * * @return the mailNickname value. */ public String mailNickname() { @@ -754,7 +692,7 @@ public String mailNickname() { /** * Set the mailNickname property: The mailNickname property. - * + * * @param mailNickname the mailNickname value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -767,7 +705,7 @@ public MicrosoftGraphGroupInner withMailNickname(String mailNickname) { * Get the membershipRule property: The rule that determines members for this group if the group is a dynamic group * (groupTypes contains DynamicMembership). For more information about the syntax of the membership rule, see * Membership Rules syntax. Returned by default. - * + * * @return the membershipRule value. */ public String membershipRule() { @@ -778,7 +716,7 @@ public String membershipRule() { * Set the membershipRule property: The rule that determines members for this group if the group is a dynamic group * (groupTypes contains DynamicMembership). For more information about the syntax of the membership rule, see * Membership Rules syntax. Returned by default. - * + * * @param membershipRule the membershipRule value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -790,7 +728,7 @@ public MicrosoftGraphGroupInner withMembershipRule(String membershipRule) { /** * Get the membershipRuleProcessingState property: Indicates whether the dynamic membership processing is on or * paused. Possible values are 'On' or 'Paused'. Returned by default. - * + * * @return the membershipRuleProcessingState value. */ public String membershipRuleProcessingState() { @@ -800,7 +738,7 @@ public String membershipRuleProcessingState() { /** * Set the membershipRuleProcessingState property: Indicates whether the dynamic membership processing is on or * paused. Possible values are 'On' or 'Paused'. Returned by default. - * + * * @param membershipRuleProcessingState the membershipRuleProcessingState value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -811,7 +749,7 @@ public MicrosoftGraphGroupInner withMembershipRuleProcessingState(String members /** * Get the onPremisesDomainName property: The onPremisesDomainName property. - * + * * @return the onPremisesDomainName value. */ public String onPremisesDomainName() { @@ -820,7 +758,7 @@ public String onPremisesDomainName() { /** * Set the onPremisesDomainName property: The onPremisesDomainName property. - * + * * @param onPremisesDomainName the onPremisesDomainName value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -831,7 +769,7 @@ public MicrosoftGraphGroupInner withOnPremisesDomainName(String onPremisesDomain /** * Get the onPremisesLastSyncDateTime property: The onPremisesLastSyncDateTime property. - * + * * @return the onPremisesLastSyncDateTime value. */ public OffsetDateTime onPremisesLastSyncDateTime() { @@ -840,7 +778,7 @@ public OffsetDateTime onPremisesLastSyncDateTime() { /** * Set the onPremisesLastSyncDateTime property: The onPremisesLastSyncDateTime property. - * + * * @param onPremisesLastSyncDateTime the onPremisesLastSyncDateTime value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -851,7 +789,7 @@ public MicrosoftGraphGroupInner withOnPremisesLastSyncDateTime(OffsetDateTime on /** * Get the onPremisesNetBiosName property: The onPremisesNetBiosName property. - * + * * @return the onPremisesNetBiosName value. */ public String onPremisesNetBiosName() { @@ -860,7 +798,7 @@ public String onPremisesNetBiosName() { /** * Set the onPremisesNetBiosName property: The onPremisesNetBiosName property. - * + * * @param onPremisesNetBiosName the onPremisesNetBiosName value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -871,7 +809,7 @@ public MicrosoftGraphGroupInner withOnPremisesNetBiosName(String onPremisesNetBi /** * Get the onPremisesProvisioningErrors property: The onPremisesProvisioningErrors property. - * + * * @return the onPremisesProvisioningErrors value. */ public List onPremisesProvisioningErrors() { @@ -880,12 +818,12 @@ public List onPremisesProvisioningErr /** * Set the onPremisesProvisioningErrors property: The onPremisesProvisioningErrors property. - * + * * @param onPremisesProvisioningErrors the onPremisesProvisioningErrors value to set. * @return the MicrosoftGraphGroupInner object itself. */ - public MicrosoftGraphGroupInner withOnPremisesProvisioningErrors( - List onPremisesProvisioningErrors) { + public MicrosoftGraphGroupInner + withOnPremisesProvisioningErrors(List onPremisesProvisioningErrors) { this.onPremisesProvisioningErrors = onPremisesProvisioningErrors; return this; } @@ -894,7 +832,7 @@ public MicrosoftGraphGroupInner withOnPremisesProvisioningErrors( * Get the onPremisesSamAccountName property: Contains the on-premises SAM account name synchronized from the * on-premises directory. The property is only populated for customers who are synchronizing their on-premises * directory to Azure Active Directory via Azure AD Connect.Returned by default. Read-only. - * + * * @return the onPremisesSamAccountName value. */ public String onPremisesSamAccountName() { @@ -905,7 +843,7 @@ public String onPremisesSamAccountName() { * Set the onPremisesSamAccountName property: Contains the on-premises SAM account name synchronized from the * on-premises directory. The property is only populated for customers who are synchronizing their on-premises * directory to Azure Active Directory via Azure AD Connect.Returned by default. Read-only. - * + * * @param onPremisesSamAccountName the onPremisesSamAccountName value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -917,7 +855,7 @@ public MicrosoftGraphGroupInner withOnPremisesSamAccountName(String onPremisesSa /** * Get the onPremisesSecurityIdentifier property: Contains the on-premises security identifier (SID) for the group * that was synchronized from on-premises to the cloud. Returned by default. Read-only. - * + * * @return the onPremisesSecurityIdentifier value. */ public String onPremisesSecurityIdentifier() { @@ -927,7 +865,7 @@ public String onPremisesSecurityIdentifier() { /** * Set the onPremisesSecurityIdentifier property: Contains the on-premises security identifier (SID) for the group * that was synchronized from on-premises to the cloud. Returned by default. Read-only. - * + * * @param onPremisesSecurityIdentifier the onPremisesSecurityIdentifier value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -940,7 +878,7 @@ public MicrosoftGraphGroupInner withOnPremisesSecurityIdentifier(String onPremis * Get the onPremisesSyncEnabled property: true if this group is synced from an on-premises directory; false if this * group was originally synced from an on-premises directory but is no longer synced; null if this object has never * been synced from an on-premises directory (default). Returned by default. Read-only. Supports $filter. - * + * * @return the onPremisesSyncEnabled value. */ public Boolean onPremisesSyncEnabled() { @@ -951,7 +889,7 @@ public Boolean onPremisesSyncEnabled() { * Set the onPremisesSyncEnabled property: true if this group is synced from an on-premises directory; false if this * group was originally synced from an on-premises directory but is no longer synced; null if this object has never * been synced from an on-premises directory (default). Returned by default. Read-only. Supports $filter. - * + * * @param onPremisesSyncEnabled the onPremisesSyncEnabled value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -963,7 +901,7 @@ public MicrosoftGraphGroupInner withOnPremisesSyncEnabled(Boolean onPremisesSync /** * Get the preferredDataLocation property: The preferred data location for the group. For more information, see * OneDrive Online Multi-Geo. Returned by default. - * + * * @return the preferredDataLocation value. */ public String preferredDataLocation() { @@ -973,7 +911,7 @@ public String preferredDataLocation() { /** * Set the preferredDataLocation property: The preferred data location for the group. For more information, see * OneDrive Online Multi-Geo. Returned by default. - * + * * @param preferredDataLocation the preferredDataLocation value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -985,7 +923,7 @@ public MicrosoftGraphGroupInner withPreferredDataLocation(String preferredDataLo /** * Get the preferredLanguage property: The preferred language for an Microsoft 365 group. Should follow ISO 639-1 * Code; for example 'en-US'. Returned by default. - * + * * @return the preferredLanguage value. */ public String preferredLanguage() { @@ -995,7 +933,7 @@ public String preferredLanguage() { /** * Set the preferredLanguage property: The preferred language for an Microsoft 365 group. Should follow ISO 639-1 * Code; for example 'en-US'. Returned by default. - * + * * @param preferredLanguage the preferredLanguage value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1006,7 +944,7 @@ public MicrosoftGraphGroupInner withPreferredLanguage(String preferredLanguage) /** * Get the proxyAddresses property: The proxyAddresses property. - * + * * @return the proxyAddresses value. */ public List proxyAddresses() { @@ -1015,7 +953,7 @@ public List proxyAddresses() { /** * Set the proxyAddresses property: The proxyAddresses property. - * + * * @param proxyAddresses the proxyAddresses value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1029,7 +967,7 @@ public MicrosoftGraphGroupInner withProxyAddresses(List proxyAddresses) * and is only updated via the renew service action. The Timestamp type represents date and time information using * ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. Returned by default. Read-only. - * + * * @return the renewedDateTime value. */ public OffsetDateTime renewedDateTime() { @@ -1041,7 +979,7 @@ public OffsetDateTime renewedDateTime() { * and is only updated via the renew service action. The Timestamp type represents date and time information using * ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. Returned by default. Read-only. - * + * * @param renewedDateTime the renewedDateTime value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1053,7 +991,7 @@ public MicrosoftGraphGroupInner withRenewedDateTime(OffsetDateTime renewedDateTi /** * Get the securityEnabled property: Specifies whether the group is a security group. Returned by default. Supports * $filter. - * + * * @return the securityEnabled value. */ public Boolean securityEnabled() { @@ -1063,7 +1001,7 @@ public Boolean securityEnabled() { /** * Set the securityEnabled property: Specifies whether the group is a security group. Returned by default. Supports * $filter. - * + * * @param securityEnabled the securityEnabled value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1075,7 +1013,7 @@ public MicrosoftGraphGroupInner withSecurityEnabled(Boolean securityEnabled) { /** * Get the securityIdentifier property: Security identifier of the group, used in Windows scenarios. Returned by * default. - * + * * @return the securityIdentifier value. */ public String securityIdentifier() { @@ -1085,7 +1023,7 @@ public String securityIdentifier() { /** * Set the securityIdentifier property: Security identifier of the group, used in Windows scenarios. Returned by * default. - * + * * @param securityIdentifier the securityIdentifier value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1097,7 +1035,7 @@ public MicrosoftGraphGroupInner withSecurityIdentifier(String securityIdentifier /** * Get the theme property: Specifies an Microsoft 365 group's color theme. Possible values are Teal, Purple, Green, * Blue, Pink, Orange or Red. Returned by default. - * + * * @return the theme value. */ public String theme() { @@ -1107,7 +1045,7 @@ public String theme() { /** * Set the theme property: Specifies an Microsoft 365 group's color theme. Possible values are Teal, Purple, Green, * Blue, Pink, Orange or Red. Returned by default. - * + * * @param theme the theme value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1121,7 +1059,7 @@ public MicrosoftGraphGroupInner withTheme(String theme) { * Public, or Hiddenmembership; blank values are treated as public. See group visibility options to learn * more.Visibility can be set only when a group is created; it is not editable.Visibility is supported only for * unified groups; it is not supported for security groups. Returned by default. - * + * * @return the visibility value. */ public String visibility() { @@ -1133,7 +1071,7 @@ public String visibility() { * Public, or Hiddenmembership; blank values are treated as public. See group visibility options to learn * more.Visibility can be set only when a group is created; it is not editable.Visibility is supported only for * unified groups; it is not supported for security groups. Returned by default. - * + * * @param visibility the visibility value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1145,7 +1083,7 @@ public MicrosoftGraphGroupInner withVisibility(String visibility) { /** * Get the allowExternalSenders property: Indicates if people external to the organization can send messages to the * group. Default value is false. Returned only on $select. - * + * * @return the allowExternalSenders value. */ public Boolean allowExternalSenders() { @@ -1155,7 +1093,7 @@ public Boolean allowExternalSenders() { /** * Set the allowExternalSenders property: Indicates if people external to the organization can send messages to the * group. Default value is false. Returned only on $select. - * + * * @param allowExternalSenders the allowExternalSenders value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1168,7 +1106,7 @@ public MicrosoftGraphGroupInner withAllowExternalSenders(Boolean allowExternalSe * Get the autoSubscribeNewMembers property: Indicates if new members added to the group will be auto-subscribed to * receive email notifications. You can set this property in a PATCH request for the group; do not set it in the * initial POST request that creates the group. Default value is false. Returned only on $select. - * + * * @return the autoSubscribeNewMembers value. */ public Boolean autoSubscribeNewMembers() { @@ -1179,7 +1117,7 @@ public Boolean autoSubscribeNewMembers() { * Set the autoSubscribeNewMembers property: Indicates if new members added to the group will be auto-subscribed to * receive email notifications. You can set this property in a PATCH request for the group; do not set it in the * initial POST request that creates the group. Default value is false. Returned only on $select. - * + * * @param autoSubscribeNewMembers the autoSubscribeNewMembers value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1192,7 +1130,7 @@ public MicrosoftGraphGroupInner withAutoSubscribeNewMembers(Boolean autoSubscrib * Get the hideFromAddressLists property: True if the group is not displayed in certain parts of the Outlook UI: the * Address Book, address lists for selecting message recipients, and the Browse Groups dialog for searching groups; * otherwise, false. Default value is false. Returned only on $select. - * + * * @return the hideFromAddressLists value. */ public Boolean hideFromAddressLists() { @@ -1203,7 +1141,7 @@ public Boolean hideFromAddressLists() { * Set the hideFromAddressLists property: True if the group is not displayed in certain parts of the Outlook UI: the * Address Book, address lists for selecting message recipients, and the Browse Groups dialog for searching groups; * otherwise, false. Default value is false. Returned only on $select. - * + * * @param hideFromAddressLists the hideFromAddressLists value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1215,7 +1153,7 @@ public MicrosoftGraphGroupInner withHideFromAddressLists(Boolean hideFromAddress /** * Get the hideFromOutlookClients property: True if the group is not displayed in Outlook clients, such as Outlook * for Windows and Outlook on the web; otherwise, false. Default value is false. Returned only on $select. - * + * * @return the hideFromOutlookClients value. */ public Boolean hideFromOutlookClients() { @@ -1225,7 +1163,7 @@ public Boolean hideFromOutlookClients() { /** * Set the hideFromOutlookClients property: True if the group is not displayed in Outlook clients, such as Outlook * for Windows and Outlook on the web; otherwise, false. Default value is false. Returned only on $select. - * + * * @param hideFromOutlookClients the hideFromOutlookClients value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1237,7 +1175,7 @@ public MicrosoftGraphGroupInner withHideFromOutlookClients(Boolean hideFromOutlo /** * Get the isSubscribedByMail property: Indicates whether the signed-in user is subscribed to receive email * conversations. Default value is true. Returned only on $select. - * + * * @return the isSubscribedByMail value. */ public Boolean isSubscribedByMail() { @@ -1247,7 +1185,7 @@ public Boolean isSubscribedByMail() { /** * Set the isSubscribedByMail property: Indicates whether the signed-in user is subscribed to receive email * conversations. Default value is true. Returned only on $select. - * + * * @param isSubscribedByMail the isSubscribedByMail value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1259,7 +1197,7 @@ public MicrosoftGraphGroupInner withIsSubscribedByMail(Boolean isSubscribedByMai /** * Get the unseenCount property: Count of conversations that have received new posts since the signed-in user last * visited the group. Returned only on $select. - * + * * @return the unseenCount value. */ public Integer unseenCount() { @@ -1269,7 +1207,7 @@ public Integer unseenCount() { /** * Set the unseenCount property: Count of conversations that have received new posts since the signed-in user last * visited the group. Returned only on $select. - * + * * @param unseenCount the unseenCount value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1280,7 +1218,7 @@ public MicrosoftGraphGroupInner withUnseenCount(Integer unseenCount) { /** * Get the isArchived property: The isArchived property. - * + * * @return the isArchived value. */ public Boolean isArchived() { @@ -1289,7 +1227,7 @@ public Boolean isArchived() { /** * Set the isArchived property: The isArchived property. - * + * * @param isArchived the isArchived value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1300,7 +1238,7 @@ public MicrosoftGraphGroupInner withIsArchived(Boolean isArchived) { /** * Get the appRoleAssignments property: The appRoleAssignments property. - * + * * @return the appRoleAssignments value. */ public List appRoleAssignments() { @@ -1309,7 +1247,7 @@ public List appRoleAssignments() { /** * Set the appRoleAssignments property: The appRoleAssignments property. - * + * * @param appRoleAssignments the appRoleAssignments value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1319,11 +1257,9 @@ public MicrosoftGraphGroupInner withAppRoleAssignments(ListRepresents an Azure Active Directory object. The directoryObject type is the base type for many other - * directory entity types. - * + * Get the createdOnBehalfOf property: Represents an Azure Active Directory object. The directoryObject type is the + * base type for many other directory entity types. + * * @return the createdOnBehalfOf value. */ public MicrosoftGraphDirectoryObjectInner createdOnBehalfOf() { @@ -1331,11 +1267,9 @@ public MicrosoftGraphDirectoryObjectInner createdOnBehalfOf() { } /** - * Set the createdOnBehalfOf property: directoryObject - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other - * directory entity types. - * + * Set the createdOnBehalfOf property: Represents an Azure Active Directory object. The directoryObject type is the + * base type for many other directory entity types. + * * @param createdOnBehalfOf the createdOnBehalfOf value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1347,7 +1281,7 @@ public MicrosoftGraphGroupInner withCreatedOnBehalfOf(MicrosoftGraphDirectoryObj /** * Get the memberOf property: Groups that this group is a member of. HTTP Methods: GET (supported for all groups). * Read-only. Nullable. - * + * * @return the memberOf value. */ public List memberOf() { @@ -1357,7 +1291,7 @@ public List memberOf() { /** * Set the memberOf property: Groups that this group is a member of. HTTP Methods: GET (supported for all groups). * Read-only. Nullable. - * + * * @param memberOf the memberOf value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1370,7 +1304,7 @@ public MicrosoftGraphGroupInner withMemberOf(List members() { @@ -1381,7 +1315,7 @@ public List members() { * Set the members property: Users and groups that are members of this group. HTTP Methods: GET (supported for all * groups), POST (supported for Microsoft 365 groups, security groups and mail-enabled security groups), DELETE * (supported for Microsoft 365 groups and security groups) Nullable. - * + * * @param members the members value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1393,7 +1327,7 @@ public MicrosoftGraphGroupInner withMembers(List membersWithLicenseErrors() { @@ -1403,12 +1337,12 @@ public List membersWithLicenseErrors() { /** * Set the membersWithLicenseErrors property: A list of group members with license errors from this group-based * license assignment. Read-only. - * + * * @param membersWithLicenseErrors the membersWithLicenseErrors value to set. * @return the MicrosoftGraphGroupInner object itself. */ - public MicrosoftGraphGroupInner withMembersWithLicenseErrors( - List membersWithLicenseErrors) { + public MicrosoftGraphGroupInner + withMembersWithLicenseErrors(List membersWithLicenseErrors) { this.membersWithLicenseErrors = membersWithLicenseErrors; return this; } @@ -1418,7 +1352,7 @@ public MicrosoftGraphGroupInner withMembersWithLicenseErrors( * modify this object. Limited to 100 owners. HTTP Methods: GET (supported for all groups), POST (supported for * Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 * groups and security groups). Nullable. - * + * * @return the owners value. */ public List owners() { @@ -1430,7 +1364,7 @@ public List owners() { * modify this object. Limited to 100 owners. HTTP Methods: GET (supported for all groups), POST (supported for * Microsoft 365 groups, security groups and mail-enabled security groups), DELETE (supported for Microsoft 365 * groups and security groups). Nullable. - * + * * @param owners the owners value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1441,7 +1375,7 @@ public MicrosoftGraphGroupInner withOwners(List permissionGrants() { @@ -1450,19 +1384,19 @@ public List permissionGrants() { /** * Set the permissionGrants property: The permissionGrants property. - * + * * @param permissionGrants the permissionGrants value to set. * @return the MicrosoftGraphGroupInner object itself. */ - public MicrosoftGraphGroupInner withPermissionGrants( - List permissionGrants) { + public MicrosoftGraphGroupInner + withPermissionGrants(List permissionGrants) { this.permissionGrants = permissionGrants; return this; } /** * Get the settings property: Read-only. Nullable. - * + * * @return the settings value. */ public List settings() { @@ -1471,7 +1405,7 @@ public List settings() { /** * Set the settings property: Read-only. Nullable. - * + * * @param settings the settings value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1482,7 +1416,7 @@ public MicrosoftGraphGroupInner withSettings(List se /** * Get the transitiveMemberOf property: The transitiveMemberOf property. - * + * * @return the transitiveMemberOf value. */ public List transitiveMemberOf() { @@ -1491,19 +1425,19 @@ public List transitiveMemberOf() { /** * Set the transitiveMemberOf property: The transitiveMemberOf property. - * + * * @param transitiveMemberOf the transitiveMemberOf value to set. * @return the MicrosoftGraphGroupInner object itself. */ - public MicrosoftGraphGroupInner withTransitiveMemberOf( - List transitiveMemberOf) { + public MicrosoftGraphGroupInner + withTransitiveMemberOf(List transitiveMemberOf) { this.transitiveMemberOf = transitiveMemberOf; return this; } /** * Get the transitiveMembers property: The transitiveMembers property. - * + * * @return the transitiveMembers value. */ public List transitiveMembers() { @@ -1512,7 +1446,7 @@ public List transitiveMembers() { /** * Set the transitiveMembers property: The transitiveMembers property. - * + * * @param transitiveMembers the transitiveMembers value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1524,7 +1458,7 @@ public MicrosoftGraphGroupInner withTransitiveMembers(List acceptedSenders() { @@ -1534,7 +1468,7 @@ public List acceptedSenders() { /** * Set the acceptedSenders property: The list of users or groups that are allowed to create post's or calendar * events in this group. If this list is non-empty then only users or groups listed here are allowed to post. - * + * * @param acceptedSenders the acceptedSenders value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1545,7 +1479,7 @@ public MicrosoftGraphGroupInner withAcceptedSenders(List calendarView() { @@ -1574,7 +1508,7 @@ public List calendarView() { /** * Set the calendarView property: The calendar view for the calendar. Read-only. - * + * * @param calendarView the calendarView value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1585,7 +1519,7 @@ public MicrosoftGraphGroupInner withCalendarView(List calen /** * Get the conversations property: The group's conversations. - * + * * @return the conversations value. */ public List conversations() { @@ -1594,7 +1528,7 @@ public List conversations() { /** * Set the conversations property: The group's conversations. - * + * * @param conversations the conversations value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1605,7 +1539,7 @@ public MicrosoftGraphGroupInner withConversations(List events() { @@ -1614,7 +1548,7 @@ public List events() { /** * Set the events property: The group's calendar events. - * + * * @param events the events value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1625,7 +1559,7 @@ public MicrosoftGraphGroupInner withEvents(List events) { /** * Get the photo property: profilePhoto. - * + * * @return the photo value. */ public MicrosoftGraphProfilePhoto photo() { @@ -1634,7 +1568,7 @@ public MicrosoftGraphProfilePhoto photo() { /** * Set the photo property: profilePhoto. - * + * * @param photo the photo value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1645,7 +1579,7 @@ public MicrosoftGraphGroupInner withPhoto(MicrosoftGraphProfilePhoto photo) { /** * Get the photos property: The profile photos owned by the group. Read-only. Nullable. - * + * * @return the photos value. */ public List photos() { @@ -1654,7 +1588,7 @@ public List photos() { /** * Set the photos property: The profile photos owned by the group. Read-only. Nullable. - * + * * @param photos the photos value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1666,7 +1600,7 @@ public MicrosoftGraphGroupInner withPhotos(List phot /** * Get the rejectedSenders property: The list of users or groups that are not allowed to create posts or calendar * events in this group. Nullable. - * + * * @return the rejectedSenders value. */ public List rejectedSenders() { @@ -1676,7 +1610,7 @@ public List rejectedSenders() { /** * Set the rejectedSenders property: The list of users or groups that are not allowed to create posts or calendar * events in this group. Nullable. - * + * * @param rejectedSenders the rejectedSenders value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1687,7 +1621,7 @@ public MicrosoftGraphGroupInner withRejectedSenders(List threads() { @@ -1696,7 +1630,7 @@ public List threads() { /** * Set the threads property: The group's conversation threads. Nullable. - * + * * @param threads the threads value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1707,7 +1641,7 @@ public MicrosoftGraphGroupInner withThreads(List drives() { @@ -1736,7 +1670,7 @@ public List drives() { /** * Set the drives property: The group's drives. Read-only. - * + * * @param drives the drives value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1747,7 +1681,7 @@ public MicrosoftGraphGroupInner withDrives(List drives) { /** * Get the sites property: The list of SharePoint sites in this group. Access the default site with /sites/root. - * + * * @return the sites value. */ public List sites() { @@ -1756,7 +1690,7 @@ public List sites() { /** * Set the sites property: The list of SharePoint sites in this group. Access the default site with /sites/root. - * + * * @param sites the sites value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1767,7 +1701,7 @@ public MicrosoftGraphGroupInner withSites(List sites) { /** * Get the extensions property: The collection of open extensions defined for the group. Read-only. Nullable. - * + * * @return the extensions value. */ public List extensions() { @@ -1776,7 +1710,7 @@ public List extensions() { /** * Set the extensions property: The collection of open extensions defined for the group. Read-only. Nullable. - * + * * @param extensions the extensions value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1788,7 +1722,7 @@ public MicrosoftGraphGroupInner withExtensions(List ext /** * Get the groupLifecyclePolicies property: The collection of lifecycle policies for this group. Read-only. * Nullable. - * + * * @return the groupLifecyclePolicies value. */ public List groupLifecyclePolicies() { @@ -1798,19 +1732,19 @@ public List groupLifecyclePolicies() { /** * Set the groupLifecyclePolicies property: The collection of lifecycle policies for this group. Read-only. * Nullable. - * + * * @param groupLifecyclePolicies the groupLifecyclePolicies value to set. * @return the MicrosoftGraphGroupInner object itself. */ - public MicrosoftGraphGroupInner withGroupLifecyclePolicies( - List groupLifecyclePolicies) { + public MicrosoftGraphGroupInner + withGroupLifecyclePolicies(List groupLifecyclePolicies) { this.groupLifecyclePolicies = groupLifecyclePolicies; return this; } /** * Get the planner property: plannerGroup. - * + * * @return the planner value. */ public MicrosoftGraphPlannerGroup planner() { @@ -1819,7 +1753,7 @@ public MicrosoftGraphPlannerGroup planner() { /** * Set the planner property: plannerGroup. - * + * * @param planner the planner value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1830,7 +1764,7 @@ public MicrosoftGraphGroupInner withPlanner(MicrosoftGraphPlannerGroup planner) /** * Get the onenote property: onenote. - * + * * @return the onenote value. */ public MicrosoftGraphOnenote onenote() { @@ -1839,7 +1773,7 @@ public MicrosoftGraphOnenote onenote() { /** * Set the onenote property: onenote. - * + * * @param onenote the onenote value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1850,7 +1784,7 @@ public MicrosoftGraphGroupInner withOnenote(MicrosoftGraphOnenote onenote) { /** * Get the team property: team. - * + * * @return the team value. */ public MicrosoftGraphTeamInner team() { @@ -1859,7 +1793,7 @@ public MicrosoftGraphTeamInner team() { /** * Set the team property: team. - * + * * @param team the team value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1871,10 +1805,9 @@ public MicrosoftGraphGroupInner withTeam(MicrosoftGraphTeamInner team) { /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -1882,7 +1815,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphGroupInner object itself. */ @@ -1891,22 +1824,18 @@ public MicrosoftGraphGroupInner withAdditionalProperties(Map add return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphGroupInner withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphGroupInner withId(String id) { super.withId(id); @@ -1915,7 +1844,7 @@ public MicrosoftGraphGroupInner withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -2015,4 +1944,328 @@ public void validate() { team().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeArrayField("assignedLabels", this.assignedLabels, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("assignedLicenses", this.assignedLicenses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("classification", this.classification); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeArrayField("groupTypes", this.groupTypes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("hasMembersWithLicenseErrors", this.hasMembersWithLicenseErrors); + jsonWriter.writeJsonField("licenseProcessingState", this.licenseProcessingState); + jsonWriter.writeStringField("mail", this.mail); + jsonWriter.writeBooleanField("mailEnabled", this.mailEnabled); + jsonWriter.writeStringField("mailNickname", this.mailNickname); + jsonWriter.writeStringField("membershipRule", this.membershipRule); + jsonWriter.writeStringField("membershipRuleProcessingState", this.membershipRuleProcessingState); + jsonWriter.writeStringField("onPremisesDomainName", this.onPremisesDomainName); + jsonWriter.writeStringField("onPremisesLastSyncDateTime", + this.onPremisesLastSyncDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.onPremisesLastSyncDateTime)); + jsonWriter.writeStringField("onPremisesNetBiosName", this.onPremisesNetBiosName); + jsonWriter.writeArrayField("onPremisesProvisioningErrors", this.onPremisesProvisioningErrors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("onPremisesSamAccountName", this.onPremisesSamAccountName); + jsonWriter.writeStringField("onPremisesSecurityIdentifier", this.onPremisesSecurityIdentifier); + jsonWriter.writeBooleanField("onPremisesSyncEnabled", this.onPremisesSyncEnabled); + jsonWriter.writeStringField("preferredDataLocation", this.preferredDataLocation); + jsonWriter.writeStringField("preferredLanguage", this.preferredLanguage); + jsonWriter.writeArrayField("proxyAddresses", this.proxyAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("renewedDateTime", + this.renewedDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.renewedDateTime)); + jsonWriter.writeBooleanField("securityEnabled", this.securityEnabled); + jsonWriter.writeStringField("securityIdentifier", this.securityIdentifier); + jsonWriter.writeStringField("theme", this.theme); + jsonWriter.writeStringField("visibility", this.visibility); + jsonWriter.writeBooleanField("allowExternalSenders", this.allowExternalSenders); + jsonWriter.writeBooleanField("autoSubscribeNewMembers", this.autoSubscribeNewMembers); + jsonWriter.writeBooleanField("hideFromAddressLists", this.hideFromAddressLists); + jsonWriter.writeBooleanField("hideFromOutlookClients", this.hideFromOutlookClients); + jsonWriter.writeBooleanField("isSubscribedByMail", this.isSubscribedByMail); + jsonWriter.writeNumberField("unseenCount", this.unseenCount); + jsonWriter.writeBooleanField("isArchived", this.isArchived); + jsonWriter.writeArrayField("appRoleAssignments", this.appRoleAssignments, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("createdOnBehalfOf", this.createdOnBehalfOf); + jsonWriter.writeArrayField("memberOf", this.memberOf, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("members", this.members, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("membersWithLicenseErrors", this.membersWithLicenseErrors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("owners", this.owners, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("permissionGrants", this.permissionGrants, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("settings", this.settings, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("transitiveMemberOf", this.transitiveMemberOf, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("transitiveMembers", this.transitiveMembers, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("acceptedSenders", this.acceptedSenders, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("calendar", this.calendar); + jsonWriter.writeArrayField("calendarView", this.calendarView, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("conversations", this.conversations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("events", this.events, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("photo", this.photo); + jsonWriter.writeArrayField("photos", this.photos, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("rejectedSenders", this.rejectedSenders, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("threads", this.threads, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("drive", this.drive); + jsonWriter.writeArrayField("drives", this.drives, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sites", this.sites, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("groupLifecyclePolicies", this.groupLifecyclePolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("planner", this.planner); + jsonWriter.writeJsonField("onenote", this.onenote); + jsonWriter.writeJsonField("team", this.team); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphGroupInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphGroupInner 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 MicrosoftGraphGroupInner. + */ + public static MicrosoftGraphGroupInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphGroupInner deserializedMicrosoftGraphGroupInner = new MicrosoftGraphGroupInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("assignedLabels".equals(fieldName)) { + List assignedLabels + = reader.readArray(reader1 -> MicrosoftGraphAssignedLabel.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.assignedLabels = assignedLabels; + } else if ("assignedLicenses".equals(fieldName)) { + List assignedLicenses + = reader.readArray(reader1 -> MicrosoftGraphAssignedLicense.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.assignedLicenses = assignedLicenses; + } else if ("classification".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.classification = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.displayName = reader.getString(); + } else if ("expirationDateTime".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("groupTypes".equals(fieldName)) { + List groupTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphGroupInner.groupTypes = groupTypes; + } else if ("hasMembersWithLicenseErrors".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.hasMembersWithLicenseErrors + = reader.getNullable(JsonReader::getBoolean); + } else if ("licenseProcessingState".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.licenseProcessingState + = MicrosoftGraphLicenseProcessingState.fromJson(reader); + } else if ("mail".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.mail = reader.getString(); + } else if ("mailEnabled".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.mailEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("mailNickname".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.mailNickname = reader.getString(); + } else if ("membershipRule".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.membershipRule = reader.getString(); + } else if ("membershipRuleProcessingState".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.membershipRuleProcessingState = reader.getString(); + } else if ("onPremisesDomainName".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.onPremisesDomainName = reader.getString(); + } else if ("onPremisesLastSyncDateTime".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.onPremisesLastSyncDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("onPremisesNetBiosName".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.onPremisesNetBiosName = reader.getString(); + } else if ("onPremisesProvisioningErrors".equals(fieldName)) { + List onPremisesProvisioningErrors + = reader.readArray(reader1 -> MicrosoftGraphOnPremisesProvisioningError.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.onPremisesProvisioningErrors = onPremisesProvisioningErrors; + } else if ("onPremisesSamAccountName".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.onPremisesSamAccountName = reader.getString(); + } else if ("onPremisesSecurityIdentifier".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.onPremisesSecurityIdentifier = reader.getString(); + } else if ("onPremisesSyncEnabled".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.onPremisesSyncEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("preferredDataLocation".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.preferredDataLocation = reader.getString(); + } else if ("preferredLanguage".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.preferredLanguage = reader.getString(); + } else if ("proxyAddresses".equals(fieldName)) { + List proxyAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphGroupInner.proxyAddresses = proxyAddresses; + } else if ("renewedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.renewedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("securityEnabled".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.securityEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("securityIdentifier".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.securityIdentifier = reader.getString(); + } else if ("theme".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.theme = reader.getString(); + } else if ("visibility".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.visibility = reader.getString(); + } else if ("allowExternalSenders".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.allowExternalSenders + = reader.getNullable(JsonReader::getBoolean); + } else if ("autoSubscribeNewMembers".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.autoSubscribeNewMembers + = reader.getNullable(JsonReader::getBoolean); + } else if ("hideFromAddressLists".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.hideFromAddressLists + = reader.getNullable(JsonReader::getBoolean); + } else if ("hideFromOutlookClients".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.hideFromOutlookClients + = reader.getNullable(JsonReader::getBoolean); + } else if ("isSubscribedByMail".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.isSubscribedByMail + = reader.getNullable(JsonReader::getBoolean); + } else if ("unseenCount".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.unseenCount = reader.getNullable(JsonReader::getInt); + } else if ("isArchived".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.isArchived = reader.getNullable(JsonReader::getBoolean); + } else if ("appRoleAssignments".equals(fieldName)) { + List appRoleAssignments + = reader.readArray(reader1 -> MicrosoftGraphAppRoleAssignment.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.appRoleAssignments = appRoleAssignments; + } else if ("createdOnBehalfOf".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.createdOnBehalfOf + = MicrosoftGraphDirectoryObjectInner.fromJson(reader); + } else if ("memberOf".equals(fieldName)) { + List memberOf + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.memberOf = memberOf; + } else if ("members".equals(fieldName)) { + List members + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.members = members; + } else if ("membersWithLicenseErrors".equals(fieldName)) { + List membersWithLicenseErrors + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.membersWithLicenseErrors = membersWithLicenseErrors; + } else if ("owners".equals(fieldName)) { + List owners + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.owners = owners; + } else if ("permissionGrants".equals(fieldName)) { + List permissionGrants + = reader.readArray(reader1 -> MicrosoftGraphResourceSpecificPermissionGrant.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.permissionGrants = permissionGrants; + } else if ("settings".equals(fieldName)) { + List settings + = reader.readArray(reader1 -> MicrosoftGraphGroupSetting.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.settings = settings; + } else if ("transitiveMemberOf".equals(fieldName)) { + List transitiveMemberOf + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.transitiveMemberOf = transitiveMemberOf; + } else if ("transitiveMembers".equals(fieldName)) { + List transitiveMembers + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.transitiveMembers = transitiveMembers; + } else if ("acceptedSenders".equals(fieldName)) { + List acceptedSenders + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.acceptedSenders = acceptedSenders; + } else if ("calendar".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.calendar = MicrosoftGraphCalendar.fromJson(reader); + } else if ("calendarView".equals(fieldName)) { + List calendarView + = reader.readArray(reader1 -> MicrosoftGraphEvent.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.calendarView = calendarView; + } else if ("conversations".equals(fieldName)) { + List conversations + = reader.readArray(reader1 -> MicrosoftGraphConversation.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.conversations = conversations; + } else if ("events".equals(fieldName)) { + List events + = reader.readArray(reader1 -> MicrosoftGraphEvent.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.events = events; + } else if ("photo".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.photo = MicrosoftGraphProfilePhoto.fromJson(reader); + } else if ("photos".equals(fieldName)) { + List photos + = reader.readArray(reader1 -> MicrosoftGraphProfilePhoto.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.photos = photos; + } else if ("rejectedSenders".equals(fieldName)) { + List rejectedSenders + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.rejectedSenders = rejectedSenders; + } else if ("threads".equals(fieldName)) { + List threads + = reader.readArray(reader1 -> MicrosoftGraphConversationThread.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.threads = threads; + } else if ("drive".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.drive = MicrosoftGraphDrive.fromJson(reader); + } else if ("drives".equals(fieldName)) { + List drives + = reader.readArray(reader1 -> MicrosoftGraphDrive.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.drives = drives; + } else if ("sites".equals(fieldName)) { + List sites = reader.readArray(reader1 -> MicrosoftGraphSite.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.sites = sites; + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> MicrosoftGraphExtension.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.extensions = extensions; + } else if ("groupLifecyclePolicies".equals(fieldName)) { + List groupLifecyclePolicies + = reader.readArray(reader1 -> MicrosoftGraphGroupLifecyclePolicy.fromJson(reader1)); + deserializedMicrosoftGraphGroupInner.groupLifecyclePolicies = groupLifecyclePolicies; + } else if ("planner".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.planner = MicrosoftGraphPlannerGroup.fromJson(reader); + } else if ("onenote".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.onenote = MicrosoftGraphOnenote.fromJson(reader); + } else if ("team".equals(fieldName)) { + deserializedMicrosoftGraphGroupInner.team = MicrosoftGraphTeamInner.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphGroupInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphGroupInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupLifecyclePolicy.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupLifecyclePolicy.java index 028bc44f80c33..c38d0807dcf52 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupLifecyclePolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupLifecyclePolicy.java @@ -5,49 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** groupLifecyclePolicy. */ +/** + * groupLifecyclePolicy. + */ @Fluent public final class MicrosoftGraphGroupLifecyclePolicy extends MicrosoftGraphEntity { /* * List of email address to send notifications for groups without owners. Multiple email address can be defined by * separating email address with a semicolon. */ - @JsonProperty(value = "alternateNotificationEmails") private String alternateNotificationEmails; /* * Number of days before a group expires and needs to be renewed. Once renewed, the group expiration is extended by * the number of days defined. */ - @JsonProperty(value = "groupLifetimeInDays") private Integer groupLifetimeInDays; /* * The group type for which the expiration policy applies. Possible values are All, Selected or None. */ - @JsonProperty(value = "managedGroupTypes") private String managedGroupTypes; /* * groupLifecyclePolicy */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphGroupLifecyclePolicy class. */ + /** + * Creates an instance of MicrosoftGraphGroupLifecyclePolicy class. + */ public MicrosoftGraphGroupLifecyclePolicy() { } /** * Get the alternateNotificationEmails property: List of email address to send notifications for groups without * owners. Multiple email address can be defined by separating email address with a semicolon. - * + * * @return the alternateNotificationEmails value. */ public String alternateNotificationEmails() { @@ -57,7 +58,7 @@ public String alternateNotificationEmails() { /** * Set the alternateNotificationEmails property: List of email address to send notifications for groups without * owners. Multiple email address can be defined by separating email address with a semicolon. - * + * * @param alternateNotificationEmails the alternateNotificationEmails value to set. * @return the MicrosoftGraphGroupLifecyclePolicy object itself. */ @@ -69,7 +70,7 @@ public MicrosoftGraphGroupLifecyclePolicy withAlternateNotificationEmails(String /** * Get the groupLifetimeInDays property: Number of days before a group expires and needs to be renewed. Once * renewed, the group expiration is extended by the number of days defined. - * + * * @return the groupLifetimeInDays value. */ public Integer groupLifetimeInDays() { @@ -79,7 +80,7 @@ public Integer groupLifetimeInDays() { /** * Set the groupLifetimeInDays property: Number of days before a group expires and needs to be renewed. Once * renewed, the group expiration is extended by the number of days defined. - * + * * @param groupLifetimeInDays the groupLifetimeInDays value to set. * @return the MicrosoftGraphGroupLifecyclePolicy object itself. */ @@ -91,7 +92,7 @@ public MicrosoftGraphGroupLifecyclePolicy withGroupLifetimeInDays(Integer groupL /** * Get the managedGroupTypes property: The group type for which the expiration policy applies. Possible values are * All, Selected or None. - * + * * @return the managedGroupTypes value. */ public String managedGroupTypes() { @@ -101,7 +102,7 @@ public String managedGroupTypes() { /** * Set the managedGroupTypes property: The group type for which the expiration policy applies. Possible values are * All, Selected or None. - * + * * @param managedGroupTypes the managedGroupTypes value to set. * @return the MicrosoftGraphGroupLifecyclePolicy object itself. */ @@ -112,17 +113,16 @@ public MicrosoftGraphGroupLifecyclePolicy withManagedGroupTypes(String managedGr /** * Get the additionalProperties property: groupLifecyclePolicy. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: groupLifecyclePolicy. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphGroupLifecyclePolicy object itself. */ @@ -131,15 +131,9 @@ public MicrosoftGraphGroupLifecyclePolicy withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphGroupLifecyclePolicy withId(String id) { super.withId(id); @@ -148,11 +142,69 @@ public MicrosoftGraphGroupLifecyclePolicy withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("alternateNotificationEmails", this.alternateNotificationEmails); + jsonWriter.writeNumberField("groupLifetimeInDays", this.groupLifetimeInDays); + jsonWriter.writeStringField("managedGroupTypes", this.managedGroupTypes); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphGroupLifecyclePolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphGroupLifecyclePolicy 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 MicrosoftGraphGroupLifecyclePolicy. + */ + public static MicrosoftGraphGroupLifecyclePolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphGroupLifecyclePolicy deserializedMicrosoftGraphGroupLifecyclePolicy + = new MicrosoftGraphGroupLifecyclePolicy(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphGroupLifecyclePolicy.withId(reader.getString()); + } else if ("alternateNotificationEmails".equals(fieldName)) { + deserializedMicrosoftGraphGroupLifecyclePolicy.alternateNotificationEmails = reader.getString(); + } else if ("groupLifetimeInDays".equals(fieldName)) { + deserializedMicrosoftGraphGroupLifecyclePolicy.groupLifetimeInDays + = reader.getNullable(JsonReader::getInt); + } else if ("managedGroupTypes".equals(fieldName)) { + deserializedMicrosoftGraphGroupLifecyclePolicy.managedGroupTypes = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphGroupLifecyclePolicy.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphGroupLifecyclePolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupSetting.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupSetting.java index 37f655ebfd26c..49bc99987b5f4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupSetting.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphGroupSetting.java @@ -5,47 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** groupSetting. */ +/** + * groupSetting. + */ @Fluent public final class MicrosoftGraphGroupSetting extends MicrosoftGraphEntity { /* * Display name of this group of settings, which comes from the associated template. */ - @JsonProperty(value = "displayName") private String displayName; /* * Unique identifier for the template used to create this group of settings. Read-only. */ - @JsonProperty(value = "templateId") private String templateId; /* * Collection of name value pairs. Must contain and set all the settings defined in the template. */ - @JsonProperty(value = "values") private List values; /* * groupSetting */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphGroupSetting class. */ + /** + * Creates an instance of MicrosoftGraphGroupSetting class. + */ public MicrosoftGraphGroupSetting() { } /** * Get the displayName property: Display name of this group of settings, which comes from the associated template. - * + * * @return the displayName value. */ public String displayName() { @@ -54,7 +55,7 @@ public String displayName() { /** * Set the displayName property: Display name of this group of settings, which comes from the associated template. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphGroupSetting object itself. */ @@ -65,7 +66,7 @@ public MicrosoftGraphGroupSetting withDisplayName(String displayName) { /** * Get the templateId property: Unique identifier for the template used to create this group of settings. Read-only. - * + * * @return the templateId value. */ public String templateId() { @@ -74,7 +75,7 @@ public String templateId() { /** * Set the templateId property: Unique identifier for the template used to create this group of settings. Read-only. - * + * * @param templateId the templateId value to set. * @return the MicrosoftGraphGroupSetting object itself. */ @@ -86,7 +87,7 @@ public MicrosoftGraphGroupSetting withTemplateId(String templateId) { /** * Get the values property: Collection of name value pairs. Must contain and set all the settings defined in the * template. - * + * * @return the values value. */ public List values() { @@ -96,7 +97,7 @@ public List values() { /** * Set the values property: Collection of name value pairs. Must contain and set all the settings defined in the * template. - * + * * @param values the values value to set. * @return the MicrosoftGraphGroupSetting object itself. */ @@ -107,17 +108,16 @@ public MicrosoftGraphGroupSetting withValues(List va /** * Get the additionalProperties property: groupSetting. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: groupSetting. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphGroupSetting object itself. */ @@ -126,15 +126,9 @@ public MicrosoftGraphGroupSetting withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphGroupSetting withId(String id) { super.withId(id); @@ -143,7 +137,7 @@ public MicrosoftGraphGroupSetting withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -153,4 +147,62 @@ public void validate() { values().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("templateId", this.templateId); + jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphGroupSetting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphGroupSetting 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 MicrosoftGraphGroupSetting. + */ + public static MicrosoftGraphGroupSetting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphGroupSetting deserializedMicrosoftGraphGroupSetting = new MicrosoftGraphGroupSetting(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphGroupSetting.withId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphGroupSetting.displayName = reader.getString(); + } else if ("templateId".equals(fieldName)) { + deserializedMicrosoftGraphGroupSetting.templateId = reader.getString(); + } else if ("values".equals(fieldName)) { + List values + = reader.readArray(reader1 -> MicrosoftGraphSettingValue.fromJson(reader1)); + deserializedMicrosoftGraphGroupSetting.values = values; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphGroupSetting.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphGroupSetting; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphHashes.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphHashes.java index e7b15d8232a15..366906f06ed7a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphHashes.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphHashes.java @@ -5,53 +5,54 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** hashes. */ +/** + * hashes. + */ @Fluent -public final class MicrosoftGraphHashes { +public final class MicrosoftGraphHashes implements JsonSerializable { /* * The CRC32 value of the file in little endian (if available). Read-only. */ - @JsonProperty(value = "crc32Hash") private String crc32Hash; /* * A proprietary hash of the file that can be used to determine if the contents of the file have changed (if * available). Read-only. */ - @JsonProperty(value = "quickXorHash") private String quickXorHash; /* * SHA1 hash for the contents of the file (if available). Read-only. */ - @JsonProperty(value = "sha1Hash") private String sha1Hash; /* * SHA256 hash for the contents of the file (if available). Read-only. */ - @JsonProperty(value = "sha256Hash") private String sha256Hash; /* * hashes */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphHashes class. */ + /** + * Creates an instance of MicrosoftGraphHashes class. + */ public MicrosoftGraphHashes() { } /** * Get the crc32Hash property: The CRC32 value of the file in little endian (if available). Read-only. - * + * * @return the crc32Hash value. */ public String crc32Hash() { @@ -60,7 +61,7 @@ public String crc32Hash() { /** * Set the crc32Hash property: The CRC32 value of the file in little endian (if available). Read-only. - * + * * @param crc32Hash the crc32Hash value to set. * @return the MicrosoftGraphHashes object itself. */ @@ -72,7 +73,7 @@ public MicrosoftGraphHashes withCrc32Hash(String crc32Hash) { /** * Get the quickXorHash property: A proprietary hash of the file that can be used to determine if the contents of * the file have changed (if available). Read-only. - * + * * @return the quickXorHash value. */ public String quickXorHash() { @@ -82,7 +83,7 @@ public String quickXorHash() { /** * Set the quickXorHash property: A proprietary hash of the file that can be used to determine if the contents of * the file have changed (if available). Read-only. - * + * * @param quickXorHash the quickXorHash value to set. * @return the MicrosoftGraphHashes object itself. */ @@ -93,7 +94,7 @@ public MicrosoftGraphHashes withQuickXorHash(String quickXorHash) { /** * Get the sha1Hash property: SHA1 hash for the contents of the file (if available). Read-only. - * + * * @return the sha1Hash value. */ public String sha1Hash() { @@ -102,7 +103,7 @@ public String sha1Hash() { /** * Set the sha1Hash property: SHA1 hash for the contents of the file (if available). Read-only. - * + * * @param sha1Hash the sha1Hash value to set. * @return the MicrosoftGraphHashes object itself. */ @@ -113,7 +114,7 @@ public MicrosoftGraphHashes withSha1Hash(String sha1Hash) { /** * Get the sha256Hash property: SHA256 hash for the contents of the file (if available). Read-only. - * + * * @return the sha256Hash value. */ public String sha256Hash() { @@ -122,7 +123,7 @@ public String sha256Hash() { /** * Set the sha256Hash property: SHA256 hash for the contents of the file (if available). Read-only. - * + * * @param sha256Hash the sha256Hash value to set. * @return the MicrosoftGraphHashes object itself. */ @@ -133,17 +134,16 @@ public MicrosoftGraphHashes withSha256Hash(String sha256Hash) { /** * Get the additionalProperties property: hashes. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: hashes. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphHashes object itself. */ @@ -152,19 +152,67 @@ public MicrosoftGraphHashes withAdditionalProperties(Map additio return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("crc32Hash", this.crc32Hash); + jsonWriter.writeStringField("quickXorHash", this.quickXorHash); + jsonWriter.writeStringField("sha1Hash", this.sha1Hash); + jsonWriter.writeStringField("sha256Hash", this.sha256Hash); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphHashes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphHashes 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 MicrosoftGraphHashes. + */ + public static MicrosoftGraphHashes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphHashes deserializedMicrosoftGraphHashes = new MicrosoftGraphHashes(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("crc32Hash".equals(fieldName)) { + deserializedMicrosoftGraphHashes.crc32Hash = reader.getString(); + } else if ("quickXorHash".equals(fieldName)) { + deserializedMicrosoftGraphHashes.quickXorHash = reader.getString(); + } else if ("sha1Hash".equals(fieldName)) { + deserializedMicrosoftGraphHashes.sha1Hash = reader.getString(); + } else if ("sha256Hash".equals(fieldName)) { + deserializedMicrosoftGraphHashes.sha256Hash = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphHashes.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphHashes; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphHomeRealmDiscoveryPolicyInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphHomeRealmDiscoveryPolicyInner.java index 392feaed2ea95..b02dbb518ec41 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphHomeRealmDiscoveryPolicyInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphHomeRealmDiscoveryPolicyInner.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * homeRealmDiscoveryPolicy - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -25,19 +28,20 @@ public final class MicrosoftGraphHomeRealmDiscoveryPolicyInner extends Microsoft * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphHomeRealmDiscoveryPolicyInner class. */ + /** + * Creates an instance of MicrosoftGraphHomeRealmDiscoveryPolicyInner class. + */ public MicrosoftGraphHomeRealmDiscoveryPolicyInner() { } /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -45,68 +49,74 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphHomeRealmDiscoveryPolicyInner object itself. */ - public MicrosoftGraphHomeRealmDiscoveryPolicyInner withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphHomeRealmDiscoveryPolicyInner + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphHomeRealmDiscoveryPolicyInner withDefinition(List definition) { super.withDefinition(definition); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphHomeRealmDiscoveryPolicyInner withIsOrganizationDefault(Boolean isOrganizationDefault) { super.withIsOrganizationDefault(isOrganizationDefault); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public MicrosoftGraphHomeRealmDiscoveryPolicyInner withAppliesTo( - List appliesTo) { + public MicrosoftGraphHomeRealmDiscoveryPolicyInner + withAppliesTo(List appliesTo) { super.withAppliesTo(appliesTo); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphHomeRealmDiscoveryPolicyInner withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphHomeRealmDiscoveryPolicyInner withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphHomeRealmDiscoveryPolicyInner withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphHomeRealmDiscoveryPolicyInner withId(String id) { super.withId(id); @@ -115,11 +125,83 @@ public MicrosoftGraphHomeRealmDiscoveryPolicyInner withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeArrayField("definition", definition(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isOrganizationDefault", isOrganizationDefault()); + jsonWriter.writeArrayField("appliesTo", appliesTo(), (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphHomeRealmDiscoveryPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphHomeRealmDiscoveryPolicyInner 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 MicrosoftGraphHomeRealmDiscoveryPolicyInner. + */ + public static MicrosoftGraphHomeRealmDiscoveryPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphHomeRealmDiscoveryPolicyInner deserializedMicrosoftGraphHomeRealmDiscoveryPolicyInner + = new MicrosoftGraphHomeRealmDiscoveryPolicyInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphHomeRealmDiscoveryPolicyInner.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphHomeRealmDiscoveryPolicyInner.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphHomeRealmDiscoveryPolicyInner.withDescription(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphHomeRealmDiscoveryPolicyInner.withDisplayName(reader.getString()); + } else if ("definition".equals(fieldName)) { + List definition = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphHomeRealmDiscoveryPolicyInner.withDefinition(definition); + } else if ("isOrganizationDefault".equals(fieldName)) { + deserializedMicrosoftGraphHomeRealmDiscoveryPolicyInner + .withIsOrganizationDefault(reader.getNullable(JsonReader::getBoolean)); + } else if ("appliesTo".equals(fieldName)) { + List appliesTo + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphHomeRealmDiscoveryPolicyInner.withAppliesTo(appliesTo); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphHomeRealmDiscoveryPolicyInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphHomeRealmDiscoveryPolicyInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIdentity.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIdentity.java index 2c2e6b24f203f..dce17b10b5607 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIdentity.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIdentity.java @@ -5,36 +5,39 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** identity. */ +/** + * identity. + */ @Fluent -public final class MicrosoftGraphIdentity { +public final class MicrosoftGraphIdentity implements JsonSerializable { /* * The identity's display name. Note that this may not always be available or up to date. For example, if a user * changes their display name, the API may show the new value in a future response, but the items associated with * the user won't show up as having changed when using delta. */ - @JsonProperty(value = "displayName") private String displayName; /* * Unique identifier for the identity. */ - @JsonProperty(value = "id") private String id; /* * identity */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphIdentity class. */ + /** + * Creates an instance of MicrosoftGraphIdentity class. + */ public MicrosoftGraphIdentity() { } @@ -42,7 +45,7 @@ public MicrosoftGraphIdentity() { * Get the displayName property: The identity's display name. Note that this may not always be available or up to * date. For example, if a user changes their display name, the API may show the new value in a future response, but * the items associated with the user won't show up as having changed when using delta. - * + * * @return the displayName value. */ public String displayName() { @@ -53,7 +56,7 @@ public String displayName() { * Set the displayName property: The identity's display name. Note that this may not always be available or up to * date. For example, if a user changes their display name, the API may show the new value in a future response, but * the items associated with the user won't show up as having changed when using delta. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphIdentity object itself. */ @@ -64,7 +67,7 @@ public MicrosoftGraphIdentity withDisplayName(String displayName) { /** * Get the id property: Unique identifier for the identity. - * + * * @return the id value. */ public String id() { @@ -73,7 +76,7 @@ public String id() { /** * Set the id property: Unique identifier for the identity. - * + * * @param id the id value to set. * @return the MicrosoftGraphIdentity object itself. */ @@ -84,17 +87,16 @@ public MicrosoftGraphIdentity withId(String id) { /** * Get the additionalProperties property: identity. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: identity. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphIdentity object itself. */ @@ -103,19 +105,61 @@ public MicrosoftGraphIdentity withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("id", this.id); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphIdentity 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 MicrosoftGraphIdentity. + */ + public static MicrosoftGraphIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphIdentity deserializedMicrosoftGraphIdentity = new MicrosoftGraphIdentity(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphIdentity.displayName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMicrosoftGraphIdentity.id = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphIdentity.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphIdentity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIdentitySet.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIdentitySet.java index 2db65a4312fa6..0ea768f6cdb13 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIdentitySet.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIdentitySet.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** identitySet. */ +/** + * identitySet. + */ @Fluent -public final class MicrosoftGraphIdentitySet { +public final class MicrosoftGraphIdentitySet implements JsonSerializable { /* * identity */ - @JsonProperty(value = "application") private MicrosoftGraphIdentity application; /* * identity */ - @JsonProperty(value = "device") private MicrosoftGraphIdentity device; /* * identity */ - @JsonProperty(value = "user") private MicrosoftGraphIdentity user; /* * identitySet */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphIdentitySet class. */ + /** + * Creates an instance of MicrosoftGraphIdentitySet class. + */ public MicrosoftGraphIdentitySet() { } /** * Get the application property: identity. - * + * * @return the application value. */ public MicrosoftGraphIdentity application() { @@ -53,7 +55,7 @@ public MicrosoftGraphIdentity application() { /** * Set the application property: identity. - * + * * @param application the application value to set. * @return the MicrosoftGraphIdentitySet object itself. */ @@ -64,7 +66,7 @@ public MicrosoftGraphIdentitySet withApplication(MicrosoftGraphIdentity applicat /** * Get the device property: identity. - * + * * @return the device value. */ public MicrosoftGraphIdentity device() { @@ -73,7 +75,7 @@ public MicrosoftGraphIdentity device() { /** * Set the device property: identity. - * + * * @param device the device value to set. * @return the MicrosoftGraphIdentitySet object itself. */ @@ -84,7 +86,7 @@ public MicrosoftGraphIdentitySet withDevice(MicrosoftGraphIdentity device) { /** * Get the user property: identity. - * + * * @return the user value. */ public MicrosoftGraphIdentity user() { @@ -93,7 +95,7 @@ public MicrosoftGraphIdentity user() { /** * Set the user property: identity. - * + * * @param user the user value to set. * @return the MicrosoftGraphIdentitySet object itself. */ @@ -104,17 +106,16 @@ public MicrosoftGraphIdentitySet withUser(MicrosoftGraphIdentity user) { /** * Get the additionalProperties property: identitySet. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: identitySet. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphIdentitySet object itself. */ @@ -123,17 +124,9 @@ public MicrosoftGraphIdentitySet withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -147,4 +140,57 @@ public void validate() { user().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("application", this.application); + jsonWriter.writeJsonField("device", this.device); + jsonWriter.writeJsonField("user", this.user); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphIdentitySet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphIdentitySet 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 MicrosoftGraphIdentitySet. + */ + public static MicrosoftGraphIdentitySet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphIdentitySet deserializedMicrosoftGraphIdentitySet = new MicrosoftGraphIdentitySet(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("application".equals(fieldName)) { + deserializedMicrosoftGraphIdentitySet.application = MicrosoftGraphIdentity.fromJson(reader); + } else if ("device".equals(fieldName)) { + deserializedMicrosoftGraphIdentitySet.device = MicrosoftGraphIdentity.fromJson(reader); + } else if ("user".equals(fieldName)) { + deserializedMicrosoftGraphIdentitySet.user = MicrosoftGraphIdentity.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphIdentitySet.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphIdentitySet; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImage.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImage.java index 715bdbafe2e20..43bc8dceb149c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImage.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImage.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** image. */ +/** + * image. + */ @Fluent -public final class MicrosoftGraphImage { +public final class MicrosoftGraphImage implements JsonSerializable { /* * Optional. Height of the image, in pixels. Read-only. */ - @JsonProperty(value = "height") private Integer height; /* * Optional. Width of the image, in pixels. Read-only. */ - @JsonProperty(value = "width") private Integer width; /* * image */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphImage class. */ + /** + * Creates an instance of MicrosoftGraphImage class. + */ public MicrosoftGraphImage() { } /** * Get the height property: Optional. Height of the image, in pixels. Read-only. - * + * * @return the height value. */ public Integer height() { @@ -47,7 +50,7 @@ public Integer height() { /** * Set the height property: Optional. Height of the image, in pixels. Read-only. - * + * * @param height the height value to set. * @return the MicrosoftGraphImage object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphImage withHeight(Integer height) { /** * Get the width property: Optional. Width of the image, in pixels. Read-only. - * + * * @return the width value. */ public Integer width() { @@ -67,7 +70,7 @@ public Integer width() { /** * Set the width property: Optional. Width of the image, in pixels. Read-only. - * + * * @param width the width value to set. * @return the MicrosoftGraphImage object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphImage withWidth(Integer width) { /** * Get the additionalProperties property: image. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: image. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphImage object itself. */ @@ -97,19 +99,61 @@ public MicrosoftGraphImage withAdditionalProperties(Map addition return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("height", this.height); + jsonWriter.writeNumberField("width", this.width); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphImage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphImage 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 MicrosoftGraphImage. + */ + public static MicrosoftGraphImage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphImage deserializedMicrosoftGraphImage = new MicrosoftGraphImage(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("height".equals(fieldName)) { + deserializedMicrosoftGraphImage.height = reader.getNullable(JsonReader::getInt); + } else if ("width".equals(fieldName)) { + deserializedMicrosoftGraphImage.width = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphImage.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphImage; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImageInfo.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImageInfo.java index 7ec323a0b2200..a4140764e20d0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImageInfo.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImageInfo.java @@ -5,54 +5,55 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** imageInfo. */ +/** + * imageInfo. + */ @Fluent -public final class MicrosoftGraphImageInfo { +public final class MicrosoftGraphImageInfo implements JsonSerializable { /* * Optional; parameter used to indicate the server is able to render image dynamically in response to * parameterization. For example – a high contrast image */ - @JsonProperty(value = "addImageQuery") private Boolean addImageQuery; /* * Optional; alt-text accessible content for the image */ - @JsonProperty(value = "alternateText") private String alternateText; /* * The alternativeText property. */ - @JsonProperty(value = "alternativeText") private String alternativeText; /* * Optional; URI that points to an icon which represents the application used to generate the activity */ - @JsonProperty(value = "iconUrl") private String iconUrl; /* * imageInfo */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphImageInfo class. */ + /** + * Creates an instance of MicrosoftGraphImageInfo class. + */ public MicrosoftGraphImageInfo() { } /** * Get the addImageQuery property: Optional; parameter used to indicate the server is able to render image * dynamically in response to parameterization. For example – a high contrast image. - * + * * @return the addImageQuery value. */ public Boolean addImageQuery() { @@ -62,7 +63,7 @@ public Boolean addImageQuery() { /** * Set the addImageQuery property: Optional; parameter used to indicate the server is able to render image * dynamically in response to parameterization. For example – a high contrast image. - * + * * @param addImageQuery the addImageQuery value to set. * @return the MicrosoftGraphImageInfo object itself. */ @@ -73,7 +74,7 @@ public MicrosoftGraphImageInfo withAddImageQuery(Boolean addImageQuery) { /** * Get the alternateText property: Optional; alt-text accessible content for the image. - * + * * @return the alternateText value. */ public String alternateText() { @@ -82,7 +83,7 @@ public String alternateText() { /** * Set the alternateText property: Optional; alt-text accessible content for the image. - * + * * @param alternateText the alternateText value to set. * @return the MicrosoftGraphImageInfo object itself. */ @@ -93,7 +94,7 @@ public MicrosoftGraphImageInfo withAlternateText(String alternateText) { /** * Get the alternativeText property: The alternativeText property. - * + * * @return the alternativeText value. */ public String alternativeText() { @@ -102,7 +103,7 @@ public String alternativeText() { /** * Set the alternativeText property: The alternativeText property. - * + * * @param alternativeText the alternativeText value to set. * @return the MicrosoftGraphImageInfo object itself. */ @@ -114,7 +115,7 @@ public MicrosoftGraphImageInfo withAlternativeText(String alternativeText) { /** * Get the iconUrl property: Optional; URI that points to an icon which represents the application used to generate * the activity. - * + * * @return the iconUrl value. */ public String iconUrl() { @@ -124,7 +125,7 @@ public String iconUrl() { /** * Set the iconUrl property: Optional; URI that points to an icon which represents the application used to generate * the activity. - * + * * @param iconUrl the iconUrl value to set. * @return the MicrosoftGraphImageInfo object itself. */ @@ -135,17 +136,16 @@ public MicrosoftGraphImageInfo withIconUrl(String iconUrl) { /** * Get the additionalProperties property: imageInfo. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: imageInfo. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphImageInfo object itself. */ @@ -154,19 +154,67 @@ public MicrosoftGraphImageInfo withAdditionalProperties(Map addi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("addImageQuery", this.addImageQuery); + jsonWriter.writeStringField("alternateText", this.alternateText); + jsonWriter.writeStringField("alternativeText", this.alternativeText); + jsonWriter.writeStringField("iconUrl", this.iconUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphImageInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphImageInfo 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 MicrosoftGraphImageInfo. + */ + public static MicrosoftGraphImageInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphImageInfo deserializedMicrosoftGraphImageInfo = new MicrosoftGraphImageInfo(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("addImageQuery".equals(fieldName)) { + deserializedMicrosoftGraphImageInfo.addImageQuery = reader.getNullable(JsonReader::getBoolean); + } else if ("alternateText".equals(fieldName)) { + deserializedMicrosoftGraphImageInfo.alternateText = reader.getString(); + } else if ("alternativeText".equals(fieldName)) { + deserializedMicrosoftGraphImageInfo.alternativeText = reader.getString(); + } else if ("iconUrl".equals(fieldName)) { + deserializedMicrosoftGraphImageInfo.iconUrl = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphImageInfo.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphImageInfo; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImplicitGrantSettings.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImplicitGrantSettings.java index d2274f9e2790e..edb56c15df911 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImplicitGrantSettings.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImplicitGrantSettings.java @@ -5,41 +5,45 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** implicitGrantSettings. */ +/** + * implicitGrantSettings. + */ @Fluent -public final class MicrosoftGraphImplicitGrantSettings { +public final class MicrosoftGraphImplicitGrantSettings + implements JsonSerializable { /* * Specifies whether this web application can request an access token using the OAuth 2.0 implicit flow. */ - @JsonProperty(value = "enableAccessTokenIssuance") private Boolean enableAccessTokenIssuance; /* * Specifies whether this web application can request an ID token using the OAuth 2.0 implicit flow. */ - @JsonProperty(value = "enableIdTokenIssuance") private Boolean enableIdTokenIssuance; /* * implicitGrantSettings */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphImplicitGrantSettings class. */ + /** + * Creates an instance of MicrosoftGraphImplicitGrantSettings class. + */ public MicrosoftGraphImplicitGrantSettings() { } /** * Get the enableAccessTokenIssuance property: Specifies whether this web application can request an access token * using the OAuth 2.0 implicit flow. - * + * * @return the enableAccessTokenIssuance value. */ public Boolean enableAccessTokenIssuance() { @@ -49,7 +53,7 @@ public Boolean enableAccessTokenIssuance() { /** * Set the enableAccessTokenIssuance property: Specifies whether this web application can request an access token * using the OAuth 2.0 implicit flow. - * + * * @param enableAccessTokenIssuance the enableAccessTokenIssuance value to set. * @return the MicrosoftGraphImplicitGrantSettings object itself. */ @@ -61,7 +65,7 @@ public MicrosoftGraphImplicitGrantSettings withEnableAccessTokenIssuance(Boolean /** * Get the enableIdTokenIssuance property: Specifies whether this web application can request an ID token using the * OAuth 2.0 implicit flow. - * + * * @return the enableIdTokenIssuance value. */ public Boolean enableIdTokenIssuance() { @@ -71,7 +75,7 @@ public Boolean enableIdTokenIssuance() { /** * Set the enableIdTokenIssuance property: Specifies whether this web application can request an ID token using the * OAuth 2.0 implicit flow. - * + * * @param enableIdTokenIssuance the enableIdTokenIssuance value to set. * @return the MicrosoftGraphImplicitGrantSettings object itself. */ @@ -82,17 +86,16 @@ public MicrosoftGraphImplicitGrantSettings withEnableIdTokenIssuance(Boolean ena /** * Get the additionalProperties property: implicitGrantSettings. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: implicitGrantSettings. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphImplicitGrantSettings object itself. */ @@ -101,19 +104,64 @@ public MicrosoftGraphImplicitGrantSettings withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableAccessTokenIssuance", this.enableAccessTokenIssuance); + jsonWriter.writeBooleanField("enableIdTokenIssuance", this.enableIdTokenIssuance); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphImplicitGrantSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphImplicitGrantSettings 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 MicrosoftGraphImplicitGrantSettings. + */ + public static MicrosoftGraphImplicitGrantSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphImplicitGrantSettings deserializedMicrosoftGraphImplicitGrantSettings + = new MicrosoftGraphImplicitGrantSettings(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableAccessTokenIssuance".equals(fieldName)) { + deserializedMicrosoftGraphImplicitGrantSettings.enableAccessTokenIssuance + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableIdTokenIssuance".equals(fieldName)) { + deserializedMicrosoftGraphImplicitGrantSettings.enableIdTokenIssuance + = reader.getNullable(JsonReader::getBoolean); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphImplicitGrantSettings.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphImplicitGrantSettings; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImportance.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImportance.java index 8bd7a905e6e09..7aeb374d6fd5a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImportance.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphImportance.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** importance. */ +/** + * importance. + */ public final class MicrosoftGraphImportance extends ExpandableStringEnum { - /** Static value low for MicrosoftGraphImportance. */ + /** + * Static value low for MicrosoftGraphImportance. + */ public static final MicrosoftGraphImportance LOW = fromString("low"); - /** Static value normal for MicrosoftGraphImportance. */ + /** + * Static value normal for MicrosoftGraphImportance. + */ public static final MicrosoftGraphImportance NORMAL = fromString("normal"); - /** Static value high for MicrosoftGraphImportance. */ + /** + * Static value high for MicrosoftGraphImportance. + */ public static final MicrosoftGraphImportance HIGH = fromString("high"); /** * Creates a new instance of MicrosoftGraphImportance value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public MicrosoftGraphImportance() { /** * Creates or finds a MicrosoftGraphImportance from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphImportance. */ - @JsonCreator public static MicrosoftGraphImportance fromString(String name) { return fromString(name, MicrosoftGraphImportance.class); } /** * Gets known MicrosoftGraphImportance values. - * + * * @return known MicrosoftGraphImportance values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIncompleteData.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIncompleteData.java index 8918880ea7606..3cf85cd03d415 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIncompleteData.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphIncompleteData.java @@ -5,41 +5,46 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** incompleteData. */ +/** + * incompleteData. + */ @Fluent -public final class MicrosoftGraphIncompleteData { +public final class MicrosoftGraphIncompleteData implements JsonSerializable { /* * The service does not have source data before the specified time. */ - @JsonProperty(value = "missingDataBeforeDateTime") private OffsetDateTime missingDataBeforeDateTime; /* * Some data was not recorded due to excessive activity. */ - @JsonProperty(value = "wasThrottled") private Boolean wasThrottled; /* * incompleteData */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphIncompleteData class. */ + /** + * Creates an instance of MicrosoftGraphIncompleteData class. + */ public MicrosoftGraphIncompleteData() { } /** * Get the missingDataBeforeDateTime property: The service does not have source data before the specified time. - * + * * @return the missingDataBeforeDateTime value. */ public OffsetDateTime missingDataBeforeDateTime() { @@ -48,7 +53,7 @@ public OffsetDateTime missingDataBeforeDateTime() { /** * Set the missingDataBeforeDateTime property: The service does not have source data before the specified time. - * + * * @param missingDataBeforeDateTime the missingDataBeforeDateTime value to set. * @return the MicrosoftGraphIncompleteData object itself. */ @@ -59,7 +64,7 @@ public MicrosoftGraphIncompleteData withMissingDataBeforeDateTime(OffsetDateTime /** * Get the wasThrottled property: Some data was not recorded due to excessive activity. - * + * * @return the wasThrottled value. */ public Boolean wasThrottled() { @@ -68,7 +73,7 @@ public Boolean wasThrottled() { /** * Set the wasThrottled property: Some data was not recorded due to excessive activity. - * + * * @param wasThrottled the wasThrottled value to set. * @return the MicrosoftGraphIncompleteData object itself. */ @@ -79,17 +84,16 @@ public MicrosoftGraphIncompleteData withWasThrottled(Boolean wasThrottled) { /** * Get the additionalProperties property: incompleteData. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: incompleteData. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphIncompleteData object itself. */ @@ -98,19 +102,65 @@ public MicrosoftGraphIncompleteData withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("missingDataBeforeDateTime", + this.missingDataBeforeDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.missingDataBeforeDateTime)); + jsonWriter.writeBooleanField("wasThrottled", this.wasThrottled); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphIncompleteData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphIncompleteData 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 MicrosoftGraphIncompleteData. + */ + public static MicrosoftGraphIncompleteData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphIncompleteData deserializedMicrosoftGraphIncompleteData = new MicrosoftGraphIncompleteData(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("missingDataBeforeDateTime".equals(fieldName)) { + deserializedMicrosoftGraphIncompleteData.missingDataBeforeDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("wasThrottled".equals(fieldName)) { + deserializedMicrosoftGraphIncompleteData.wasThrottled = reader.getNullable(JsonReader::getBoolean); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphIncompleteData.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphIncompleteData; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassification.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassification.java index 7af44c1fd39c8..7736c3cf88e50 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassification.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassification.java @@ -5,37 +5,40 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** inferenceClassification. */ +/** + * inferenceClassification. + */ @Fluent public final class MicrosoftGraphInferenceClassification extends MicrosoftGraphEntity { /* * A set of overrides for a user to always classify messages from specific senders in certain ways: focused, or * other. Read-only. Nullable. */ - @JsonProperty(value = "overrides") private List overrides; /* * inferenceClassification */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphInferenceClassification class. */ + /** + * Creates an instance of MicrosoftGraphInferenceClassification class. + */ public MicrosoftGraphInferenceClassification() { } /** * Get the overrides property: A set of overrides for a user to always classify messages from specific senders in * certain ways: focused, or other. Read-only. Nullable. - * + * * @return the overrides value. */ public List overrides() { @@ -45,29 +48,28 @@ public List overrides() { /** * Set the overrides property: A set of overrides for a user to always classify messages from specific senders in * certain ways: focused, or other. Read-only. Nullable. - * + * * @param overrides the overrides value to set. * @return the MicrosoftGraphInferenceClassification object itself. */ - public MicrosoftGraphInferenceClassification withOverrides( - List overrides) { + public MicrosoftGraphInferenceClassification + withOverrides(List overrides) { this.overrides = overrides; return this; } /** * Get the additionalProperties property: inferenceClassification. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: inferenceClassification. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphInferenceClassification object itself. */ @@ -76,15 +78,9 @@ public MicrosoftGraphInferenceClassification withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphInferenceClassification withId(String id) { super.withId(id); @@ -93,7 +89,7 @@ public MicrosoftGraphInferenceClassification withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -103,4 +99,57 @@ public void validate() { overrides().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("overrides", this.overrides, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphInferenceClassification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphInferenceClassification 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 MicrosoftGraphInferenceClassification. + */ + public static MicrosoftGraphInferenceClassification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphInferenceClassification deserializedMicrosoftGraphInferenceClassification + = new MicrosoftGraphInferenceClassification(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphInferenceClassification.withId(reader.getString()); + } else if ("overrides".equals(fieldName)) { + List overrides + = reader.readArray(reader1 -> MicrosoftGraphInferenceClassificationOverride.fromJson(reader1)); + deserializedMicrosoftGraphInferenceClassification.overrides = overrides; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphInferenceClassification.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphInferenceClassification; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassificationOverride.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassificationOverride.java index c2e9af9cae487..c6e7aacd99276 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassificationOverride.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassificationOverride.java @@ -5,40 +5,42 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** inferenceClassificationOverride. */ +/** + * inferenceClassificationOverride. + */ @Fluent public final class MicrosoftGraphInferenceClassificationOverride extends MicrosoftGraphEntity { /* * inferenceClassificationType */ - @JsonProperty(value = "classifyAs") private MicrosoftGraphInferenceClassificationType classifyAs; /* * emailAddress */ - @JsonProperty(value = "senderEmailAddress") private MicrosoftGraphEmailAddress senderEmailAddress; /* * inferenceClassificationOverride */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphInferenceClassificationOverride class. */ + /** + * Creates an instance of MicrosoftGraphInferenceClassificationOverride class. + */ public MicrosoftGraphInferenceClassificationOverride() { } /** * Get the classifyAs property: inferenceClassificationType. - * + * * @return the classifyAs value. */ public MicrosoftGraphInferenceClassificationType classifyAs() { @@ -47,19 +49,19 @@ public MicrosoftGraphInferenceClassificationType classifyAs() { /** * Set the classifyAs property: inferenceClassificationType. - * + * * @param classifyAs the classifyAs value to set. * @return the MicrosoftGraphInferenceClassificationOverride object itself. */ - public MicrosoftGraphInferenceClassificationOverride withClassifyAs( - MicrosoftGraphInferenceClassificationType classifyAs) { + public MicrosoftGraphInferenceClassificationOverride + withClassifyAs(MicrosoftGraphInferenceClassificationType classifyAs) { this.classifyAs = classifyAs; return this; } /** * Get the senderEmailAddress property: emailAddress. - * + * * @return the senderEmailAddress value. */ public MicrosoftGraphEmailAddress senderEmailAddress() { @@ -68,47 +70,40 @@ public MicrosoftGraphEmailAddress senderEmailAddress() { /** * Set the senderEmailAddress property: emailAddress. - * + * * @param senderEmailAddress the senderEmailAddress value to set. * @return the MicrosoftGraphInferenceClassificationOverride object itself. */ - public MicrosoftGraphInferenceClassificationOverride withSenderEmailAddress( - MicrosoftGraphEmailAddress senderEmailAddress) { + public MicrosoftGraphInferenceClassificationOverride + withSenderEmailAddress(MicrosoftGraphEmailAddress senderEmailAddress) { this.senderEmailAddress = senderEmailAddress; return this; } /** * Get the additionalProperties property: inferenceClassificationOverride. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: inferenceClassificationOverride. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphInferenceClassificationOverride object itself. */ - public MicrosoftGraphInferenceClassificationOverride withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphInferenceClassificationOverride + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphInferenceClassificationOverride withId(String id) { super.withId(id); @@ -117,7 +112,7 @@ public MicrosoftGraphInferenceClassificationOverride withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -127,4 +122,60 @@ public void validate() { senderEmailAddress().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("classifyAs", this.classifyAs == null ? null : this.classifyAs.toString()); + jsonWriter.writeJsonField("senderEmailAddress", this.senderEmailAddress); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphInferenceClassificationOverride from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphInferenceClassificationOverride 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 MicrosoftGraphInferenceClassificationOverride. + */ + public static MicrosoftGraphInferenceClassificationOverride fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphInferenceClassificationOverride deserializedMicrosoftGraphInferenceClassificationOverride + = new MicrosoftGraphInferenceClassificationOverride(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphInferenceClassificationOverride.withId(reader.getString()); + } else if ("classifyAs".equals(fieldName)) { + deserializedMicrosoftGraphInferenceClassificationOverride.classifyAs + = MicrosoftGraphInferenceClassificationType.fromString(reader.getString()); + } else if ("senderEmailAddress".equals(fieldName)) { + deserializedMicrosoftGraphInferenceClassificationOverride.senderEmailAddress + = MicrosoftGraphEmailAddress.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphInferenceClassificationOverride.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphInferenceClassificationOverride; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassificationType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassificationType.java index 5330fbc243e76..b88ed33160a2c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassificationType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInferenceClassificationType.java @@ -5,21 +5,26 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** inferenceClassificationType. */ +/** + * inferenceClassificationType. + */ public final class MicrosoftGraphInferenceClassificationType extends ExpandableStringEnum { - /** Static value focused for MicrosoftGraphInferenceClassificationType. */ + /** + * Static value focused for MicrosoftGraphInferenceClassificationType. + */ public static final MicrosoftGraphInferenceClassificationType FOCUSED = fromString("focused"); - /** Static value other for MicrosoftGraphInferenceClassificationType. */ + /** + * Static value other for MicrosoftGraphInferenceClassificationType. + */ public static final MicrosoftGraphInferenceClassificationType OTHER = fromString("other"); /** * Creates a new instance of MicrosoftGraphInferenceClassificationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +33,17 @@ public MicrosoftGraphInferenceClassificationType() { /** * Creates or finds a MicrosoftGraphInferenceClassificationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphInferenceClassificationType. */ - @JsonCreator public static MicrosoftGraphInferenceClassificationType fromString(String name) { return fromString(name, MicrosoftGraphInferenceClassificationType.class); } /** * Gets known MicrosoftGraphInferenceClassificationType values. - * + * * @return known MicrosoftGraphInferenceClassificationType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInformationalUrl.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInformationalUrl.java index d0f21a71dd0d4..045f58ecf10aa 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInformationalUrl.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInformationalUrl.java @@ -5,58 +5,58 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** informationalUrl. */ +/** + * informationalUrl. + */ @Fluent -public final class MicrosoftGraphInformationalUrl { +public final class MicrosoftGraphInformationalUrl implements JsonSerializable { /* * CDN URL to the application's logo, Read-only. */ - @JsonProperty(value = "logoUrl") private String logoUrl; /* * Link to the application's marketing page. For example, https://www.contoso.com/app/marketing */ - @JsonProperty(value = "marketingUrl") private String marketingUrl; /* * Link to the application's privacy statement. For example, https://www.contoso.com/app/privacy */ - @JsonProperty(value = "privacyStatementUrl") private String privacyStatementUrl; /* * Link to the application's support page. For example, https://www.contoso.com/app/support */ - @JsonProperty(value = "supportUrl") private String supportUrl; /* * Link to the application's terms of service statement. For example, https://www.contoso.com/app/termsofservice */ - @JsonProperty(value = "termsOfServiceUrl") private String termsOfServiceUrl; /* * informationalUrl */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphInformationalUrl class. */ + /** + * Creates an instance of MicrosoftGraphInformationalUrl class. + */ public MicrosoftGraphInformationalUrl() { } /** * Get the logoUrl property: CDN URL to the application's logo, Read-only. - * + * * @return the logoUrl value. */ public String logoUrl() { @@ -65,7 +65,7 @@ public String logoUrl() { /** * Set the logoUrl property: CDN URL to the application's logo, Read-only. - * + * * @param logoUrl the logoUrl value to set. * @return the MicrosoftGraphInformationalUrl object itself. */ @@ -77,7 +77,7 @@ public MicrosoftGraphInformationalUrl withLogoUrl(String logoUrl) { /** * Get the marketingUrl property: Link to the application's marketing page. For example, * https://www.contoso.com/app/marketing. - * + * * @return the marketingUrl value. */ public String marketingUrl() { @@ -87,7 +87,7 @@ public String marketingUrl() { /** * Set the marketingUrl property: Link to the application's marketing page. For example, * https://www.contoso.com/app/marketing. - * + * * @param marketingUrl the marketingUrl value to set. * @return the MicrosoftGraphInformationalUrl object itself. */ @@ -99,7 +99,7 @@ public MicrosoftGraphInformationalUrl withMarketingUrl(String marketingUrl) { /** * Get the privacyStatementUrl property: Link to the application's privacy statement. For example, * https://www.contoso.com/app/privacy. - * + * * @return the privacyStatementUrl value. */ public String privacyStatementUrl() { @@ -109,7 +109,7 @@ public String privacyStatementUrl() { /** * Set the privacyStatementUrl property: Link to the application's privacy statement. For example, * https://www.contoso.com/app/privacy. - * + * * @param privacyStatementUrl the privacyStatementUrl value to set. * @return the MicrosoftGraphInformationalUrl object itself. */ @@ -121,7 +121,7 @@ public MicrosoftGraphInformationalUrl withPrivacyStatementUrl(String privacyStat /** * Get the supportUrl property: Link to the application's support page. For example, * https://www.contoso.com/app/support. - * + * * @return the supportUrl value. */ public String supportUrl() { @@ -131,7 +131,7 @@ public String supportUrl() { /** * Set the supportUrl property: Link to the application's support page. For example, * https://www.contoso.com/app/support. - * + * * @param supportUrl the supportUrl value to set. * @return the MicrosoftGraphInformationalUrl object itself. */ @@ -143,7 +143,7 @@ public MicrosoftGraphInformationalUrl withSupportUrl(String supportUrl) { /** * Get the termsOfServiceUrl property: Link to the application's terms of service statement. For example, * https://www.contoso.com/app/termsofservice. - * + * * @return the termsOfServiceUrl value. */ public String termsOfServiceUrl() { @@ -153,7 +153,7 @@ public String termsOfServiceUrl() { /** * Set the termsOfServiceUrl property: Link to the application's terms of service statement. For example, * https://www.contoso.com/app/termsofservice. - * + * * @param termsOfServiceUrl the termsOfServiceUrl value to set. * @return the MicrosoftGraphInformationalUrl object itself. */ @@ -164,17 +164,16 @@ public MicrosoftGraphInformationalUrl withTermsOfServiceUrl(String termsOfServic /** * Get the additionalProperties property: informationalUrl. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: informationalUrl. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphInformationalUrl object itself. */ @@ -183,19 +182,71 @@ public MicrosoftGraphInformationalUrl withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("logoUrl", this.logoUrl); + jsonWriter.writeStringField("marketingUrl", this.marketingUrl); + jsonWriter.writeStringField("privacyStatementUrl", this.privacyStatementUrl); + jsonWriter.writeStringField("supportUrl", this.supportUrl); + jsonWriter.writeStringField("termsOfServiceUrl", this.termsOfServiceUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphInformationalUrl from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphInformationalUrl 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 MicrosoftGraphInformationalUrl. + */ + public static MicrosoftGraphInformationalUrl fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphInformationalUrl deserializedMicrosoftGraphInformationalUrl + = new MicrosoftGraphInformationalUrl(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logoUrl".equals(fieldName)) { + deserializedMicrosoftGraphInformationalUrl.logoUrl = reader.getString(); + } else if ("marketingUrl".equals(fieldName)) { + deserializedMicrosoftGraphInformationalUrl.marketingUrl = reader.getString(); + } else if ("privacyStatementUrl".equals(fieldName)) { + deserializedMicrosoftGraphInformationalUrl.privacyStatementUrl = reader.getString(); + } else if ("supportUrl".equals(fieldName)) { + deserializedMicrosoftGraphInformationalUrl.supportUrl = reader.getString(); + } else if ("termsOfServiceUrl".equals(fieldName)) { + deserializedMicrosoftGraphInformationalUrl.termsOfServiceUrl = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphInformationalUrl.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphInformationalUrl; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInsightIdentity.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInsightIdentity.java index 7f87318e3f404..19cacb3e3dadb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInsightIdentity.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInsightIdentity.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** insightIdentity. */ +/** + * insightIdentity. + */ @Fluent -public final class MicrosoftGraphInsightIdentity { +public final class MicrosoftGraphInsightIdentity implements JsonSerializable { /* * The email address of the user who shared the item. */ - @JsonProperty(value = "address") private String address; /* * The display name of the user who shared the item. */ - @JsonProperty(value = "displayName") private String displayName; /* * The id of the user who shared the item. */ - @JsonProperty(value = "id") private String id; /* * insightIdentity */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphInsightIdentity class. */ + /** + * Creates an instance of MicrosoftGraphInsightIdentity class. + */ public MicrosoftGraphInsightIdentity() { } /** * Get the address property: The email address of the user who shared the item. - * + * * @return the address value. */ public String address() { @@ -53,7 +55,7 @@ public String address() { /** * Set the address property: The email address of the user who shared the item. - * + * * @param address the address value to set. * @return the MicrosoftGraphInsightIdentity object itself. */ @@ -64,7 +66,7 @@ public MicrosoftGraphInsightIdentity withAddress(String address) { /** * Get the displayName property: The display name of the user who shared the item. - * + * * @return the displayName value. */ public String displayName() { @@ -73,7 +75,7 @@ public String displayName() { /** * Set the displayName property: The display name of the user who shared the item. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphInsightIdentity object itself. */ @@ -84,7 +86,7 @@ public MicrosoftGraphInsightIdentity withDisplayName(String displayName) { /** * Get the id property: The id of the user who shared the item. - * + * * @return the id value. */ public String id() { @@ -93,7 +95,7 @@ public String id() { /** * Set the id property: The id of the user who shared the item. - * + * * @param id the id value to set. * @return the MicrosoftGraphInsightIdentity object itself. */ @@ -104,17 +106,16 @@ public MicrosoftGraphInsightIdentity withId(String id) { /** * Get the additionalProperties property: insightIdentity. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: insightIdentity. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphInsightIdentity object itself. */ @@ -123,19 +124,65 @@ public MicrosoftGraphInsightIdentity withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("id", this.id); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphInsightIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphInsightIdentity 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 MicrosoftGraphInsightIdentity. + */ + public static MicrosoftGraphInsightIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphInsightIdentity deserializedMicrosoftGraphInsightIdentity + = new MicrosoftGraphInsightIdentity(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedMicrosoftGraphInsightIdentity.address = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphInsightIdentity.displayName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMicrosoftGraphInsightIdentity.id = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphInsightIdentity.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphInsightIdentity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInternetMessageHeader.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInternetMessageHeader.java index 828f7d4321bb7..4fded1357e9e9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInternetMessageHeader.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphInternetMessageHeader.java @@ -5,40 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** internetMessageHeader. */ +/** + * internetMessageHeader. + */ @Fluent -public final class MicrosoftGraphInternetMessageHeader { +public final class MicrosoftGraphInternetMessageHeader + implements JsonSerializable { /* * Represents the key in a key-value pair. */ - @JsonProperty(value = "name") private String name; /* * The value in a key-value pair. */ - @JsonProperty(value = "value") private String value; /* * internetMessageHeader */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphInternetMessageHeader class. */ + /** + * Creates an instance of MicrosoftGraphInternetMessageHeader class. + */ public MicrosoftGraphInternetMessageHeader() { } /** * Get the name property: Represents the key in a key-value pair. - * + * * @return the name value. */ public String name() { @@ -47,7 +51,7 @@ public String name() { /** * Set the name property: Represents the key in a key-value pair. - * + * * @param name the name value to set. * @return the MicrosoftGraphInternetMessageHeader object itself. */ @@ -58,7 +62,7 @@ public MicrosoftGraphInternetMessageHeader withName(String name) { /** * Get the value property: The value in a key-value pair. - * + * * @return the value value. */ public String value() { @@ -67,7 +71,7 @@ public String value() { /** * Set the value property: The value in a key-value pair. - * + * * @param value the value value to set. * @return the MicrosoftGraphInternetMessageHeader object itself. */ @@ -78,17 +82,16 @@ public MicrosoftGraphInternetMessageHeader withValue(String value) { /** * Get the additionalProperties property: internetMessageHeader. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: internetMessageHeader. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphInternetMessageHeader object itself. */ @@ -97,19 +100,62 @@ public MicrosoftGraphInternetMessageHeader withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphInternetMessageHeader from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphInternetMessageHeader 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 MicrosoftGraphInternetMessageHeader. + */ + public static MicrosoftGraphInternetMessageHeader fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphInternetMessageHeader deserializedMicrosoftGraphInternetMessageHeader + = new MicrosoftGraphInternetMessageHeader(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMicrosoftGraphInternetMessageHeader.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedMicrosoftGraphInternetMessageHeader.value = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphInternetMessageHeader.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphInternetMessageHeader; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActionStat.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActionStat.java index cc5545835aa7f..898c633a82822 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActionStat.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActionStat.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** itemActionStat. */ +/** + * itemActionStat. + */ @Fluent -public final class MicrosoftGraphItemActionStat { +public final class MicrosoftGraphItemActionStat implements JsonSerializable { /* * The number of times the action took place. Read-only. */ - @JsonProperty(value = "actionCount") private Integer actionCount; /* * The number of distinct actors that performed the action. Read-only. */ - @JsonProperty(value = "actorCount") private Integer actorCount; /* * itemActionStat */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphItemActionStat class. */ + /** + * Creates an instance of MicrosoftGraphItemActionStat class. + */ public MicrosoftGraphItemActionStat() { } /** * Get the actionCount property: The number of times the action took place. Read-only. - * + * * @return the actionCount value. */ public Integer actionCount() { @@ -47,7 +50,7 @@ public Integer actionCount() { /** * Set the actionCount property: The number of times the action took place. Read-only. - * + * * @param actionCount the actionCount value to set. * @return the MicrosoftGraphItemActionStat object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphItemActionStat withActionCount(Integer actionCount) { /** * Get the actorCount property: The number of distinct actors that performed the action. Read-only. - * + * * @return the actorCount value. */ public Integer actorCount() { @@ -67,7 +70,7 @@ public Integer actorCount() { /** * Set the actorCount property: The number of distinct actors that performed the action. Read-only. - * + * * @param actorCount the actorCount value to set. * @return the MicrosoftGraphItemActionStat object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphItemActionStat withActorCount(Integer actorCount) { /** * Get the additionalProperties property: itemActionStat. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: itemActionStat. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphItemActionStat object itself. */ @@ -97,19 +99,61 @@ public MicrosoftGraphItemActionStat withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("actionCount", this.actionCount); + jsonWriter.writeNumberField("actorCount", this.actorCount); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphItemActionStat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphItemActionStat 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 MicrosoftGraphItemActionStat. + */ + public static MicrosoftGraphItemActionStat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphItemActionStat deserializedMicrosoftGraphItemActionStat = new MicrosoftGraphItemActionStat(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actionCount".equals(fieldName)) { + deserializedMicrosoftGraphItemActionStat.actionCount = reader.getNullable(JsonReader::getInt); + } else if ("actorCount".equals(fieldName)) { + deserializedMicrosoftGraphItemActionStat.actorCount = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphItemActionStat.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphItemActionStat; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActivity.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActivity.java index 37350dc9247cf..2417e9df3c4bd 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActivity.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActivity.java @@ -5,55 +5,55 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** itemActivity. */ +/** + * itemActivity. + */ @Fluent public final class MicrosoftGraphItemActivity extends MicrosoftGraphEntity { /* * accessAction */ - @JsonProperty(value = "access") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map access; /* * Details about when the activity took place. Read-only. */ - @JsonProperty(value = "activityDateTime") private OffsetDateTime activityDateTime; /* * identitySet */ - @JsonProperty(value = "actor") private MicrosoftGraphIdentitySet actor; /* * driveItem */ - @JsonProperty(value = "driveItem") private MicrosoftGraphDriveItem driveItem; /* * itemActivity */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphItemActivity class. */ + /** + * Creates an instance of MicrosoftGraphItemActivity class. + */ public MicrosoftGraphItemActivity() { } /** * Get the access property: accessAction. - * + * * @return the access value. */ public Map access() { @@ -62,7 +62,7 @@ public Map access() { /** * Set the access property: accessAction. - * + * * @param access the access value to set. * @return the MicrosoftGraphItemActivity object itself. */ @@ -73,7 +73,7 @@ public MicrosoftGraphItemActivity withAccess(Map access) { /** * Get the activityDateTime property: Details about when the activity took place. Read-only. - * + * * @return the activityDateTime value. */ public OffsetDateTime activityDateTime() { @@ -82,7 +82,7 @@ public OffsetDateTime activityDateTime() { /** * Set the activityDateTime property: Details about when the activity took place. Read-only. - * + * * @param activityDateTime the activityDateTime value to set. * @return the MicrosoftGraphItemActivity object itself. */ @@ -93,7 +93,7 @@ public MicrosoftGraphItemActivity withActivityDateTime(OffsetDateTime activityDa /** * Get the actor property: identitySet. - * + * * @return the actor value. */ public MicrosoftGraphIdentitySet actor() { @@ -102,7 +102,7 @@ public MicrosoftGraphIdentitySet actor() { /** * Set the actor property: identitySet. - * + * * @param actor the actor value to set. * @return the MicrosoftGraphItemActivity object itself. */ @@ -113,7 +113,7 @@ public MicrosoftGraphItemActivity withActor(MicrosoftGraphIdentitySet actor) { /** * Get the driveItem property: driveItem. - * + * * @return the driveItem value. */ public MicrosoftGraphDriveItem driveItem() { @@ -122,7 +122,7 @@ public MicrosoftGraphDriveItem driveItem() { /** * Set the driveItem property: driveItem. - * + * * @param driveItem the driveItem value to set. * @return the MicrosoftGraphItemActivity object itself. */ @@ -133,17 +133,16 @@ public MicrosoftGraphItemActivity withDriveItem(MicrosoftGraphDriveItem driveIte /** * Get the additionalProperties property: itemActivity. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: itemActivity. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphItemActivity object itself. */ @@ -152,15 +151,9 @@ public MicrosoftGraphItemActivity withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphItemActivity withId(String id) { super.withId(id); @@ -169,7 +162,7 @@ public MicrosoftGraphItemActivity withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -182,4 +175,68 @@ public void validate() { driveItem().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeMapField("access", this.access, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("activityDateTime", + this.activityDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.activityDateTime)); + jsonWriter.writeJsonField("actor", this.actor); + jsonWriter.writeJsonField("driveItem", this.driveItem); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphItemActivity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphItemActivity 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 MicrosoftGraphItemActivity. + */ + public static MicrosoftGraphItemActivity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphItemActivity deserializedMicrosoftGraphItemActivity = new MicrosoftGraphItemActivity(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphItemActivity.withId(reader.getString()); + } else if ("access".equals(fieldName)) { + Map access = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphItemActivity.access = access; + } else if ("activityDateTime".equals(fieldName)) { + deserializedMicrosoftGraphItemActivity.activityDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("actor".equals(fieldName)) { + deserializedMicrosoftGraphItemActivity.actor = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("driveItem".equals(fieldName)) { + deserializedMicrosoftGraphItemActivity.driveItem = MicrosoftGraphDriveItem.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphItemActivity.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphItemActivity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActivityStat.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActivityStat.java index 686e9010cca41..eeb776896e071 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActivityStat.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemActivityStat.java @@ -5,90 +5,86 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** itemActivityStat. */ +/** + * itemActivityStat. + */ @Fluent public final class MicrosoftGraphItemActivityStat extends MicrosoftGraphEntity { /* * itemActionStat */ - @JsonProperty(value = "access") private MicrosoftGraphItemActionStat access; /* * itemActionStat */ - @JsonProperty(value = "create") private MicrosoftGraphItemActionStat create; /* * itemActionStat */ - @JsonProperty(value = "delete") private MicrosoftGraphItemActionStat delete; /* * itemActionStat */ - @JsonProperty(value = "edit") private MicrosoftGraphItemActionStat edit; /* * When the interval ends. Read-only. */ - @JsonProperty(value = "endDateTime") private OffsetDateTime endDateTime; /* * incompleteData */ - @JsonProperty(value = "incompleteData") private MicrosoftGraphIncompleteData incompleteData; /* * Indicates whether the item is 'trending.' Read-only. */ - @JsonProperty(value = "isTrending") private Boolean isTrending; /* * itemActionStat */ - @JsonProperty(value = "move") private MicrosoftGraphItemActionStat move; /* * When the interval starts. Read-only. */ - @JsonProperty(value = "startDateTime") private OffsetDateTime startDateTime; /* * Exposes the itemActivities represented in this itemActivityStat resource. */ - @JsonProperty(value = "activities") private List activities; /* * itemActivityStat */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphItemActivityStat class. */ + /** + * Creates an instance of MicrosoftGraphItemActivityStat class. + */ public MicrosoftGraphItemActivityStat() { } /** * Get the access property: itemActionStat. - * + * * @return the access value. */ public MicrosoftGraphItemActionStat access() { @@ -97,7 +93,7 @@ public MicrosoftGraphItemActionStat access() { /** * Set the access property: itemActionStat. - * + * * @param access the access value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -108,7 +104,7 @@ public MicrosoftGraphItemActivityStat withAccess(MicrosoftGraphItemActionStat ac /** * Get the create property: itemActionStat. - * + * * @return the create value. */ public MicrosoftGraphItemActionStat create() { @@ -117,7 +113,7 @@ public MicrosoftGraphItemActionStat create() { /** * Set the create property: itemActionStat. - * + * * @param create the create value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -128,7 +124,7 @@ public MicrosoftGraphItemActivityStat withCreate(MicrosoftGraphItemActionStat cr /** * Get the delete property: itemActionStat. - * + * * @return the delete value. */ public MicrosoftGraphItemActionStat delete() { @@ -137,7 +133,7 @@ public MicrosoftGraphItemActionStat delete() { /** * Set the delete property: itemActionStat. - * + * * @param delete the delete value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -148,7 +144,7 @@ public MicrosoftGraphItemActivityStat withDelete(MicrosoftGraphItemActionStat de /** * Get the edit property: itemActionStat. - * + * * @return the edit value. */ public MicrosoftGraphItemActionStat edit() { @@ -157,7 +153,7 @@ public MicrosoftGraphItemActionStat edit() { /** * Set the edit property: itemActionStat. - * + * * @param edit the edit value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -168,7 +164,7 @@ public MicrosoftGraphItemActivityStat withEdit(MicrosoftGraphItemActionStat edit /** * Get the endDateTime property: When the interval ends. Read-only. - * + * * @return the endDateTime value. */ public OffsetDateTime endDateTime() { @@ -177,7 +173,7 @@ public OffsetDateTime endDateTime() { /** * Set the endDateTime property: When the interval ends. Read-only. - * + * * @param endDateTime the endDateTime value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -188,7 +184,7 @@ public MicrosoftGraphItemActivityStat withEndDateTime(OffsetDateTime endDateTime /** * Get the incompleteData property: incompleteData. - * + * * @return the incompleteData value. */ public MicrosoftGraphIncompleteData incompleteData() { @@ -197,7 +193,7 @@ public MicrosoftGraphIncompleteData incompleteData() { /** * Set the incompleteData property: incompleteData. - * + * * @param incompleteData the incompleteData value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -208,7 +204,7 @@ public MicrosoftGraphItemActivityStat withIncompleteData(MicrosoftGraphIncomplet /** * Get the isTrending property: Indicates whether the item is 'trending.' Read-only. - * + * * @return the isTrending value. */ public Boolean isTrending() { @@ -217,7 +213,7 @@ public Boolean isTrending() { /** * Set the isTrending property: Indicates whether the item is 'trending.' Read-only. - * + * * @param isTrending the isTrending value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -228,7 +224,7 @@ public MicrosoftGraphItemActivityStat withIsTrending(Boolean isTrending) { /** * Get the move property: itemActionStat. - * + * * @return the move value. */ public MicrosoftGraphItemActionStat move() { @@ -237,7 +233,7 @@ public MicrosoftGraphItemActionStat move() { /** * Set the move property: itemActionStat. - * + * * @param move the move value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -248,7 +244,7 @@ public MicrosoftGraphItemActivityStat withMove(MicrosoftGraphItemActionStat move /** * Get the startDateTime property: When the interval starts. Read-only. - * + * * @return the startDateTime value. */ public OffsetDateTime startDateTime() { @@ -257,7 +253,7 @@ public OffsetDateTime startDateTime() { /** * Set the startDateTime property: When the interval starts. Read-only. - * + * * @param startDateTime the startDateTime value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -268,7 +264,7 @@ public MicrosoftGraphItemActivityStat withStartDateTime(OffsetDateTime startDate /** * Get the activities property: Exposes the itemActivities represented in this itemActivityStat resource. - * + * * @return the activities value. */ public List activities() { @@ -277,7 +273,7 @@ public List activities() { /** * Set the activities property: Exposes the itemActivities represented in this itemActivityStat resource. - * + * * @param activities the activities value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -288,17 +284,16 @@ public MicrosoftGraphItemActivityStat withActivities(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: itemActivityStat. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphItemActivityStat object itself. */ @@ -307,15 +302,9 @@ public MicrosoftGraphItemActivityStat withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphItemActivityStat withId(String id) { super.withId(id); @@ -324,7 +313,7 @@ public MicrosoftGraphItemActivityStat withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -352,4 +341,89 @@ public void validate() { activities().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("access", this.access); + jsonWriter.writeJsonField("create", this.create); + jsonWriter.writeJsonField("delete", this.delete); + jsonWriter.writeJsonField("edit", this.edit); + jsonWriter.writeStringField("endDateTime", + this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime)); + jsonWriter.writeJsonField("incompleteData", this.incompleteData); + jsonWriter.writeBooleanField("isTrending", this.isTrending); + jsonWriter.writeJsonField("move", this.move); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + jsonWriter.writeArrayField("activities", this.activities, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphItemActivityStat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphItemActivityStat 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 MicrosoftGraphItemActivityStat. + */ + public static MicrosoftGraphItemActivityStat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphItemActivityStat deserializedMicrosoftGraphItemActivityStat + = new MicrosoftGraphItemActivityStat(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphItemActivityStat.withId(reader.getString()); + } else if ("access".equals(fieldName)) { + deserializedMicrosoftGraphItemActivityStat.access = MicrosoftGraphItemActionStat.fromJson(reader); + } else if ("create".equals(fieldName)) { + deserializedMicrosoftGraphItemActivityStat.create = MicrosoftGraphItemActionStat.fromJson(reader); + } else if ("delete".equals(fieldName)) { + deserializedMicrosoftGraphItemActivityStat.delete = MicrosoftGraphItemActionStat.fromJson(reader); + } else if ("edit".equals(fieldName)) { + deserializedMicrosoftGraphItemActivityStat.edit = MicrosoftGraphItemActionStat.fromJson(reader); + } else if ("endDateTime".equals(fieldName)) { + deserializedMicrosoftGraphItemActivityStat.endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("incompleteData".equals(fieldName)) { + deserializedMicrosoftGraphItemActivityStat.incompleteData + = MicrosoftGraphIncompleteData.fromJson(reader); + } else if ("isTrending".equals(fieldName)) { + deserializedMicrosoftGraphItemActivityStat.isTrending = reader.getNullable(JsonReader::getBoolean); + } else if ("move".equals(fieldName)) { + deserializedMicrosoftGraphItemActivityStat.move = MicrosoftGraphItemActionStat.fromJson(reader); + } else if ("startDateTime".equals(fieldName)) { + deserializedMicrosoftGraphItemActivityStat.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("activities".equals(fieldName)) { + List activities + = reader.readArray(reader1 -> MicrosoftGraphItemActivity.fromJson(reader1)); + deserializedMicrosoftGraphItemActivityStat.activities = activities; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphItemActivityStat.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphItemActivityStat; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemAnalytics.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemAnalytics.java index b967bd12120fb..b55c04c514b55 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemAnalytics.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemAnalytics.java @@ -5,47 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** itemAnalytics. */ +/** + * itemAnalytics. + */ @Fluent public final class MicrosoftGraphItemAnalytics extends MicrosoftGraphEntity { /* * itemActivityStat */ - @JsonProperty(value = "allTime") private MicrosoftGraphItemActivityStat allTime; /* * The itemActivityStats property. */ - @JsonProperty(value = "itemActivityStats") private List itemActivityStats; /* * itemActivityStat */ - @JsonProperty(value = "lastSevenDays") private MicrosoftGraphItemActivityStat lastSevenDays; /* * itemAnalytics */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphItemAnalytics class. */ + /** + * Creates an instance of MicrosoftGraphItemAnalytics class. + */ public MicrosoftGraphItemAnalytics() { } /** * Get the allTime property: itemActivityStat. - * + * * @return the allTime value. */ public MicrosoftGraphItemActivityStat allTime() { @@ -54,7 +55,7 @@ public MicrosoftGraphItemActivityStat allTime() { /** * Set the allTime property: itemActivityStat. - * + * * @param allTime the allTime value to set. * @return the MicrosoftGraphItemAnalytics object itself. */ @@ -65,7 +66,7 @@ public MicrosoftGraphItemAnalytics withAllTime(MicrosoftGraphItemActivityStat al /** * Get the itemActivityStats property: The itemActivityStats property. - * + * * @return the itemActivityStats value. */ public List itemActivityStats() { @@ -74,7 +75,7 @@ public List itemActivityStats() { /** * Set the itemActivityStats property: The itemActivityStats property. - * + * * @param itemActivityStats the itemActivityStats value to set. * @return the MicrosoftGraphItemAnalytics object itself. */ @@ -85,7 +86,7 @@ public MicrosoftGraphItemAnalytics withItemActivityStats(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: itemAnalytics. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphItemAnalytics object itself. */ @@ -124,15 +124,9 @@ public MicrosoftGraphItemAnalytics withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphItemAnalytics withId(String id) { super.withId(id); @@ -141,7 +135,7 @@ public MicrosoftGraphItemAnalytics withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -157,4 +151,64 @@ public void validate() { lastSevenDays().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("allTime", this.allTime); + jsonWriter.writeArrayField("itemActivityStats", this.itemActivityStats, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("lastSevenDays", this.lastSevenDays); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphItemAnalytics from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphItemAnalytics 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 MicrosoftGraphItemAnalytics. + */ + public static MicrosoftGraphItemAnalytics fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphItemAnalytics deserializedMicrosoftGraphItemAnalytics = new MicrosoftGraphItemAnalytics(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphItemAnalytics.withId(reader.getString()); + } else if ("allTime".equals(fieldName)) { + deserializedMicrosoftGraphItemAnalytics.allTime = MicrosoftGraphItemActivityStat.fromJson(reader); + } else if ("itemActivityStats".equals(fieldName)) { + List itemActivityStats + = reader.readArray(reader1 -> MicrosoftGraphItemActivityStat.fromJson(reader1)); + deserializedMicrosoftGraphItemAnalytics.itemActivityStats = itemActivityStats; + } else if ("lastSevenDays".equals(fieldName)) { + deserializedMicrosoftGraphItemAnalytics.lastSevenDays + = MicrosoftGraphItemActivityStat.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphItemAnalytics.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphItemAnalytics; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemBody.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemBody.java index 60cb1379779a0..1456cc73060ce 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemBody.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemBody.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** itemBody. */ +/** + * itemBody. + */ @Fluent -public final class MicrosoftGraphItemBody { +public final class MicrosoftGraphItemBody implements JsonSerializable { /* * The content of the item. */ - @JsonProperty(value = "content") private String content; /* * bodyType */ - @JsonProperty(value = "contentType") private MicrosoftGraphBodyType contentType; /* * itemBody */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphItemBody class. */ + /** + * Creates an instance of MicrosoftGraphItemBody class. + */ public MicrosoftGraphItemBody() { } /** * Get the content property: The content of the item. - * + * * @return the content value. */ public String content() { @@ -47,7 +50,7 @@ public String content() { /** * Set the content property: The content of the item. - * + * * @param content the content value to set. * @return the MicrosoftGraphItemBody object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphItemBody withContent(String content) { /** * Get the contentType property: bodyType. - * + * * @return the contentType value. */ public MicrosoftGraphBodyType contentType() { @@ -67,7 +70,7 @@ public MicrosoftGraphBodyType contentType() { /** * Set the contentType property: bodyType. - * + * * @param contentType the contentType value to set. * @return the MicrosoftGraphItemBody object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphItemBody withContentType(MicrosoftGraphBodyType contentType /** * Get the additionalProperties property: itemBody. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: itemBody. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphItemBody object itself. */ @@ -97,19 +99,62 @@ public MicrosoftGraphItemBody withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("contentType", this.contentType == null ? null : this.contentType.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphItemBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphItemBody 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 MicrosoftGraphItemBody. + */ + public static MicrosoftGraphItemBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphItemBody deserializedMicrosoftGraphItemBody = new MicrosoftGraphItemBody(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + deserializedMicrosoftGraphItemBody.content = reader.getString(); + } else if ("contentType".equals(fieldName)) { + deserializedMicrosoftGraphItemBody.contentType + = MicrosoftGraphBodyType.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphItemBody.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphItemBody; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemReference.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemReference.java index e215c9af8d3fa..35df52551d56a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemReference.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphItemReference.java @@ -5,76 +5,73 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** itemReference. */ +/** + * itemReference. + */ @Fluent -public final class MicrosoftGraphItemReference { +public final class MicrosoftGraphItemReference implements JsonSerializable { /* * Unique identifier of the drive instance that contains the item. Read-only. */ - @JsonProperty(value = "driveId") private String driveId; /* * Identifies the type of drive. See [drive][] resource for values. */ - @JsonProperty(value = "driveType") private String driveType; /* * Unique identifier of the item in the drive. Read-only. */ - @JsonProperty(value = "id") private String id; /* * The name of the item being referenced. Read-only. */ - @JsonProperty(value = "name") private String name; /* * Path that can be used to navigate to the item. Read-only. */ - @JsonProperty(value = "path") private String path; /* * A unique identifier for a shared resource that can be accessed via the [Shares][] API. */ - @JsonProperty(value = "shareId") private String shareId; /* * sharepointIds */ - @JsonProperty(value = "sharepointIds") private MicrosoftGraphSharepointIds sharepointIds; /* * The siteId property. */ - @JsonProperty(value = "siteId") private String siteId; /* * itemReference */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphItemReference class. */ + /** + * Creates an instance of MicrosoftGraphItemReference class. + */ public MicrosoftGraphItemReference() { } /** * Get the driveId property: Unique identifier of the drive instance that contains the item. Read-only. - * + * * @return the driveId value. */ public String driveId() { @@ -83,7 +80,7 @@ public String driveId() { /** * Set the driveId property: Unique identifier of the drive instance that contains the item. Read-only. - * + * * @param driveId the driveId value to set. * @return the MicrosoftGraphItemReference object itself. */ @@ -94,7 +91,7 @@ public MicrosoftGraphItemReference withDriveId(String driveId) { /** * Get the driveType property: Identifies the type of drive. See [drive][] resource for values. - * + * * @return the driveType value. */ public String driveType() { @@ -103,7 +100,7 @@ public String driveType() { /** * Set the driveType property: Identifies the type of drive. See [drive][] resource for values. - * + * * @param driveType the driveType value to set. * @return the MicrosoftGraphItemReference object itself. */ @@ -114,7 +111,7 @@ public MicrosoftGraphItemReference withDriveType(String driveType) { /** * Get the id property: Unique identifier of the item in the drive. Read-only. - * + * * @return the id value. */ public String id() { @@ -123,7 +120,7 @@ public String id() { /** * Set the id property: Unique identifier of the item in the drive. Read-only. - * + * * @param id the id value to set. * @return the MicrosoftGraphItemReference object itself. */ @@ -134,7 +131,7 @@ public MicrosoftGraphItemReference withId(String id) { /** * Get the name property: The name of the item being referenced. Read-only. - * + * * @return the name value. */ public String name() { @@ -143,7 +140,7 @@ public String name() { /** * Set the name property: The name of the item being referenced. Read-only. - * + * * @param name the name value to set. * @return the MicrosoftGraphItemReference object itself. */ @@ -154,7 +151,7 @@ public MicrosoftGraphItemReference withName(String name) { /** * Get the path property: Path that can be used to navigate to the item. Read-only. - * + * * @return the path value. */ public String path() { @@ -163,7 +160,7 @@ public String path() { /** * Set the path property: Path that can be used to navigate to the item. Read-only. - * + * * @param path the path value to set. * @return the MicrosoftGraphItemReference object itself. */ @@ -174,7 +171,7 @@ public MicrosoftGraphItemReference withPath(String path) { /** * Get the shareId property: A unique identifier for a shared resource that can be accessed via the [Shares][] API. - * + * * @return the shareId value. */ public String shareId() { @@ -183,7 +180,7 @@ public String shareId() { /** * Set the shareId property: A unique identifier for a shared resource that can be accessed via the [Shares][] API. - * + * * @param shareId the shareId value to set. * @return the MicrosoftGraphItemReference object itself. */ @@ -194,7 +191,7 @@ public MicrosoftGraphItemReference withShareId(String shareId) { /** * Get the sharepointIds property: sharepointIds. - * + * * @return the sharepointIds value. */ public MicrosoftGraphSharepointIds sharepointIds() { @@ -203,7 +200,7 @@ public MicrosoftGraphSharepointIds sharepointIds() { /** * Set the sharepointIds property: sharepointIds. - * + * * @param sharepointIds the sharepointIds value to set. * @return the MicrosoftGraphItemReference object itself. */ @@ -214,7 +211,7 @@ public MicrosoftGraphItemReference withSharepointIds(MicrosoftGraphSharepointIds /** * Get the siteId property: The siteId property. - * + * * @return the siteId value. */ public String siteId() { @@ -223,7 +220,7 @@ public String siteId() { /** * Set the siteId property: The siteId property. - * + * * @param siteId the siteId value to set. * @return the MicrosoftGraphItemReference object itself. */ @@ -234,17 +231,16 @@ public MicrosoftGraphItemReference withSiteId(String siteId) { /** * Get the additionalProperties property: itemReference. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: itemReference. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphItemReference object itself. */ @@ -253,17 +249,9 @@ public MicrosoftGraphItemReference withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -271,4 +259,73 @@ public void validate() { sharepointIds().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("driveId", this.driveId); + jsonWriter.writeStringField("driveType", this.driveType); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("shareId", this.shareId); + jsonWriter.writeJsonField("sharepointIds", this.sharepointIds); + jsonWriter.writeStringField("siteId", this.siteId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphItemReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphItemReference 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 MicrosoftGraphItemReference. + */ + public static MicrosoftGraphItemReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphItemReference deserializedMicrosoftGraphItemReference = new MicrosoftGraphItemReference(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("driveId".equals(fieldName)) { + deserializedMicrosoftGraphItemReference.driveId = reader.getString(); + } else if ("driveType".equals(fieldName)) { + deserializedMicrosoftGraphItemReference.driveType = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMicrosoftGraphItemReference.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphItemReference.name = reader.getString(); + } else if ("path".equals(fieldName)) { + deserializedMicrosoftGraphItemReference.path = reader.getString(); + } else if ("shareId".equals(fieldName)) { + deserializedMicrosoftGraphItemReference.shareId = reader.getString(); + } else if ("sharepointIds".equals(fieldName)) { + deserializedMicrosoftGraphItemReference.sharepointIds + = MicrosoftGraphSharepointIds.fromJson(reader); + } else if ("siteId".equals(fieldName)) { + deserializedMicrosoftGraphItemReference.siteId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphItemReference.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphItemReference; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphKeyCredentialInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphKeyCredentialInner.java index 7fd951f220067..c283878f15065 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphKeyCredentialInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphKeyCredentialInner.java @@ -7,30 +7,33 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.Base64Url; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** keyCredential. */ +/** + * keyCredential. + */ @Fluent -public final class MicrosoftGraphKeyCredentialInner { +public final class MicrosoftGraphKeyCredentialInner implements JsonSerializable { private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; /* * Custom key identifier */ - @JsonProperty(value = "customKeyIdentifier") private Base64Url customKeyIdentifier; /* * Friendly name for the key. Optional. */ - @JsonProperty(value = "displayName") private String displayName; /* @@ -38,20 +41,17 @@ public final class MicrosoftGraphKeyCredentialInner { * ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "endDateTime") private OffsetDateTime endDateTime; /* * The certificate's raw data in byte array converted to Base64 string; for example, * [System.Convert]::ToBase64String($Cert.GetRawCertData()). */ - @JsonProperty(value = "key") private Base64Url key; /* * The unique identifier (GUID) for the key. */ - @JsonProperty(value = "keyId") private UUID keyId; /* @@ -59,33 +59,32 @@ public final class MicrosoftGraphKeyCredentialInner { * using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "startDateTime") private OffsetDateTime startDateTime; /* * The type of key credential; for example, 'Symmetric'. */ - @JsonProperty(value = "type") private String type; /* * A string that describes the purpose for which the key can be used; for example, 'Verify'. */ - @JsonProperty(value = "usage") private String usage; /* * keyCredential */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphKeyCredentialInner class. */ + /** + * Creates an instance of MicrosoftGraphKeyCredentialInner class. + */ public MicrosoftGraphKeyCredentialInner() { } /** * Get the customKeyIdentifier property: Custom key identifier. - * + * * @return the customKeyIdentifier value. */ public byte[] customKeyIdentifier() { @@ -97,7 +96,7 @@ public byte[] customKeyIdentifier() { /** * Set the customKeyIdentifier property: Custom key identifier. - * + * * @param customKeyIdentifier the customKeyIdentifier value to set. * @return the MicrosoftGraphKeyCredentialInner object itself. */ @@ -112,7 +111,7 @@ public MicrosoftGraphKeyCredentialInner withCustomKeyIdentifier(byte[] customKey /** * Get the displayName property: Friendly name for the key. Optional. - * + * * @return the displayName value. */ public String displayName() { @@ -121,7 +120,7 @@ public String displayName() { /** * Set the displayName property: Friendly name for the key. Optional. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphKeyCredentialInner object itself. */ @@ -134,7 +133,7 @@ public MicrosoftGraphKeyCredentialInner withDisplayName(String displayName) { * Get the endDateTime property: The date and time at which the credential expires.The Timestamp type represents * date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, * 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @return the endDateTime value. */ public OffsetDateTime endDateTime() { @@ -145,7 +144,7 @@ public OffsetDateTime endDateTime() { * Set the endDateTime property: The date and time at which the credential expires.The Timestamp type represents * date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, * 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @param endDateTime the endDateTime value to set. * @return the MicrosoftGraphKeyCredentialInner object itself. */ @@ -157,7 +156,7 @@ public MicrosoftGraphKeyCredentialInner withEndDateTime(OffsetDateTime endDateTi /** * Get the key property: The certificate's raw data in byte array converted to Base64 string; for example, * [System.Convert]::ToBase64String($Cert.GetRawCertData()). - * + * * @return the key value. */ public byte[] key() { @@ -170,7 +169,7 @@ public byte[] key() { /** * Set the key property: The certificate's raw data in byte array converted to Base64 string; for example, * [System.Convert]::ToBase64String($Cert.GetRawCertData()). - * + * * @param key the key value to set. * @return the MicrosoftGraphKeyCredentialInner object itself. */ @@ -185,7 +184,7 @@ public MicrosoftGraphKeyCredentialInner withKey(byte[] key) { /** * Get the keyId property: The unique identifier (GUID) for the key. - * + * * @return the keyId value. */ public UUID keyId() { @@ -194,7 +193,7 @@ public UUID keyId() { /** * Set the keyId property: The unique identifier (GUID) for the key. - * + * * @param keyId the keyId value to set. * @return the MicrosoftGraphKeyCredentialInner object itself. */ @@ -207,7 +206,7 @@ public MicrosoftGraphKeyCredentialInner withKeyId(UUID keyId) { * Get the startDateTime property: The date and time at which the credential becomes valid.The Timestamp type * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @return the startDateTime value. */ public OffsetDateTime startDateTime() { @@ -218,7 +217,7 @@ public OffsetDateTime startDateTime() { * Set the startDateTime property: The date and time at which the credential becomes valid.The Timestamp type * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @param startDateTime the startDateTime value to set. * @return the MicrosoftGraphKeyCredentialInner object itself. */ @@ -229,7 +228,7 @@ public MicrosoftGraphKeyCredentialInner withStartDateTime(OffsetDateTime startDa /** * Get the type property: The type of key credential; for example, 'Symmetric'. - * + * * @return the type value. */ public String type() { @@ -238,7 +237,7 @@ public String type() { /** * Set the type property: The type of key credential; for example, 'Symmetric'. - * + * * @param type the type value to set. * @return the MicrosoftGraphKeyCredentialInner object itself. */ @@ -249,7 +248,7 @@ public MicrosoftGraphKeyCredentialInner withType(String type) { /** * Get the usage property: A string that describes the purpose for which the key can be used; for example, 'Verify'. - * + * * @return the usage value. */ public String usage() { @@ -258,7 +257,7 @@ public String usage() { /** * Set the usage property: A string that describes the purpose for which the key can be used; for example, 'Verify'. - * + * * @param usage the usage value to set. * @return the MicrosoftGraphKeyCredentialInner object itself. */ @@ -269,17 +268,16 @@ public MicrosoftGraphKeyCredentialInner withUsage(String usage) { /** * Get the additionalProperties property: keyCredential. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: keyCredential. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphKeyCredentialInner object itself. */ @@ -288,19 +286,87 @@ public MicrosoftGraphKeyCredentialInner withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("customKeyIdentifier", Objects.toString(this.customKeyIdentifier, null)); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("endDateTime", + this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime)); + jsonWriter.writeStringField("key", Objects.toString(this.key, null)); + jsonWriter.writeStringField("keyId", Objects.toString(this.keyId, null)); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("usage", this.usage); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphKeyCredentialInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphKeyCredentialInner 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 MicrosoftGraphKeyCredentialInner. + */ + public static MicrosoftGraphKeyCredentialInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphKeyCredentialInner deserializedMicrosoftGraphKeyCredentialInner + = new MicrosoftGraphKeyCredentialInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customKeyIdentifier".equals(fieldName)) { + deserializedMicrosoftGraphKeyCredentialInner.customKeyIdentifier + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphKeyCredentialInner.displayName = reader.getString(); + } else if ("endDateTime".equals(fieldName)) { + deserializedMicrosoftGraphKeyCredentialInner.endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("key".equals(fieldName)) { + deserializedMicrosoftGraphKeyCredentialInner.key + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("keyId".equals(fieldName)) { + deserializedMicrosoftGraphKeyCredentialInner.keyId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("startDateTime".equals(fieldName)) { + deserializedMicrosoftGraphKeyCredentialInner.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphKeyCredentialInner.type = reader.getString(); + } else if ("usage".equals(fieldName)) { + deserializedMicrosoftGraphKeyCredentialInner.usage = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphKeyCredentialInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphKeyCredentialInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphKeyValue.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphKeyValue.java index 65bd3b383e236..f34b22ae2c76c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphKeyValue.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphKeyValue.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** keyValue. */ +/** + * keyValue. + */ @Fluent -public final class MicrosoftGraphKeyValue { +public final class MicrosoftGraphKeyValue implements JsonSerializable { /* * Key for the key-value pair. */ - @JsonProperty(value = "key") private String key; /* * Value for the key-value pair. */ - @JsonProperty(value = "value") private String value; /* * keyValue */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphKeyValue class. */ + /** + * Creates an instance of MicrosoftGraphKeyValue class. + */ public MicrosoftGraphKeyValue() { } /** * Get the key property: Key for the key-value pair. - * + * * @return the key value. */ public String key() { @@ -47,7 +50,7 @@ public String key() { /** * Set the key property: Key for the key-value pair. - * + * * @param key the key value to set. * @return the MicrosoftGraphKeyValue object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphKeyValue withKey(String key) { /** * Get the value property: Value for the key-value pair. - * + * * @return the value value. */ public String value() { @@ -67,7 +70,7 @@ public String value() { /** * Set the value property: Value for the key-value pair. - * + * * @param value the value value to set. * @return the MicrosoftGraphKeyValue object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphKeyValue withValue(String value) { /** * Get the additionalProperties property: keyValue. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: keyValue. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphKeyValue object itself. */ @@ -97,19 +99,61 @@ public MicrosoftGraphKeyValue withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("value", this.value); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphKeyValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphKeyValue 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 MicrosoftGraphKeyValue. + */ + public static MicrosoftGraphKeyValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphKeyValue deserializedMicrosoftGraphKeyValue = new MicrosoftGraphKeyValue(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + deserializedMicrosoftGraphKeyValue.key = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedMicrosoftGraphKeyValue.value = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphKeyValue.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphKeyValue; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseAssignmentState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseAssignmentState.java index e30ea7a2f57ec..d91afb42f96c0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseAssignmentState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseAssignmentState.java @@ -5,60 +5,62 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** licenseAssignmentState. */ +/** + * licenseAssignmentState. + */ @Fluent -public final class MicrosoftGraphLicenseAssignmentState { +public final class MicrosoftGraphLicenseAssignmentState + implements JsonSerializable { /* * The assignedByGroup property. */ - @JsonProperty(value = "assignedByGroup") private String assignedByGroup; /* * The disabledPlans property. */ - @JsonProperty(value = "disabledPlans") private List disabledPlans; /* * The error property. */ - @JsonProperty(value = "error") private String error; /* * The skuId property. */ - @JsonProperty(value = "skuId") private UUID skuId; /* * The state property. */ - @JsonProperty(value = "state") private String state; /* * licenseAssignmentState */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphLicenseAssignmentState class. */ + /** + * Creates an instance of MicrosoftGraphLicenseAssignmentState class. + */ public MicrosoftGraphLicenseAssignmentState() { } /** * Get the assignedByGroup property: The assignedByGroup property. - * + * * @return the assignedByGroup value. */ public String assignedByGroup() { @@ -67,7 +69,7 @@ public String assignedByGroup() { /** * Set the assignedByGroup property: The assignedByGroup property. - * + * * @param assignedByGroup the assignedByGroup value to set. * @return the MicrosoftGraphLicenseAssignmentState object itself. */ @@ -78,7 +80,7 @@ public MicrosoftGraphLicenseAssignmentState withAssignedByGroup(String assignedB /** * Get the disabledPlans property: The disabledPlans property. - * + * * @return the disabledPlans value. */ public List disabledPlans() { @@ -87,7 +89,7 @@ public List disabledPlans() { /** * Set the disabledPlans property: The disabledPlans property. - * + * * @param disabledPlans the disabledPlans value to set. * @return the MicrosoftGraphLicenseAssignmentState object itself. */ @@ -98,7 +100,7 @@ public MicrosoftGraphLicenseAssignmentState withDisabledPlans(List disable /** * Get the error property: The error property. - * + * * @return the error value. */ public String error() { @@ -107,7 +109,7 @@ public String error() { /** * Set the error property: The error property. - * + * * @param error the error value to set. * @return the MicrosoftGraphLicenseAssignmentState object itself. */ @@ -118,7 +120,7 @@ public MicrosoftGraphLicenseAssignmentState withError(String error) { /** * Get the skuId property: The skuId property. - * + * * @return the skuId value. */ public UUID skuId() { @@ -127,7 +129,7 @@ public UUID skuId() { /** * Set the skuId property: The skuId property. - * + * * @param skuId the skuId value to set. * @return the MicrosoftGraphLicenseAssignmentState object itself. */ @@ -138,7 +140,7 @@ public MicrosoftGraphLicenseAssignmentState withSkuId(UUID skuId) { /** * Get the state property: The state property. - * + * * @return the state value. */ public String state() { @@ -147,7 +149,7 @@ public String state() { /** * Set the state property: The state property. - * + * * @param state the state value to set. * @return the MicrosoftGraphLicenseAssignmentState object itself. */ @@ -158,17 +160,16 @@ public MicrosoftGraphLicenseAssignmentState withState(String state) { /** * Get the additionalProperties property: licenseAssignmentState. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: licenseAssignmentState. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphLicenseAssignmentState object itself. */ @@ -177,19 +178,75 @@ public MicrosoftGraphLicenseAssignmentState withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("assignedByGroup", this.assignedByGroup); + jsonWriter.writeArrayField("disabledPlans", this.disabledPlans, + (writer, element) -> writer.writeString(Objects.toString(element, null))); + jsonWriter.writeStringField("error", this.error); + jsonWriter.writeStringField("skuId", Objects.toString(this.skuId, null)); + jsonWriter.writeStringField("state", this.state); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphLicenseAssignmentState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphLicenseAssignmentState 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 MicrosoftGraphLicenseAssignmentState. + */ + public static MicrosoftGraphLicenseAssignmentState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphLicenseAssignmentState deserializedMicrosoftGraphLicenseAssignmentState + = new MicrosoftGraphLicenseAssignmentState(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignedByGroup".equals(fieldName)) { + deserializedMicrosoftGraphLicenseAssignmentState.assignedByGroup = reader.getString(); + } else if ("disabledPlans".equals(fieldName)) { + List disabledPlans = reader.readArray( + reader1 -> reader1.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()))); + deserializedMicrosoftGraphLicenseAssignmentState.disabledPlans = disabledPlans; + } else if ("error".equals(fieldName)) { + deserializedMicrosoftGraphLicenseAssignmentState.error = reader.getString(); + } else if ("skuId".equals(fieldName)) { + deserializedMicrosoftGraphLicenseAssignmentState.skuId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphLicenseAssignmentState.state = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphLicenseAssignmentState.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphLicenseAssignmentState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseDetails.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseDetails.java index afd794a857647..ae1d215560f2d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseDetails.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseDetails.java @@ -5,50 +5,52 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** licenseDetails. */ +/** + * licenseDetails. + */ @Fluent public final class MicrosoftGraphLicenseDetails extends MicrosoftGraphEntity { /* * Information about the service plans assigned with the license. Read-only, Not nullable */ - @JsonProperty(value = "servicePlans") private List servicePlans; /* * Unique identifier (GUID) for the service SKU. Equal to the skuId property on the related SubscribedSku object. * Read-only */ - @JsonProperty(value = "skuId") private UUID skuId; /* * The skuPartNumber property. */ - @JsonProperty(value = "skuPartNumber") private String skuPartNumber; /* * licenseDetails */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphLicenseDetails class. */ + /** + * Creates an instance of MicrosoftGraphLicenseDetails class. + */ public MicrosoftGraphLicenseDetails() { } /** * Get the servicePlans property: Information about the service plans assigned with the license. Read-only, Not * nullable. - * + * * @return the servicePlans value. */ public List servicePlans() { @@ -58,7 +60,7 @@ public List servicePlans() { /** * Set the servicePlans property: Information about the service plans assigned with the license. Read-only, Not * nullable. - * + * * @param servicePlans the servicePlans value to set. * @return the MicrosoftGraphLicenseDetails object itself. */ @@ -70,7 +72,7 @@ public MicrosoftGraphLicenseDetails withServicePlans(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: licenseDetails. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphLicenseDetails object itself. */ @@ -130,15 +131,9 @@ public MicrosoftGraphLicenseDetails withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphLicenseDetails withId(String id) { super.withId(id); @@ -147,7 +142,7 @@ public MicrosoftGraphLicenseDetails withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -157,4 +152,63 @@ public void validate() { servicePlans().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("servicePlans", this.servicePlans, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("skuId", Objects.toString(this.skuId, null)); + jsonWriter.writeStringField("skuPartNumber", this.skuPartNumber); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphLicenseDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphLicenseDetails 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 MicrosoftGraphLicenseDetails. + */ + public static MicrosoftGraphLicenseDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphLicenseDetails deserializedMicrosoftGraphLicenseDetails = new MicrosoftGraphLicenseDetails(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphLicenseDetails.withId(reader.getString()); + } else if ("servicePlans".equals(fieldName)) { + List servicePlans + = reader.readArray(reader1 -> MicrosoftGraphServicePlanInfo.fromJson(reader1)); + deserializedMicrosoftGraphLicenseDetails.servicePlans = servicePlans; + } else if ("skuId".equals(fieldName)) { + deserializedMicrosoftGraphLicenseDetails.skuId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("skuPartNumber".equals(fieldName)) { + deserializedMicrosoftGraphLicenseDetails.skuPartNumber = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphLicenseDetails.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphLicenseDetails; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseProcessingState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseProcessingState.java index 176d9a4c1785b..dd591fb20e248 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseProcessingState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseProcessingState.java @@ -5,34 +5,39 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** licenseProcessingState. */ +/** + * licenseProcessingState. + */ @Fluent -public final class MicrosoftGraphLicenseProcessingState { +public final class MicrosoftGraphLicenseProcessingState + implements JsonSerializable { /* * The state property. */ - @JsonProperty(value = "state") private String state; /* * licenseProcessingState */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphLicenseProcessingState class. */ + /** + * Creates an instance of MicrosoftGraphLicenseProcessingState class. + */ public MicrosoftGraphLicenseProcessingState() { } /** * Get the state property: The state property. - * + * * @return the state value. */ public String state() { @@ -41,7 +46,7 @@ public String state() { /** * Set the state property: The state property. - * + * * @param state the state value to set. * @return the MicrosoftGraphLicenseProcessingState object itself. */ @@ -52,17 +57,16 @@ public MicrosoftGraphLicenseProcessingState withState(String state) { /** * Get the additionalProperties property: licenseProcessingState. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: licenseProcessingState. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphLicenseProcessingState object itself. */ @@ -71,19 +75,59 @@ public MicrosoftGraphLicenseProcessingState withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("state", this.state); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphLicenseProcessingState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphLicenseProcessingState 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 MicrosoftGraphLicenseProcessingState. + */ + public static MicrosoftGraphLicenseProcessingState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphLicenseProcessingState deserializedMicrosoftGraphLicenseProcessingState + = new MicrosoftGraphLicenseProcessingState(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedMicrosoftGraphLicenseProcessingState.state = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphLicenseProcessingState.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphLicenseProcessingState; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseUnitsDetail.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseUnitsDetail.java index 39d9a644964aa..95f8281d9428c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseUnitsDetail.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLicenseUnitsDetail.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** licenseUnitsDetail. */ +/** + * licenseUnitsDetail. + */ @Fluent -public final class MicrosoftGraphLicenseUnitsDetail { +public final class MicrosoftGraphLicenseUnitsDetail implements JsonSerializable { /* * The number of units that are enabled. */ - @JsonProperty(value = "enabled") private Integer enabled; /* * The number of units that are suspended. */ - @JsonProperty(value = "suspended") private Integer suspended; /* * The number of units that are in warning status. */ - @JsonProperty(value = "warning") private Integer warning; /* * licenseUnitsDetail */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphLicenseUnitsDetail class. */ + /** + * Creates an instance of MicrosoftGraphLicenseUnitsDetail class. + */ public MicrosoftGraphLicenseUnitsDetail() { } /** * Get the enabled property: The number of units that are enabled. - * + * * @return the enabled value. */ public Integer enabled() { @@ -53,7 +55,7 @@ public Integer enabled() { /** * Set the enabled property: The number of units that are enabled. - * + * * @param enabled the enabled value to set. * @return the MicrosoftGraphLicenseUnitsDetail object itself. */ @@ -64,7 +66,7 @@ public MicrosoftGraphLicenseUnitsDetail withEnabled(Integer enabled) { /** * Get the suspended property: The number of units that are suspended. - * + * * @return the suspended value. */ public Integer suspended() { @@ -73,7 +75,7 @@ public Integer suspended() { /** * Set the suspended property: The number of units that are suspended. - * + * * @param suspended the suspended value to set. * @return the MicrosoftGraphLicenseUnitsDetail object itself. */ @@ -84,7 +86,7 @@ public MicrosoftGraphLicenseUnitsDetail withSuspended(Integer suspended) { /** * Get the warning property: The number of units that are in warning status. - * + * * @return the warning value. */ public Integer warning() { @@ -93,7 +95,7 @@ public Integer warning() { /** * Set the warning property: The number of units that are in warning status. - * + * * @param warning the warning value to set. * @return the MicrosoftGraphLicenseUnitsDetail object itself. */ @@ -104,17 +106,16 @@ public MicrosoftGraphLicenseUnitsDetail withWarning(Integer warning) { /** * Get the additionalProperties property: licenseUnitsDetail. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: licenseUnitsDetail. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphLicenseUnitsDetail object itself. */ @@ -123,19 +124,65 @@ public MicrosoftGraphLicenseUnitsDetail withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("enabled", this.enabled); + jsonWriter.writeNumberField("suspended", this.suspended); + jsonWriter.writeNumberField("warning", this.warning); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphLicenseUnitsDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphLicenseUnitsDetail 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 MicrosoftGraphLicenseUnitsDetail. + */ + public static MicrosoftGraphLicenseUnitsDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphLicenseUnitsDetail deserializedMicrosoftGraphLicenseUnitsDetail + = new MicrosoftGraphLicenseUnitsDetail(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enabled".equals(fieldName)) { + deserializedMicrosoftGraphLicenseUnitsDetail.enabled = reader.getNullable(JsonReader::getInt); + } else if ("suspended".equals(fieldName)) { + deserializedMicrosoftGraphLicenseUnitsDetail.suspended = reader.getNullable(JsonReader::getInt); + } else if ("warning".equals(fieldName)) { + deserializedMicrosoftGraphLicenseUnitsDetail.warning = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphLicenseUnitsDetail.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphLicenseUnitsDetail; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLinkedResource.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLinkedResource.java index e0166f41ed41a..41c32b1bd7372 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLinkedResource.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLinkedResource.java @@ -5,52 +5,52 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** linkedResource. */ +/** + * linkedResource. + */ @Fluent public final class MicrosoftGraphLinkedResource extends MicrosoftGraphEntity { /* * Field indicating the app name of the source that is sending the linkedResource. */ - @JsonProperty(value = "applicationName") private String applicationName; /* * Field indicating the title of the linkedResource. */ - @JsonProperty(value = "displayName") private String displayName; /* * Id of the object that is associated with this task on the third-party/partner system. */ - @JsonProperty(value = "externalId") private String externalId; /* * Deep link to the linkedResource. */ - @JsonProperty(value = "webUrl") private String webUrl; /* * linkedResource */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphLinkedResource class. */ + /** + * Creates an instance of MicrosoftGraphLinkedResource class. + */ public MicrosoftGraphLinkedResource() { } /** * Get the applicationName property: Field indicating the app name of the source that is sending the linkedResource. - * + * * @return the applicationName value. */ public String applicationName() { @@ -59,7 +59,7 @@ public String applicationName() { /** * Set the applicationName property: Field indicating the app name of the source that is sending the linkedResource. - * + * * @param applicationName the applicationName value to set. * @return the MicrosoftGraphLinkedResource object itself. */ @@ -70,7 +70,7 @@ public MicrosoftGraphLinkedResource withApplicationName(String applicationName) /** * Get the displayName property: Field indicating the title of the linkedResource. - * + * * @return the displayName value. */ public String displayName() { @@ -79,7 +79,7 @@ public String displayName() { /** * Set the displayName property: Field indicating the title of the linkedResource. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphLinkedResource object itself. */ @@ -91,7 +91,7 @@ public MicrosoftGraphLinkedResource withDisplayName(String displayName) { /** * Get the externalId property: Id of the object that is associated with this task on the third-party/partner * system. - * + * * @return the externalId value. */ public String externalId() { @@ -101,7 +101,7 @@ public String externalId() { /** * Set the externalId property: Id of the object that is associated with this task on the third-party/partner * system. - * + * * @param externalId the externalId value to set. * @return the MicrosoftGraphLinkedResource object itself. */ @@ -112,7 +112,7 @@ public MicrosoftGraphLinkedResource withExternalId(String externalId) { /** * Get the webUrl property: Deep link to the linkedResource. - * + * * @return the webUrl value. */ public String webUrl() { @@ -121,7 +121,7 @@ public String webUrl() { /** * Set the webUrl property: Deep link to the linkedResource. - * + * * @param webUrl the webUrl value to set. * @return the MicrosoftGraphLinkedResource object itself. */ @@ -132,17 +132,16 @@ public MicrosoftGraphLinkedResource withWebUrl(String webUrl) { /** * Get the additionalProperties property: linkedResource. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: linkedResource. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphLinkedResource object itself. */ @@ -151,15 +150,9 @@ public MicrosoftGraphLinkedResource withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphLinkedResource withId(String id) { super.withId(id); @@ -168,11 +161,70 @@ public MicrosoftGraphLinkedResource withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("applicationName", this.applicationName); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("externalId", this.externalId); + jsonWriter.writeStringField("webUrl", this.webUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphLinkedResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphLinkedResource 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 MicrosoftGraphLinkedResource. + */ + public static MicrosoftGraphLinkedResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphLinkedResource deserializedMicrosoftGraphLinkedResource = new MicrosoftGraphLinkedResource(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphLinkedResource.withId(reader.getString()); + } else if ("applicationName".equals(fieldName)) { + deserializedMicrosoftGraphLinkedResource.applicationName = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphLinkedResource.displayName = reader.getString(); + } else if ("externalId".equals(fieldName)) { + deserializedMicrosoftGraphLinkedResource.externalId = reader.getString(); + } else if ("webUrl".equals(fieldName)) { + deserializedMicrosoftGraphLinkedResource.webUrl = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphLinkedResource.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphLinkedResource; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphList.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphList.java index a0019a4ae4cf8..7f14830405cb6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphList.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphList.java @@ -5,86 +5,81 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** list. */ +/** + * list. + */ @Fluent public final class MicrosoftGraphList extends MicrosoftGraphBaseItemInner { /* * The displayable title of the list. */ - @JsonProperty(value = "displayName") private String displayName; /* * listInfo */ - @JsonProperty(value = "list") private MicrosoftGraphListInfo list; /* * sharepointIds */ - @JsonProperty(value = "sharepointIds") private MicrosoftGraphSharepointIds sharepointIds; /* * systemFacet */ - @JsonProperty(value = "system") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map system; /* * The collection of field definitions for this list. */ - @JsonProperty(value = "columns") private List columns; /* * The collection of content types present in this list. */ - @JsonProperty(value = "contentTypes") private List contentTypes; /* * drive */ - @JsonProperty(value = "drive") private MicrosoftGraphDrive drive; /* * All items contained in the list. */ - @JsonProperty(value = "items") private List items; /* * The set of subscriptions on the list. */ - @JsonProperty(value = "subscriptions") private List subscriptions; /* * list */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphList class. */ + /** + * Creates an instance of MicrosoftGraphList class. + */ public MicrosoftGraphList() { } /** * Get the displayName property: The displayable title of the list. - * + * * @return the displayName value. */ public String displayName() { @@ -93,7 +88,7 @@ public String displayName() { /** * Set the displayName property: The displayable title of the list. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphList object itself. */ @@ -104,7 +99,7 @@ public MicrosoftGraphList withDisplayName(String displayName) { /** * Get the list property: listInfo. - * + * * @return the list value. */ public MicrosoftGraphListInfo list() { @@ -113,7 +108,7 @@ public MicrosoftGraphListInfo list() { /** * Set the list property: listInfo. - * + * * @param list the list value to set. * @return the MicrosoftGraphList object itself. */ @@ -124,7 +119,7 @@ public MicrosoftGraphList withList(MicrosoftGraphListInfo list) { /** * Get the sharepointIds property: sharepointIds. - * + * * @return the sharepointIds value. */ public MicrosoftGraphSharepointIds sharepointIds() { @@ -133,7 +128,7 @@ public MicrosoftGraphSharepointIds sharepointIds() { /** * Set the sharepointIds property: sharepointIds. - * + * * @param sharepointIds the sharepointIds value to set. * @return the MicrosoftGraphList object itself. */ @@ -144,7 +139,7 @@ public MicrosoftGraphList withSharepointIds(MicrosoftGraphSharepointIds sharepoi /** * Get the system property: systemFacet. - * + * * @return the system value. */ public Map system() { @@ -153,7 +148,7 @@ public Map system() { /** * Set the system property: systemFacet. - * + * * @param system the system value to set. * @return the MicrosoftGraphList object itself. */ @@ -164,7 +159,7 @@ public MicrosoftGraphList withSystem(Map system) { /** * Get the columns property: The collection of field definitions for this list. - * + * * @return the columns value. */ public List columns() { @@ -173,7 +168,7 @@ public List columns() { /** * Set the columns property: The collection of field definitions for this list. - * + * * @param columns the columns value to set. * @return the MicrosoftGraphList object itself. */ @@ -184,7 +179,7 @@ public MicrosoftGraphList withColumns(List colum /** * Get the contentTypes property: The collection of content types present in this list. - * + * * @return the contentTypes value. */ public List contentTypes() { @@ -193,7 +188,7 @@ public List contentTypes() { /** * Set the contentTypes property: The collection of content types present in this list. - * + * * @param contentTypes the contentTypes value to set. * @return the MicrosoftGraphList object itself. */ @@ -204,7 +199,7 @@ public MicrosoftGraphList withContentTypes(List conte /** * Get the drive property: drive. - * + * * @return the drive value. */ public MicrosoftGraphDrive drive() { @@ -213,7 +208,7 @@ public MicrosoftGraphDrive drive() { /** * Set the drive property: drive. - * + * * @param drive the drive value to set. * @return the MicrosoftGraphList object itself. */ @@ -224,7 +219,7 @@ public MicrosoftGraphList withDrive(MicrosoftGraphDrive drive) { /** * Get the items property: All items contained in the list. - * + * * @return the items value. */ public List items() { @@ -233,7 +228,7 @@ public List items() { /** * Set the items property: All items contained in the list. - * + * * @param items the items value to set. * @return the MicrosoftGraphList object itself. */ @@ -244,7 +239,7 @@ public MicrosoftGraphList withItems(List items) { /** * Get the subscriptions property: The set of subscriptions on the list. - * + * * @return the subscriptions value. */ public List subscriptions() { @@ -253,7 +248,7 @@ public List subscriptions() { /** * Set the subscriptions property: The set of subscriptions on the list. - * + * * @param subscriptions the subscriptions value to set. * @return the MicrosoftGraphList object itself. */ @@ -264,17 +259,16 @@ public MicrosoftGraphList withSubscriptions(List sub /** * Get the additionalProperties property: list. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: list. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphList object itself. */ @@ -283,92 +277,108 @@ public MicrosoftGraphList withAdditionalProperties(Map additiona return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withCreatedBy(MicrosoftGraphIdentitySet createdBy) { super.withCreatedBy(createdBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withEtag(String etag) { super.withEtag(etag); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withName(String name) { super.withName(name); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withParentReference(MicrosoftGraphItemReference parentReference) { super.withParentReference(parentReference); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withWebUrl(String webUrl) { super.withWebUrl(webUrl); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withCreatedByUser(MicrosoftGraphUserInner createdByUser) { super.withCreatedByUser(createdByUser); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withLastModifiedByUser(MicrosoftGraphUserInner lastModifiedByUser) { super.withLastModifiedByUser(lastModifiedByUser); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphList withId(String id) { super.withId(id); @@ -377,7 +387,7 @@ public MicrosoftGraphList withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -405,4 +415,126 @@ public void validate() { subscriptions().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("createdBy", createdBy()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("eTag", etag()); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeJsonField("parentReference", parentReference()); + jsonWriter.writeStringField("webUrl", webUrl()); + jsonWriter.writeJsonField("createdByUser", createdByUser()); + jsonWriter.writeJsonField("lastModifiedByUser", lastModifiedByUser()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeJsonField("list", this.list); + jsonWriter.writeJsonField("sharepointIds", this.sharepointIds); + jsonWriter.writeMapField("system", this.system, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeArrayField("columns", this.columns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("contentTypes", this.contentTypes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("drive", this.drive); + jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("subscriptions", this.subscriptions, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphList 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 MicrosoftGraphList. + */ + public static MicrosoftGraphList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphList deserializedMicrosoftGraphList = new MicrosoftGraphList(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphList.withId(reader.getString()); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphList.withCreatedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphList.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphList.withDescription(reader.getString()); + } else if ("eTag".equals(fieldName)) { + deserializedMicrosoftGraphList.withEtag(reader.getString()); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphList.withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphList.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphList.withName(reader.getString()); + } else if ("parentReference".equals(fieldName)) { + deserializedMicrosoftGraphList.withParentReference(MicrosoftGraphItemReference.fromJson(reader)); + } else if ("webUrl".equals(fieldName)) { + deserializedMicrosoftGraphList.withWebUrl(reader.getString()); + } else if ("createdByUser".equals(fieldName)) { + deserializedMicrosoftGraphList.withCreatedByUser(MicrosoftGraphUserInner.fromJson(reader)); + } else if ("lastModifiedByUser".equals(fieldName)) { + deserializedMicrosoftGraphList.withLastModifiedByUser(MicrosoftGraphUserInner.fromJson(reader)); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphList.displayName = reader.getString(); + } else if ("list".equals(fieldName)) { + deserializedMicrosoftGraphList.list = MicrosoftGraphListInfo.fromJson(reader); + } else if ("sharepointIds".equals(fieldName)) { + deserializedMicrosoftGraphList.sharepointIds = MicrosoftGraphSharepointIds.fromJson(reader); + } else if ("system".equals(fieldName)) { + Map system = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphList.system = system; + } else if ("columns".equals(fieldName)) { + List columns + = reader.readArray(reader1 -> MicrosoftGraphColumnDefinition.fromJson(reader1)); + deserializedMicrosoftGraphList.columns = columns; + } else if ("contentTypes".equals(fieldName)) { + List contentTypes + = reader.readArray(reader1 -> MicrosoftGraphContentType.fromJson(reader1)); + deserializedMicrosoftGraphList.contentTypes = contentTypes; + } else if ("drive".equals(fieldName)) { + deserializedMicrosoftGraphList.drive = MicrosoftGraphDrive.fromJson(reader); + } else if ("items".equals(fieldName)) { + List items + = reader.readArray(reader1 -> MicrosoftGraphListItem.fromJson(reader1)); + deserializedMicrosoftGraphList.items = items; + } else if ("subscriptions".equals(fieldName)) { + List subscriptions + = reader.readArray(reader1 -> MicrosoftGraphSubscription.fromJson(reader1)); + deserializedMicrosoftGraphList.subscriptions = subscriptions; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphList.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphList; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListInfo.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListInfo.java index c06274a748fe1..34cafa30179b0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListInfo.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListInfo.java @@ -5,47 +5,49 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** listInfo. */ +/** + * listInfo. + */ @Fluent -public final class MicrosoftGraphListInfo { +public final class MicrosoftGraphListInfo implements JsonSerializable { /* * If true, indicates that content types are enabled for this list. */ - @JsonProperty(value = "contentTypesEnabled") private Boolean contentTypesEnabled; /* * If true, indicates that the list is not normally visible in the SharePoint user experience. */ - @JsonProperty(value = "hidden") private Boolean hidden; /* * An enumerated value that represents the base list template used in creating the list. Possible values include * documentLibrary, genericList, task, survey, announcements, contacts, and more. */ - @JsonProperty(value = "template") private String template; /* * listInfo */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphListInfo class. */ + /** + * Creates an instance of MicrosoftGraphListInfo class. + */ public MicrosoftGraphListInfo() { } /** * Get the contentTypesEnabled property: If true, indicates that content types are enabled for this list. - * + * * @return the contentTypesEnabled value. */ public Boolean contentTypesEnabled() { @@ -54,7 +56,7 @@ public Boolean contentTypesEnabled() { /** * Set the contentTypesEnabled property: If true, indicates that content types are enabled for this list. - * + * * @param contentTypesEnabled the contentTypesEnabled value to set. * @return the MicrosoftGraphListInfo object itself. */ @@ -66,7 +68,7 @@ public MicrosoftGraphListInfo withContentTypesEnabled(Boolean contentTypesEnable /** * Get the hidden property: If true, indicates that the list is not normally visible in the SharePoint user * experience. - * + * * @return the hidden value. */ public Boolean hidden() { @@ -76,7 +78,7 @@ public Boolean hidden() { /** * Set the hidden property: If true, indicates that the list is not normally visible in the SharePoint user * experience. - * + * * @param hidden the hidden value to set. * @return the MicrosoftGraphListInfo object itself. */ @@ -88,7 +90,7 @@ public MicrosoftGraphListInfo withHidden(Boolean hidden) { /** * Get the template property: An enumerated value that represents the base list template used in creating the list. * Possible values include documentLibrary, genericList, task, survey, announcements, contacts, and more. - * + * * @return the template value. */ public String template() { @@ -98,7 +100,7 @@ public String template() { /** * Set the template property: An enumerated value that represents the base list template used in creating the list. * Possible values include documentLibrary, genericList, task, survey, announcements, contacts, and more. - * + * * @param template the template value to set. * @return the MicrosoftGraphListInfo object itself. */ @@ -109,17 +111,16 @@ public MicrosoftGraphListInfo withTemplate(String template) { /** * Get the additionalProperties property: listInfo. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: listInfo. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphListInfo object itself. */ @@ -128,19 +129,64 @@ public MicrosoftGraphListInfo withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("contentTypesEnabled", this.contentTypesEnabled); + jsonWriter.writeBooleanField("hidden", this.hidden); + jsonWriter.writeStringField("template", this.template); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphListInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphListInfo 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 MicrosoftGraphListInfo. + */ + public static MicrosoftGraphListInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphListInfo deserializedMicrosoftGraphListInfo = new MicrosoftGraphListInfo(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contentTypesEnabled".equals(fieldName)) { + deserializedMicrosoftGraphListInfo.contentTypesEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("hidden".equals(fieldName)) { + deserializedMicrosoftGraphListInfo.hidden = reader.getNullable(JsonReader::getBoolean); + } else if ("template".equals(fieldName)) { + deserializedMicrosoftGraphListInfo.template = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphListInfo.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphListInfo; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListItem.java index 7d29486877192..52da5c16d9615 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListItem.java @@ -5,66 +5,66 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** listItem. */ +/** + * listItem. + */ @Fluent public final class MicrosoftGraphListItem extends MicrosoftGraphBaseItemInner { /* * contentTypeInfo */ - @JsonProperty(value = "contentType") private MicrosoftGraphContentTypeInfo contentType; /* * sharepointIds */ - @JsonProperty(value = "sharepointIds") private MicrosoftGraphSharepointIds sharepointIds; /* * itemAnalytics */ - @JsonProperty(value = "analytics") private MicrosoftGraphItemAnalytics analytics; /* * driveItem */ - @JsonProperty(value = "driveItem") private MicrosoftGraphDriveItem driveItem; /* * fieldValueSet */ - @JsonProperty(value = "fields") private MicrosoftGraphFieldValueSet fields; /* * The list of previous versions of the list item. */ - @JsonProperty(value = "versions") private List versions; /* * listItem */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphListItem class. */ + /** + * Creates an instance of MicrosoftGraphListItem class. + */ public MicrosoftGraphListItem() { } /** * Get the contentType property: contentTypeInfo. - * + * * @return the contentType value. */ public MicrosoftGraphContentTypeInfo contentType() { @@ -73,7 +73,7 @@ public MicrosoftGraphContentTypeInfo contentType() { /** * Set the contentType property: contentTypeInfo. - * + * * @param contentType the contentType value to set. * @return the MicrosoftGraphListItem object itself. */ @@ -84,7 +84,7 @@ public MicrosoftGraphListItem withContentType(MicrosoftGraphContentTypeInfo cont /** * Get the sharepointIds property: sharepointIds. - * + * * @return the sharepointIds value. */ public MicrosoftGraphSharepointIds sharepointIds() { @@ -93,7 +93,7 @@ public MicrosoftGraphSharepointIds sharepointIds() { /** * Set the sharepointIds property: sharepointIds. - * + * * @param sharepointIds the sharepointIds value to set. * @return the MicrosoftGraphListItem object itself. */ @@ -104,7 +104,7 @@ public MicrosoftGraphListItem withSharepointIds(MicrosoftGraphSharepointIds shar /** * Get the analytics property: itemAnalytics. - * + * * @return the analytics value. */ public MicrosoftGraphItemAnalytics analytics() { @@ -113,7 +113,7 @@ public MicrosoftGraphItemAnalytics analytics() { /** * Set the analytics property: itemAnalytics. - * + * * @param analytics the analytics value to set. * @return the MicrosoftGraphListItem object itself. */ @@ -124,7 +124,7 @@ public MicrosoftGraphListItem withAnalytics(MicrosoftGraphItemAnalytics analytic /** * Get the driveItem property: driveItem. - * + * * @return the driveItem value. */ public MicrosoftGraphDriveItem driveItem() { @@ -133,7 +133,7 @@ public MicrosoftGraphDriveItem driveItem() { /** * Set the driveItem property: driveItem. - * + * * @param driveItem the driveItem value to set. * @return the MicrosoftGraphListItem object itself. */ @@ -144,7 +144,7 @@ public MicrosoftGraphListItem withDriveItem(MicrosoftGraphDriveItem driveItem) { /** * Get the fields property: fieldValueSet. - * + * * @return the fields value. */ public MicrosoftGraphFieldValueSet fields() { @@ -153,7 +153,7 @@ public MicrosoftGraphFieldValueSet fields() { /** * Set the fields property: fieldValueSet. - * + * * @param fields the fields value to set. * @return the MicrosoftGraphListItem object itself. */ @@ -164,7 +164,7 @@ public MicrosoftGraphListItem withFields(MicrosoftGraphFieldValueSet fields) { /** * Get the versions property: The list of previous versions of the list item. - * + * * @return the versions value. */ public List versions() { @@ -173,7 +173,7 @@ public List versions() { /** * Set the versions property: The list of previous versions of the list item. - * + * * @param versions the versions value to set. * @return the MicrosoftGraphListItem object itself. */ @@ -184,17 +184,16 @@ public MicrosoftGraphListItem withVersions(List v /** * Get the additionalProperties property: listItem. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: listItem. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphListItem object itself. */ @@ -203,92 +202,108 @@ public MicrosoftGraphListItem withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withCreatedBy(MicrosoftGraphIdentitySet createdBy) { super.withCreatedBy(createdBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withDescription(String description) { super.withDescription(description); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withEtag(String etag) { super.withEtag(etag); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withName(String name) { super.withName(name); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withParentReference(MicrosoftGraphItemReference parentReference) { super.withParentReference(parentReference); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withWebUrl(String webUrl) { super.withWebUrl(webUrl); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withCreatedByUser(MicrosoftGraphUserInner createdByUser) { super.withCreatedByUser(createdByUser); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withLastModifiedByUser(MicrosoftGraphUserInner lastModifiedByUser) { super.withLastModifiedByUser(lastModifiedByUser); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItem withId(String id) { super.withId(id); @@ -297,7 +312,7 @@ public MicrosoftGraphListItem withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -322,4 +337,111 @@ public void validate() { versions().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("createdBy", createdBy()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeStringField("eTag", etag()); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeStringField("name", name()); + jsonWriter.writeJsonField("parentReference", parentReference()); + jsonWriter.writeStringField("webUrl", webUrl()); + jsonWriter.writeJsonField("createdByUser", createdByUser()); + jsonWriter.writeJsonField("lastModifiedByUser", lastModifiedByUser()); + jsonWriter.writeJsonField("contentType", this.contentType); + jsonWriter.writeJsonField("sharepointIds", this.sharepointIds); + jsonWriter.writeJsonField("analytics", this.analytics); + jsonWriter.writeJsonField("driveItem", this.driveItem); + jsonWriter.writeJsonField("fields", this.fields); + jsonWriter.writeArrayField("versions", this.versions, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphListItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphListItem 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 MicrosoftGraphListItem. + */ + public static MicrosoftGraphListItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphListItem deserializedMicrosoftGraphListItem = new MicrosoftGraphListItem(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withId(reader.getString()); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withCreatedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withDescription(reader.getString()); + } else if ("eTag".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withEtag(reader.getString()); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withName(reader.getString()); + } else if ("parentReference".equals(fieldName)) { + deserializedMicrosoftGraphListItem + .withParentReference(MicrosoftGraphItemReference.fromJson(reader)); + } else if ("webUrl".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withWebUrl(reader.getString()); + } else if ("createdByUser".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withCreatedByUser(MicrosoftGraphUserInner.fromJson(reader)); + } else if ("lastModifiedByUser".equals(fieldName)) { + deserializedMicrosoftGraphListItem.withLastModifiedByUser(MicrosoftGraphUserInner.fromJson(reader)); + } else if ("contentType".equals(fieldName)) { + deserializedMicrosoftGraphListItem.contentType = MicrosoftGraphContentTypeInfo.fromJson(reader); + } else if ("sharepointIds".equals(fieldName)) { + deserializedMicrosoftGraphListItem.sharepointIds = MicrosoftGraphSharepointIds.fromJson(reader); + } else if ("analytics".equals(fieldName)) { + deserializedMicrosoftGraphListItem.analytics = MicrosoftGraphItemAnalytics.fromJson(reader); + } else if ("driveItem".equals(fieldName)) { + deserializedMicrosoftGraphListItem.driveItem = MicrosoftGraphDriveItem.fromJson(reader); + } else if ("fields".equals(fieldName)) { + deserializedMicrosoftGraphListItem.fields = MicrosoftGraphFieldValueSet.fromJson(reader); + } else if ("versions".equals(fieldName)) { + List versions + = reader.readArray(reader1 -> MicrosoftGraphListItemVersion.fromJson(reader1)); + deserializedMicrosoftGraphListItem.versions = versions; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphListItem.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphListItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListItemVersion.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListItemVersion.java index 1af7cb4e1579b..20cfd286ab043 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListItemVersion.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphListItemVersion.java @@ -5,35 +5,40 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** listItemVersion. */ +/** + * listItemVersion. + */ @Fluent public final class MicrosoftGraphListItemVersion extends MicrosoftGraphBaseItemVersion { /* * fieldValueSet */ - @JsonProperty(value = "fields") private MicrosoftGraphFieldValueSet fields; /* * listItemVersion */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphListItemVersion class. */ + /** + * Creates an instance of MicrosoftGraphListItemVersion class. + */ public MicrosoftGraphListItemVersion() { } /** * Get the fields property: fieldValueSet. - * + * * @return the fields value. */ public MicrosoftGraphFieldValueSet fields() { @@ -42,7 +47,7 @@ public MicrosoftGraphFieldValueSet fields() { /** * Set the fields property: fieldValueSet. - * + * * @param fields the fields value to set. * @return the MicrosoftGraphListItemVersion object itself. */ @@ -53,17 +58,16 @@ public MicrosoftGraphListItemVersion withFields(MicrosoftGraphFieldValueSet fiel /** * Get the additionalProperties property: listItemVersion. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: listItemVersion. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphListItemVersion object itself. */ @@ -72,36 +76,36 @@ public MicrosoftGraphListItemVersion withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItemVersion withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItemVersion withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItemVersion withPublication(MicrosoftGraphPublicationFacet publication) { super.withPublication(publication); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphListItemVersion withId(String id) { super.withId(id); @@ -110,7 +114,7 @@ public MicrosoftGraphListItemVersion withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -120,4 +124,70 @@ public void validate() { fields().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeJsonField("publication", publication()); + jsonWriter.writeJsonField("fields", this.fields); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphListItemVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphListItemVersion 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 MicrosoftGraphListItemVersion. + */ + public static MicrosoftGraphListItemVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphListItemVersion deserializedMicrosoftGraphListItemVersion + = new MicrosoftGraphListItemVersion(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphListItemVersion.withId(reader.getString()); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphListItemVersion + .withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphListItemVersion.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("publication".equals(fieldName)) { + deserializedMicrosoftGraphListItemVersion + .withPublication(MicrosoftGraphPublicationFacet.fromJson(reader)); + } else if ("fields".equals(fieldName)) { + deserializedMicrosoftGraphListItemVersion.fields = MicrosoftGraphFieldValueSet.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphListItemVersion.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphListItemVersion; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLobbyBypassScope.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLobbyBypassScope.java index a1d4f382fe991..32053f793cd51 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLobbyBypassScope.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLobbyBypassScope.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** lobbyBypassScope. */ +/** + * lobbyBypassScope. + */ public final class MicrosoftGraphLobbyBypassScope extends ExpandableStringEnum { - /** Static value organizer for MicrosoftGraphLobbyBypassScope. */ + /** + * Static value organizer for MicrosoftGraphLobbyBypassScope. + */ public static final MicrosoftGraphLobbyBypassScope ORGANIZER = fromString("organizer"); - /** Static value organization for MicrosoftGraphLobbyBypassScope. */ + /** + * Static value organization for MicrosoftGraphLobbyBypassScope. + */ public static final MicrosoftGraphLobbyBypassScope ORGANIZATION = fromString("organization"); - /** Static value organizationAndFederated for MicrosoftGraphLobbyBypassScope. */ - public static final MicrosoftGraphLobbyBypassScope ORGANIZATION_AND_FEDERATED = - fromString("organizationAndFederated"); + /** + * Static value organizationAndFederated for MicrosoftGraphLobbyBypassScope. + */ + public static final MicrosoftGraphLobbyBypassScope ORGANIZATION_AND_FEDERATED + = fromString("organizationAndFederated"); - /** Static value everyone for MicrosoftGraphLobbyBypassScope. */ + /** + * Static value everyone for MicrosoftGraphLobbyBypassScope. + */ public static final MicrosoftGraphLobbyBypassScope EVERYONE = fromString("everyone"); - /** Static value unknownFutureValue for MicrosoftGraphLobbyBypassScope. */ + /** + * Static value unknownFutureValue for MicrosoftGraphLobbyBypassScope. + */ public static final MicrosoftGraphLobbyBypassScope UNKNOWN_FUTURE_VALUE = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphLobbyBypassScope value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public MicrosoftGraphLobbyBypassScope() { /** * Creates or finds a MicrosoftGraphLobbyBypassScope from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphLobbyBypassScope. */ - @JsonCreator public static MicrosoftGraphLobbyBypassScope fromString(String name) { return fromString(name, MicrosoftGraphLobbyBypassScope.class); } /** * Gets known MicrosoftGraphLobbyBypassScope values. - * + * * @return known MicrosoftGraphLobbyBypassScope values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLobbyBypassSettings.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLobbyBypassSettings.java index 285c882ef9a19..8eee636469403 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLobbyBypassSettings.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLobbyBypassSettings.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** lobbyBypassSettings. */ +/** + * lobbyBypassSettings. + */ @Fluent -public final class MicrosoftGraphLobbyBypassSettings { +public final class MicrosoftGraphLobbyBypassSettings implements JsonSerializable { /* * Specifies whether or not to always let dial-in callers bypass the lobby. Optional. */ - @JsonProperty(value = "isDialInBypassEnabled") private Boolean isDialInBypassEnabled; /* * lobbyBypassScope */ - @JsonProperty(value = "scope") private MicrosoftGraphLobbyBypassScope scope; /* * lobbyBypassSettings */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphLobbyBypassSettings class. */ + /** + * Creates an instance of MicrosoftGraphLobbyBypassSettings class. + */ public MicrosoftGraphLobbyBypassSettings() { } /** * Get the isDialInBypassEnabled property: Specifies whether or not to always let dial-in callers bypass the lobby. * Optional. - * + * * @return the isDialInBypassEnabled value. */ public Boolean isDialInBypassEnabled() { @@ -49,7 +52,7 @@ public Boolean isDialInBypassEnabled() { /** * Set the isDialInBypassEnabled property: Specifies whether or not to always let dial-in callers bypass the lobby. * Optional. - * + * * @param isDialInBypassEnabled the isDialInBypassEnabled value to set. * @return the MicrosoftGraphLobbyBypassSettings object itself. */ @@ -60,7 +63,7 @@ public MicrosoftGraphLobbyBypassSettings withIsDialInBypassEnabled(Boolean isDia /** * Get the scope property: lobbyBypassScope. - * + * * @return the scope value. */ public MicrosoftGraphLobbyBypassScope scope() { @@ -69,7 +72,7 @@ public MicrosoftGraphLobbyBypassScope scope() { /** * Set the scope property: lobbyBypassScope. - * + * * @param scope the scope value to set. * @return the MicrosoftGraphLobbyBypassSettings object itself. */ @@ -80,17 +83,16 @@ public MicrosoftGraphLobbyBypassSettings withScope(MicrosoftGraphLobbyBypassScop /** * Get the additionalProperties property: lobbyBypassSettings. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: lobbyBypassSettings. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphLobbyBypassSettings object itself. */ @@ -99,19 +101,64 @@ public MicrosoftGraphLobbyBypassSettings withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isDialInBypassEnabled", this.isDialInBypassEnabled); + jsonWriter.writeStringField("scope", this.scope == null ? null : this.scope.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphLobbyBypassSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphLobbyBypassSettings 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 MicrosoftGraphLobbyBypassSettings. + */ + public static MicrosoftGraphLobbyBypassSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphLobbyBypassSettings deserializedMicrosoftGraphLobbyBypassSettings + = new MicrosoftGraphLobbyBypassSettings(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isDialInBypassEnabled".equals(fieldName)) { + deserializedMicrosoftGraphLobbyBypassSettings.isDialInBypassEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("scope".equals(fieldName)) { + deserializedMicrosoftGraphLobbyBypassSettings.scope + = MicrosoftGraphLobbyBypassScope.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphLobbyBypassSettings.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphLobbyBypassSettings; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocaleInfo.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocaleInfo.java index 5c12d5c8a4406..6556d79c3309f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocaleInfo.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocaleInfo.java @@ -5,20 +5,22 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** localeInfo. */ +/** + * localeInfo. + */ @Fluent -public final class MicrosoftGraphLocaleInfo { +public final class MicrosoftGraphLocaleInfo implements JsonSerializable { /* * A name representing the user's locale in natural language, for example, 'English (United States)'. */ - @JsonProperty(value = "displayName") private String displayName; /* @@ -26,22 +28,23 @@ public final class MicrosoftGraphLocaleInfo { * example, 'en-us'. The language component follows 2-letter codes as defined in ISO 639-1, and the country * component follows 2-letter codes as defined in ISO 3166-1 alpha-2. */ - @JsonProperty(value = "locale") private String locale; /* * localeInfo */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphLocaleInfo class. */ + /** + * Creates an instance of MicrosoftGraphLocaleInfo class. + */ public MicrosoftGraphLocaleInfo() { } /** * Get the displayName property: A name representing the user's locale in natural language, for example, 'English * (United States)'. - * + * * @return the displayName value. */ public String displayName() { @@ -51,7 +54,7 @@ public String displayName() { /** * Set the displayName property: A name representing the user's locale in natural language, for example, 'English * (United States)'. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphLocaleInfo object itself. */ @@ -64,7 +67,7 @@ public MicrosoftGraphLocaleInfo withDisplayName(String displayName) { * Get the locale property: A locale representation for the user, which includes the user's preferred language and * country/region. For example, 'en-us'. The language component follows 2-letter codes as defined in ISO 639-1, and * the country component follows 2-letter codes as defined in ISO 3166-1 alpha-2. - * + * * @return the locale value. */ public String locale() { @@ -75,7 +78,7 @@ public String locale() { * Set the locale property: A locale representation for the user, which includes the user's preferred language and * country/region. For example, 'en-us'. The language component follows 2-letter codes as defined in ISO 639-1, and * the country component follows 2-letter codes as defined in ISO 3166-1 alpha-2. - * + * * @param locale the locale value to set. * @return the MicrosoftGraphLocaleInfo object itself. */ @@ -86,17 +89,16 @@ public MicrosoftGraphLocaleInfo withLocale(String locale) { /** * Get the additionalProperties property: localeInfo. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: localeInfo. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphLocaleInfo object itself. */ @@ -105,19 +107,61 @@ public MicrosoftGraphLocaleInfo withAdditionalProperties(Map add return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("locale", this.locale); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphLocaleInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphLocaleInfo 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 MicrosoftGraphLocaleInfo. + */ + public static MicrosoftGraphLocaleInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphLocaleInfo deserializedMicrosoftGraphLocaleInfo = new MicrosoftGraphLocaleInfo(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphLocaleInfo.displayName = reader.getString(); + } else if ("locale".equals(fieldName)) { + deserializedMicrosoftGraphLocaleInfo.locale = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphLocaleInfo.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphLocaleInfo; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocation.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocation.java index 15fac9ade05fa..a32dbcd31a0d9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocation.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocation.java @@ -5,76 +5,73 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** location. */ +/** + * location. + */ @Fluent -public final class MicrosoftGraphLocation { +public final class MicrosoftGraphLocation implements JsonSerializable { /* * physicalAddress */ - @JsonProperty(value = "address") private MicrosoftGraphPhysicalAddress address; /* * outlookGeoCoordinates */ - @JsonProperty(value = "coordinates") private MicrosoftGraphOutlookGeoCoordinates coordinates; /* * The name associated with the location. */ - @JsonProperty(value = "displayName") private String displayName; /* * Optional email address of the location. */ - @JsonProperty(value = "locationEmailAddress") private String locationEmailAddress; /* * locationType */ - @JsonProperty(value = "locationType") private MicrosoftGraphLocationType locationType; /* * Optional URI representing the location. */ - @JsonProperty(value = "locationUri") private String locationUri; /* * For internal use only. */ - @JsonProperty(value = "uniqueId") private String uniqueId; /* * locationUniqueIdType */ - @JsonProperty(value = "uniqueIdType") private MicrosoftGraphLocationUniqueIdType uniqueIdType; /* * location */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphLocation class. */ + /** + * Creates an instance of MicrosoftGraphLocation class. + */ public MicrosoftGraphLocation() { } /** * Get the address property: physicalAddress. - * + * * @return the address value. */ public MicrosoftGraphPhysicalAddress address() { @@ -83,7 +80,7 @@ public MicrosoftGraphPhysicalAddress address() { /** * Set the address property: physicalAddress. - * + * * @param address the address value to set. * @return the MicrosoftGraphLocation object itself. */ @@ -94,7 +91,7 @@ public MicrosoftGraphLocation withAddress(MicrosoftGraphPhysicalAddress address) /** * Get the coordinates property: outlookGeoCoordinates. - * + * * @return the coordinates value. */ public MicrosoftGraphOutlookGeoCoordinates coordinates() { @@ -103,7 +100,7 @@ public MicrosoftGraphOutlookGeoCoordinates coordinates() { /** * Set the coordinates property: outlookGeoCoordinates. - * + * * @param coordinates the coordinates value to set. * @return the MicrosoftGraphLocation object itself. */ @@ -114,7 +111,7 @@ public MicrosoftGraphLocation withCoordinates(MicrosoftGraphOutlookGeoCoordinate /** * Get the displayName property: The name associated with the location. - * + * * @return the displayName value. */ public String displayName() { @@ -123,7 +120,7 @@ public String displayName() { /** * Set the displayName property: The name associated with the location. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphLocation object itself. */ @@ -134,7 +131,7 @@ public MicrosoftGraphLocation withDisplayName(String displayName) { /** * Get the locationEmailAddress property: Optional email address of the location. - * + * * @return the locationEmailAddress value. */ public String locationEmailAddress() { @@ -143,7 +140,7 @@ public String locationEmailAddress() { /** * Set the locationEmailAddress property: Optional email address of the location. - * + * * @param locationEmailAddress the locationEmailAddress value to set. * @return the MicrosoftGraphLocation object itself. */ @@ -154,7 +151,7 @@ public MicrosoftGraphLocation withLocationEmailAddress(String locationEmailAddre /** * Get the locationType property: locationType. - * + * * @return the locationType value. */ public MicrosoftGraphLocationType locationType() { @@ -163,7 +160,7 @@ public MicrosoftGraphLocationType locationType() { /** * Set the locationType property: locationType. - * + * * @param locationType the locationType value to set. * @return the MicrosoftGraphLocation object itself. */ @@ -174,7 +171,7 @@ public MicrosoftGraphLocation withLocationType(MicrosoftGraphLocationType locati /** * Get the locationUri property: Optional URI representing the location. - * + * * @return the locationUri value. */ public String locationUri() { @@ -183,7 +180,7 @@ public String locationUri() { /** * Set the locationUri property: Optional URI representing the location. - * + * * @param locationUri the locationUri value to set. * @return the MicrosoftGraphLocation object itself. */ @@ -194,7 +191,7 @@ public MicrosoftGraphLocation withLocationUri(String locationUri) { /** * Get the uniqueId property: For internal use only. - * + * * @return the uniqueId value. */ public String uniqueId() { @@ -203,7 +200,7 @@ public String uniqueId() { /** * Set the uniqueId property: For internal use only. - * + * * @param uniqueId the uniqueId value to set. * @return the MicrosoftGraphLocation object itself. */ @@ -214,7 +211,7 @@ public MicrosoftGraphLocation withUniqueId(String uniqueId) { /** * Get the uniqueIdType property: locationUniqueIdType. - * + * * @return the uniqueIdType value. */ public MicrosoftGraphLocationUniqueIdType uniqueIdType() { @@ -223,7 +220,7 @@ public MicrosoftGraphLocationUniqueIdType uniqueIdType() { /** * Set the uniqueIdType property: locationUniqueIdType. - * + * * @param uniqueIdType the uniqueIdType value to set. * @return the MicrosoftGraphLocation object itself. */ @@ -234,17 +231,16 @@ public MicrosoftGraphLocation withUniqueIdType(MicrosoftGraphLocationUniqueIdTyp /** * Get the additionalProperties property: location. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: location. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphLocation object itself. */ @@ -253,17 +249,9 @@ public MicrosoftGraphLocation withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -274,4 +262,75 @@ public void validate() { coordinates().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("address", this.address); + jsonWriter.writeJsonField("coordinates", this.coordinates); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("locationEmailAddress", this.locationEmailAddress); + jsonWriter.writeStringField("locationType", this.locationType == null ? null : this.locationType.toString()); + jsonWriter.writeStringField("locationUri", this.locationUri); + jsonWriter.writeStringField("uniqueId", this.uniqueId); + jsonWriter.writeStringField("uniqueIdType", this.uniqueIdType == null ? null : this.uniqueIdType.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphLocation 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 MicrosoftGraphLocation. + */ + public static MicrosoftGraphLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphLocation deserializedMicrosoftGraphLocation = new MicrosoftGraphLocation(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedMicrosoftGraphLocation.address = MicrosoftGraphPhysicalAddress.fromJson(reader); + } else if ("coordinates".equals(fieldName)) { + deserializedMicrosoftGraphLocation.coordinates + = MicrosoftGraphOutlookGeoCoordinates.fromJson(reader); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphLocation.displayName = reader.getString(); + } else if ("locationEmailAddress".equals(fieldName)) { + deserializedMicrosoftGraphLocation.locationEmailAddress = reader.getString(); + } else if ("locationType".equals(fieldName)) { + deserializedMicrosoftGraphLocation.locationType + = MicrosoftGraphLocationType.fromString(reader.getString()); + } else if ("locationUri".equals(fieldName)) { + deserializedMicrosoftGraphLocation.locationUri = reader.getString(); + } else if ("uniqueId".equals(fieldName)) { + deserializedMicrosoftGraphLocation.uniqueId = reader.getString(); + } else if ("uniqueIdType".equals(fieldName)) { + deserializedMicrosoftGraphLocation.uniqueIdType + = MicrosoftGraphLocationUniqueIdType.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphLocation.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphLocation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocationType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocationType.java index a654dc9541bc5..32652548fb2b4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocationType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocationType.java @@ -5,44 +5,65 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** locationType. */ +/** + * locationType. + */ public final class MicrosoftGraphLocationType extends ExpandableStringEnum { - /** Static value default for MicrosoftGraphLocationType. */ + /** + * Static value default for MicrosoftGraphLocationType. + */ public static final MicrosoftGraphLocationType DEFAULT = fromString("default"); - /** Static value conferenceRoom for MicrosoftGraphLocationType. */ + /** + * Static value conferenceRoom for MicrosoftGraphLocationType. + */ public static final MicrosoftGraphLocationType CONFERENCE_ROOM = fromString("conferenceRoom"); - /** Static value homeAddress for MicrosoftGraphLocationType. */ + /** + * Static value homeAddress for MicrosoftGraphLocationType. + */ public static final MicrosoftGraphLocationType HOME_ADDRESS = fromString("homeAddress"); - /** Static value businessAddress for MicrosoftGraphLocationType. */ + /** + * Static value businessAddress for MicrosoftGraphLocationType. + */ public static final MicrosoftGraphLocationType BUSINESS_ADDRESS = fromString("businessAddress"); - /** Static value geoCoordinates for MicrosoftGraphLocationType. */ + /** + * Static value geoCoordinates for MicrosoftGraphLocationType. + */ public static final MicrosoftGraphLocationType GEO_COORDINATES = fromString("geoCoordinates"); - /** Static value streetAddress for MicrosoftGraphLocationType. */ + /** + * Static value streetAddress for MicrosoftGraphLocationType. + */ public static final MicrosoftGraphLocationType STREET_ADDRESS = fromString("streetAddress"); - /** Static value hotel for MicrosoftGraphLocationType. */ + /** + * Static value hotel for MicrosoftGraphLocationType. + */ public static final MicrosoftGraphLocationType HOTEL = fromString("hotel"); - /** Static value restaurant for MicrosoftGraphLocationType. */ + /** + * Static value restaurant for MicrosoftGraphLocationType. + */ public static final MicrosoftGraphLocationType RESTAURANT = fromString("restaurant"); - /** Static value localBusiness for MicrosoftGraphLocationType. */ + /** + * Static value localBusiness for MicrosoftGraphLocationType. + */ public static final MicrosoftGraphLocationType LOCAL_BUSINESS = fromString("localBusiness"); - /** Static value postalAddress for MicrosoftGraphLocationType. */ + /** + * Static value postalAddress for MicrosoftGraphLocationType. + */ public static final MicrosoftGraphLocationType POSTAL_ADDRESS = fromString("postalAddress"); /** * Creates a new instance of MicrosoftGraphLocationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -51,18 +72,17 @@ public MicrosoftGraphLocationType() { /** * Creates or finds a MicrosoftGraphLocationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphLocationType. */ - @JsonCreator public static MicrosoftGraphLocationType fromString(String name) { return fromString(name, MicrosoftGraphLocationType.class); } /** * Gets known MicrosoftGraphLocationType values. - * + * * @return known MicrosoftGraphLocationType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocationUniqueIdType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocationUniqueIdType.java index 90d068122d93f..1008192c3af2f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocationUniqueIdType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLocationUniqueIdType.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** locationUniqueIdType. */ +/** + * locationUniqueIdType. + */ public final class MicrosoftGraphLocationUniqueIdType extends ExpandableStringEnum { - /** Static value unknown for MicrosoftGraphLocationUniqueIdType. */ + /** + * Static value unknown for MicrosoftGraphLocationUniqueIdType. + */ public static final MicrosoftGraphLocationUniqueIdType UNKNOWN = fromString("unknown"); - /** Static value locationStore for MicrosoftGraphLocationUniqueIdType. */ + /** + * Static value locationStore for MicrosoftGraphLocationUniqueIdType. + */ public static final MicrosoftGraphLocationUniqueIdType LOCATION_STORE = fromString("locationStore"); - /** Static value directory for MicrosoftGraphLocationUniqueIdType. */ + /** + * Static value directory for MicrosoftGraphLocationUniqueIdType. + */ public static final MicrosoftGraphLocationUniqueIdType DIRECTORY = fromString("directory"); - /** Static value private for MicrosoftGraphLocationUniqueIdType. */ + /** + * Static value private for MicrosoftGraphLocationUniqueIdType. + */ public static final MicrosoftGraphLocationUniqueIdType PRIVATE = fromString("private"); - /** Static value bing for MicrosoftGraphLocationUniqueIdType. */ + /** + * Static value bing for MicrosoftGraphLocationUniqueIdType. + */ public static final MicrosoftGraphLocationUniqueIdType BING = fromString("bing"); /** * Creates a new instance of MicrosoftGraphLocationUniqueIdType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public MicrosoftGraphLocationUniqueIdType() { /** * Creates or finds a MicrosoftGraphLocationUniqueIdType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphLocationUniqueIdType. */ - @JsonCreator public static MicrosoftGraphLocationUniqueIdType fromString(String name) { return fromString(name, MicrosoftGraphLocationUniqueIdType.class); } /** * Gets known MicrosoftGraphLocationUniqueIdType values. - * + * * @return known MicrosoftGraphLocationUniqueIdType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLookupColumn.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLookupColumn.java index 6b742021d9d40..c88745e1acede 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLookupColumn.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphLookupColumn.java @@ -5,59 +5,59 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** lookupColumn. */ +/** + * lookupColumn. + */ @Fluent -public final class MicrosoftGraphLookupColumn { +public final class MicrosoftGraphLookupColumn implements JsonSerializable { /* * Indicates whether multiple values can be selected from the source. */ - @JsonProperty(value = "allowMultipleValues") private Boolean allowMultipleValues; /* * Indicates whether values in the column should be able to exceed the standard limit of 255 characters. */ - @JsonProperty(value = "allowUnlimitedLength") private Boolean allowUnlimitedLength; /* * The name of the lookup source column. */ - @JsonProperty(value = "columnName") private String columnName; /* * The unique identifier of the lookup source list. */ - @JsonProperty(value = "listId") private String listId; /* * If specified, this column is a secondary lookup, pulling an additional field from the list item looked up by the * primary lookup. Use the list item looked up by the primary as the source for the column named here. */ - @JsonProperty(value = "primaryLookupColumnId") private String primaryLookupColumnId; /* * lookupColumn */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphLookupColumn class. */ + /** + * Creates an instance of MicrosoftGraphLookupColumn class. + */ public MicrosoftGraphLookupColumn() { } /** * Get the allowMultipleValues property: Indicates whether multiple values can be selected from the source. - * + * * @return the allowMultipleValues value. */ public Boolean allowMultipleValues() { @@ -66,7 +66,7 @@ public Boolean allowMultipleValues() { /** * Set the allowMultipleValues property: Indicates whether multiple values can be selected from the source. - * + * * @param allowMultipleValues the allowMultipleValues value to set. * @return the MicrosoftGraphLookupColumn object itself. */ @@ -78,7 +78,7 @@ public MicrosoftGraphLookupColumn withAllowMultipleValues(Boolean allowMultipleV /** * Get the allowUnlimitedLength property: Indicates whether values in the column should be able to exceed the * standard limit of 255 characters. - * + * * @return the allowUnlimitedLength value. */ public Boolean allowUnlimitedLength() { @@ -88,7 +88,7 @@ public Boolean allowUnlimitedLength() { /** * Set the allowUnlimitedLength property: Indicates whether values in the column should be able to exceed the * standard limit of 255 characters. - * + * * @param allowUnlimitedLength the allowUnlimitedLength value to set. * @return the MicrosoftGraphLookupColumn object itself. */ @@ -99,7 +99,7 @@ public MicrosoftGraphLookupColumn withAllowUnlimitedLength(Boolean allowUnlimite /** * Get the columnName property: The name of the lookup source column. - * + * * @return the columnName value. */ public String columnName() { @@ -108,7 +108,7 @@ public String columnName() { /** * Set the columnName property: The name of the lookup source column. - * + * * @param columnName the columnName value to set. * @return the MicrosoftGraphLookupColumn object itself. */ @@ -119,7 +119,7 @@ public MicrosoftGraphLookupColumn withColumnName(String columnName) { /** * Get the listId property: The unique identifier of the lookup source list. - * + * * @return the listId value. */ public String listId() { @@ -128,7 +128,7 @@ public String listId() { /** * Set the listId property: The unique identifier of the lookup source list. - * + * * @param listId the listId value to set. * @return the MicrosoftGraphLookupColumn object itself. */ @@ -141,7 +141,7 @@ public MicrosoftGraphLookupColumn withListId(String listId) { * Get the primaryLookupColumnId property: If specified, this column is a secondary lookup, pulling an additional * field from the list item looked up by the primary lookup. Use the list item looked up by the primary as the * source for the column named here. - * + * * @return the primaryLookupColumnId value. */ public String primaryLookupColumnId() { @@ -152,7 +152,7 @@ public String primaryLookupColumnId() { * Set the primaryLookupColumnId property: If specified, this column is a secondary lookup, pulling an additional * field from the list item looked up by the primary lookup. Use the list item looked up by the primary as the * source for the column named here. - * + * * @param primaryLookupColumnId the primaryLookupColumnId value to set. * @return the MicrosoftGraphLookupColumn object itself. */ @@ -163,17 +163,16 @@ public MicrosoftGraphLookupColumn withPrimaryLookupColumnId(String primaryLookup /** * Get the additionalProperties property: lookupColumn. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: lookupColumn. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphLookupColumn object itself. */ @@ -182,19 +181,72 @@ public MicrosoftGraphLookupColumn withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowMultipleValues", this.allowMultipleValues); + jsonWriter.writeBooleanField("allowUnlimitedLength", this.allowUnlimitedLength); + jsonWriter.writeStringField("columnName", this.columnName); + jsonWriter.writeStringField("listId", this.listId); + jsonWriter.writeStringField("primaryLookupColumnId", this.primaryLookupColumnId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphLookupColumn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphLookupColumn 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 MicrosoftGraphLookupColumn. + */ + public static MicrosoftGraphLookupColumn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphLookupColumn deserializedMicrosoftGraphLookupColumn = new MicrosoftGraphLookupColumn(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowMultipleValues".equals(fieldName)) { + deserializedMicrosoftGraphLookupColumn.allowMultipleValues + = reader.getNullable(JsonReader::getBoolean); + } else if ("allowUnlimitedLength".equals(fieldName)) { + deserializedMicrosoftGraphLookupColumn.allowUnlimitedLength + = reader.getNullable(JsonReader::getBoolean); + } else if ("columnName".equals(fieldName)) { + deserializedMicrosoftGraphLookupColumn.columnName = reader.getString(); + } else if ("listId".equals(fieldName)) { + deserializedMicrosoftGraphLookupColumn.listId = reader.getString(); + } else if ("primaryLookupColumnId".equals(fieldName)) { + deserializedMicrosoftGraphLookupColumn.primaryLookupColumnId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphLookupColumn.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphLookupColumn; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMailFolder.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMailFolder.java index 068ea2d496b1e..84155d55a5cc6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMailFolder.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMailFolder.java @@ -5,89 +5,83 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** mailFolder. */ +/** + * mailFolder. + */ @Fluent public final class MicrosoftGraphMailFolder extends MicrosoftGraphEntity { /* * The number of immediate child mailFolders in the current mailFolder. */ - @JsonProperty(value = "childFolderCount") private Integer childFolderCount; /* * The mailFolder's display name. */ - @JsonProperty(value = "displayName") private String displayName; /* * The unique identifier for the mailFolder's parent mailFolder. */ - @JsonProperty(value = "parentFolderId") private String parentFolderId; /* * The number of items in the mailFolder. */ - @JsonProperty(value = "totalItemCount") private Integer totalItemCount; /* * The number of items in the mailFolder marked as unread. */ - @JsonProperty(value = "unreadItemCount") private Integer unreadItemCount; /* * The collection of child folders in the mailFolder. */ - @JsonProperty(value = "childFolders") private List childFolders; /* * The collection of rules that apply to the user's Inbox folder. */ - @JsonProperty(value = "messageRules") private List messageRules; /* * The collection of messages in the mailFolder. */ - @JsonProperty(value = "messages") private List messages; /* * The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable. */ - @JsonProperty(value = "multiValueExtendedProperties") private List multiValueExtendedProperties; /* * The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable. */ - @JsonProperty(value = "singleValueExtendedProperties") private List singleValueExtendedProperties; /* * mailFolder */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphMailFolder class. */ + /** + * Creates an instance of MicrosoftGraphMailFolder class. + */ public MicrosoftGraphMailFolder() { } /** * Get the childFolderCount property: The number of immediate child mailFolders in the current mailFolder. - * + * * @return the childFolderCount value. */ public Integer childFolderCount() { @@ -96,7 +90,7 @@ public Integer childFolderCount() { /** * Set the childFolderCount property: The number of immediate child mailFolders in the current mailFolder. - * + * * @param childFolderCount the childFolderCount value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -107,7 +101,7 @@ public MicrosoftGraphMailFolder withChildFolderCount(Integer childFolderCount) { /** * Get the displayName property: The mailFolder's display name. - * + * * @return the displayName value. */ public String displayName() { @@ -116,7 +110,7 @@ public String displayName() { /** * Set the displayName property: The mailFolder's display name. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -127,7 +121,7 @@ public MicrosoftGraphMailFolder withDisplayName(String displayName) { /** * Get the parentFolderId property: The unique identifier for the mailFolder's parent mailFolder. - * + * * @return the parentFolderId value. */ public String parentFolderId() { @@ -136,7 +130,7 @@ public String parentFolderId() { /** * Set the parentFolderId property: The unique identifier for the mailFolder's parent mailFolder. - * + * * @param parentFolderId the parentFolderId value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -147,7 +141,7 @@ public MicrosoftGraphMailFolder withParentFolderId(String parentFolderId) { /** * Get the totalItemCount property: The number of items in the mailFolder. - * + * * @return the totalItemCount value. */ public Integer totalItemCount() { @@ -156,7 +150,7 @@ public Integer totalItemCount() { /** * Set the totalItemCount property: The number of items in the mailFolder. - * + * * @param totalItemCount the totalItemCount value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -167,7 +161,7 @@ public MicrosoftGraphMailFolder withTotalItemCount(Integer totalItemCount) { /** * Get the unreadItemCount property: The number of items in the mailFolder marked as unread. - * + * * @return the unreadItemCount value. */ public Integer unreadItemCount() { @@ -176,7 +170,7 @@ public Integer unreadItemCount() { /** * Set the unreadItemCount property: The number of items in the mailFolder marked as unread. - * + * * @param unreadItemCount the unreadItemCount value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -187,7 +181,7 @@ public MicrosoftGraphMailFolder withUnreadItemCount(Integer unreadItemCount) { /** * Get the childFolders property: The collection of child folders in the mailFolder. - * + * * @return the childFolders value. */ public List childFolders() { @@ -196,7 +190,7 @@ public List childFolders() { /** * Set the childFolders property: The collection of child folders in the mailFolder. - * + * * @param childFolders the childFolders value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -207,7 +201,7 @@ public MicrosoftGraphMailFolder withChildFolders(List /** * Get the messageRules property: The collection of rules that apply to the user's Inbox folder. - * + * * @return the messageRules value. */ public List messageRules() { @@ -216,7 +210,7 @@ public List messageRules() { /** * Set the messageRules property: The collection of rules that apply to the user's Inbox folder. - * + * * @param messageRules the messageRules value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -227,7 +221,7 @@ public MicrosoftGraphMailFolder withMessageRules(List /** * Get the messages property: The collection of messages in the mailFolder. - * + * * @return the messages value. */ public List messages() { @@ -236,7 +230,7 @@ public List messages() { /** * Set the messages property: The collection of messages in the mailFolder. - * + * * @param messages the messages value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -248,7 +242,7 @@ public MicrosoftGraphMailFolder withMessages(List message /** * Get the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * mailFolder. Read-only. Nullable. - * + * * @return the multiValueExtendedProperties value. */ public List multiValueExtendedProperties() { @@ -258,7 +252,7 @@ public List multiValueExtendedPr /** * Set the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * mailFolder. Read-only. Nullable. - * + * * @param multiValueExtendedProperties the multiValueExtendedProperties value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -271,7 +265,7 @@ public MicrosoftGraphMailFolder withMultiValueExtendedProperties( /** * Get the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the mailFolder. Read-only. Nullable. - * + * * @return the singleValueExtendedProperties value. */ public List singleValueExtendedProperties() { @@ -281,7 +275,7 @@ public List singleValueExtended /** * Set the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the mailFolder. Read-only. Nullable. - * + * * @param singleValueExtendedProperties the singleValueExtendedProperties value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -293,17 +287,16 @@ public MicrosoftGraphMailFolder withSingleValueExtendedProperties( /** * Get the additionalProperties property: mailFolder. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: mailFolder. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphMailFolder object itself. */ @@ -312,15 +305,9 @@ public MicrosoftGraphMailFolder withAdditionalProperties(Map add return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphMailFolder withId(String id) { super.withId(id); @@ -329,7 +316,7 @@ public MicrosoftGraphMailFolder withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -351,4 +338,93 @@ public void validate() { singleValueExtendedProperties().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeNumberField("childFolderCount", this.childFolderCount); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("parentFolderId", this.parentFolderId); + jsonWriter.writeNumberField("totalItemCount", this.totalItemCount); + jsonWriter.writeNumberField("unreadItemCount", this.unreadItemCount); + jsonWriter.writeArrayField("childFolders", this.childFolders, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("messageRules", this.messageRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("messages", this.messages, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("multiValueExtendedProperties", this.multiValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("singleValueExtendedProperties", this.singleValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphMailFolder from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphMailFolder 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 MicrosoftGraphMailFolder. + */ + public static MicrosoftGraphMailFolder fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphMailFolder deserializedMicrosoftGraphMailFolder = new MicrosoftGraphMailFolder(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphMailFolder.withId(reader.getString()); + } else if ("childFolderCount".equals(fieldName)) { + deserializedMicrosoftGraphMailFolder.childFolderCount = reader.getNullable(JsonReader::getInt); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphMailFolder.displayName = reader.getString(); + } else if ("parentFolderId".equals(fieldName)) { + deserializedMicrosoftGraphMailFolder.parentFolderId = reader.getString(); + } else if ("totalItemCount".equals(fieldName)) { + deserializedMicrosoftGraphMailFolder.totalItemCount = reader.getNullable(JsonReader::getInt); + } else if ("unreadItemCount".equals(fieldName)) { + deserializedMicrosoftGraphMailFolder.unreadItemCount = reader.getNullable(JsonReader::getInt); + } else if ("childFolders".equals(fieldName)) { + List childFolders + = reader.readArray(reader1 -> MicrosoftGraphMailFolder.fromJson(reader1)); + deserializedMicrosoftGraphMailFolder.childFolders = childFolders; + } else if ("messageRules".equals(fieldName)) { + List messageRules + = reader.readArray(reader1 -> MicrosoftGraphMessageRule.fromJson(reader1)); + deserializedMicrosoftGraphMailFolder.messageRules = messageRules; + } else if ("messages".equals(fieldName)) { + List messages + = reader.readArray(reader1 -> MicrosoftGraphMessage.fromJson(reader1)); + deserializedMicrosoftGraphMailFolder.messages = messages; + } else if ("multiValueExtendedProperties".equals(fieldName)) { + List multiValueExtendedProperties + = reader.readArray(reader1 -> MicrosoftGraphMultiValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphMailFolder.multiValueExtendedProperties = multiValueExtendedProperties; + } else if ("singleValueExtendedProperties".equals(fieldName)) { + List singleValueExtendedProperties = reader + .readArray(reader1 -> MicrosoftGraphSingleValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphMailFolder.singleValueExtendedProperties = singleValueExtendedProperties; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphMailFolder.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphMailFolder; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMailboxSettings.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMailboxSettings.java index 9ca5269f2a454..659bd59660029 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMailboxSettings.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMailboxSettings.java @@ -5,76 +5,73 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** mailboxSettings. */ +/** + * mailboxSettings. + */ @Fluent -public final class MicrosoftGraphMailboxSettings { +public final class MicrosoftGraphMailboxSettings implements JsonSerializable { /* * Folder ID of an archive folder for the user. */ - @JsonProperty(value = "archiveFolder") private String archiveFolder; /* * automaticRepliesSetting */ - @JsonProperty(value = "automaticRepliesSetting") private MicrosoftGraphAutomaticRepliesSetting automaticRepliesSetting; /* * The date format for the user's mailbox. */ - @JsonProperty(value = "dateFormat") private String dateFormat; /* * delegateMeetingMessageDeliveryOptions */ - @JsonProperty(value = "delegateMeetingMessageDeliveryOptions") private MicrosoftGraphDelegateMeetingMessageDeliveryOptions delegateMeetingMessageDeliveryOptions; /* * localeInfo */ - @JsonProperty(value = "language") private MicrosoftGraphLocaleInfo language; /* * The time format for the user's mailbox. */ - @JsonProperty(value = "timeFormat") private String timeFormat; /* * The default time zone for the user's mailbox. */ - @JsonProperty(value = "timeZone") private String timeZone; /* * workingHours */ - @JsonProperty(value = "workingHours") private MicrosoftGraphWorkingHours workingHours; /* * mailboxSettings */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphMailboxSettings class. */ + /** + * Creates an instance of MicrosoftGraphMailboxSettings class. + */ public MicrosoftGraphMailboxSettings() { } /** * Get the archiveFolder property: Folder ID of an archive folder for the user. - * + * * @return the archiveFolder value. */ public String archiveFolder() { @@ -83,7 +80,7 @@ public String archiveFolder() { /** * Set the archiveFolder property: Folder ID of an archive folder for the user. - * + * * @param archiveFolder the archiveFolder value to set. * @return the MicrosoftGraphMailboxSettings object itself. */ @@ -94,7 +91,7 @@ public MicrosoftGraphMailboxSettings withArchiveFolder(String archiveFolder) { /** * Get the automaticRepliesSetting property: automaticRepliesSetting. - * + * * @return the automaticRepliesSetting value. */ public MicrosoftGraphAutomaticRepliesSetting automaticRepliesSetting() { @@ -103,19 +100,19 @@ public MicrosoftGraphAutomaticRepliesSetting automaticRepliesSetting() { /** * Set the automaticRepliesSetting property: automaticRepliesSetting. - * + * * @param automaticRepliesSetting the automaticRepliesSetting value to set. * @return the MicrosoftGraphMailboxSettings object itself. */ - public MicrosoftGraphMailboxSettings withAutomaticRepliesSetting( - MicrosoftGraphAutomaticRepliesSetting automaticRepliesSetting) { + public MicrosoftGraphMailboxSettings + withAutomaticRepliesSetting(MicrosoftGraphAutomaticRepliesSetting automaticRepliesSetting) { this.automaticRepliesSetting = automaticRepliesSetting; return this; } /** * Get the dateFormat property: The date format for the user's mailbox. - * + * * @return the dateFormat value. */ public String dateFormat() { @@ -124,7 +121,7 @@ public String dateFormat() { /** * Set the dateFormat property: The date format for the user's mailbox. - * + * * @param dateFormat the dateFormat value to set. * @return the MicrosoftGraphMailboxSettings object itself. */ @@ -135,7 +132,7 @@ public MicrosoftGraphMailboxSettings withDateFormat(String dateFormat) { /** * Get the delegateMeetingMessageDeliveryOptions property: delegateMeetingMessageDeliveryOptions. - * + * * @return the delegateMeetingMessageDeliveryOptions value. */ public MicrosoftGraphDelegateMeetingMessageDeliveryOptions delegateMeetingMessageDeliveryOptions() { @@ -144,7 +141,7 @@ public MicrosoftGraphDelegateMeetingMessageDeliveryOptions delegateMeetingMessag /** * Set the delegateMeetingMessageDeliveryOptions property: delegateMeetingMessageDeliveryOptions. - * + * * @param delegateMeetingMessageDeliveryOptions the delegateMeetingMessageDeliveryOptions value to set. * @return the MicrosoftGraphMailboxSettings object itself. */ @@ -156,7 +153,7 @@ public MicrosoftGraphMailboxSettings withDelegateMeetingMessageDeliveryOptions( /** * Get the language property: localeInfo. - * + * * @return the language value. */ public MicrosoftGraphLocaleInfo language() { @@ -165,7 +162,7 @@ public MicrosoftGraphLocaleInfo language() { /** * Set the language property: localeInfo. - * + * * @param language the language value to set. * @return the MicrosoftGraphMailboxSettings object itself. */ @@ -176,7 +173,7 @@ public MicrosoftGraphMailboxSettings withLanguage(MicrosoftGraphLocaleInfo langu /** * Get the timeFormat property: The time format for the user's mailbox. - * + * * @return the timeFormat value. */ public String timeFormat() { @@ -185,7 +182,7 @@ public String timeFormat() { /** * Set the timeFormat property: The time format for the user's mailbox. - * + * * @param timeFormat the timeFormat value to set. * @return the MicrosoftGraphMailboxSettings object itself. */ @@ -196,7 +193,7 @@ public MicrosoftGraphMailboxSettings withTimeFormat(String timeFormat) { /** * Get the timeZone property: The default time zone for the user's mailbox. - * + * * @return the timeZone value. */ public String timeZone() { @@ -205,7 +202,7 @@ public String timeZone() { /** * Set the timeZone property: The default time zone for the user's mailbox. - * + * * @param timeZone the timeZone value to set. * @return the MicrosoftGraphMailboxSettings object itself. */ @@ -216,7 +213,7 @@ public MicrosoftGraphMailboxSettings withTimeZone(String timeZone) { /** * Get the workingHours property: workingHours. - * + * * @return the workingHours value. */ public MicrosoftGraphWorkingHours workingHours() { @@ -225,7 +222,7 @@ public MicrosoftGraphWorkingHours workingHours() { /** * Set the workingHours property: workingHours. - * + * * @param workingHours the workingHours value to set. * @return the MicrosoftGraphMailboxSettings object itself. */ @@ -236,17 +233,16 @@ public MicrosoftGraphMailboxSettings withWorkingHours(MicrosoftGraphWorkingHours /** * Get the additionalProperties property: mailboxSettings. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: mailboxSettings. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphMailboxSettings object itself. */ @@ -255,17 +251,9 @@ public MicrosoftGraphMailboxSettings withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -279,4 +267,79 @@ public void validate() { workingHours().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("archiveFolder", this.archiveFolder); + jsonWriter.writeJsonField("automaticRepliesSetting", this.automaticRepliesSetting); + jsonWriter.writeStringField("dateFormat", this.dateFormat); + jsonWriter.writeStringField("delegateMeetingMessageDeliveryOptions", + this.delegateMeetingMessageDeliveryOptions == null + ? null + : this.delegateMeetingMessageDeliveryOptions.toString()); + jsonWriter.writeJsonField("language", this.language); + jsonWriter.writeStringField("timeFormat", this.timeFormat); + jsonWriter.writeStringField("timeZone", this.timeZone); + jsonWriter.writeJsonField("workingHours", this.workingHours); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphMailboxSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphMailboxSettings 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 MicrosoftGraphMailboxSettings. + */ + public static MicrosoftGraphMailboxSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphMailboxSettings deserializedMicrosoftGraphMailboxSettings + = new MicrosoftGraphMailboxSettings(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("archiveFolder".equals(fieldName)) { + deserializedMicrosoftGraphMailboxSettings.archiveFolder = reader.getString(); + } else if ("automaticRepliesSetting".equals(fieldName)) { + deserializedMicrosoftGraphMailboxSettings.automaticRepliesSetting + = MicrosoftGraphAutomaticRepliesSetting.fromJson(reader); + } else if ("dateFormat".equals(fieldName)) { + deserializedMicrosoftGraphMailboxSettings.dateFormat = reader.getString(); + } else if ("delegateMeetingMessageDeliveryOptions".equals(fieldName)) { + deserializedMicrosoftGraphMailboxSettings.delegateMeetingMessageDeliveryOptions + = MicrosoftGraphDelegateMeetingMessageDeliveryOptions.fromString(reader.getString()); + } else if ("language".equals(fieldName)) { + deserializedMicrosoftGraphMailboxSettings.language = MicrosoftGraphLocaleInfo.fromJson(reader); + } else if ("timeFormat".equals(fieldName)) { + deserializedMicrosoftGraphMailboxSettings.timeFormat = reader.getString(); + } else if ("timeZone".equals(fieldName)) { + deserializedMicrosoftGraphMailboxSettings.timeZone = reader.getString(); + } else if ("workingHours".equals(fieldName)) { + deserializedMicrosoftGraphMailboxSettings.workingHours + = MicrosoftGraphWorkingHours.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphMailboxSettings.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphMailboxSettings; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppFlaggedReason.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppFlaggedReason.java index 0fe2308f9cd2f..ad82a72ff2dd7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppFlaggedReason.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppFlaggedReason.java @@ -5,21 +5,26 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** managedAppFlaggedReason. */ +/** + * managedAppFlaggedReason. + */ public final class MicrosoftGraphManagedAppFlaggedReason extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphManagedAppFlaggedReason. */ + /** + * Static value none for MicrosoftGraphManagedAppFlaggedReason. + */ public static final MicrosoftGraphManagedAppFlaggedReason NONE = fromString("none"); - /** Static value rootedDevice for MicrosoftGraphManagedAppFlaggedReason. */ + /** + * Static value rootedDevice for MicrosoftGraphManagedAppFlaggedReason. + */ public static final MicrosoftGraphManagedAppFlaggedReason ROOTED_DEVICE = fromString("rootedDevice"); /** * Creates a new instance of MicrosoftGraphManagedAppFlaggedReason value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +33,17 @@ public MicrosoftGraphManagedAppFlaggedReason() { /** * Creates or finds a MicrosoftGraphManagedAppFlaggedReason from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphManagedAppFlaggedReason. */ - @JsonCreator public static MicrosoftGraphManagedAppFlaggedReason fromString(String name) { return fromString(name, MicrosoftGraphManagedAppFlaggedReason.class); } /** * Gets known MicrosoftGraphManagedAppFlaggedReason values. - * + * * @return known MicrosoftGraphManagedAppFlaggedReason values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppOperation.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppOperation.java index 9887305470fd1..3f129923dd0df 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppOperation.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppOperation.java @@ -5,57 +5,57 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; /** * managedAppOperation - * - *

Represents an operation applied against an app registration. + * + * Represents an operation applied against an app registration. */ @Fluent public final class MicrosoftGraphManagedAppOperation extends MicrosoftGraphEntity { /* * The operation name. */ - @JsonProperty(value = "displayName") private String displayName; /* * The last time the app operation was modified. */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * The current state of the operation */ - @JsonProperty(value = "state") private String state; /* * Version of the entity. */ - @JsonProperty(value = "version") private String version; /* * Represents an operation applied against an app registration. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphManagedAppOperation class. */ + /** + * Creates an instance of MicrosoftGraphManagedAppOperation class. + */ public MicrosoftGraphManagedAppOperation() { } /** * Get the displayName property: The operation name. - * + * * @return the displayName value. */ public String displayName() { @@ -64,7 +64,7 @@ public String displayName() { /** * Set the displayName property: The operation name. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphManagedAppOperation object itself. */ @@ -75,7 +75,7 @@ public MicrosoftGraphManagedAppOperation withDisplayName(String displayName) { /** * Get the lastModifiedDateTime property: The last time the app operation was modified. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -84,7 +84,7 @@ public OffsetDateTime lastModifiedDateTime() { /** * Set the lastModifiedDateTime property: The last time the app operation was modified. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphManagedAppOperation object itself. */ @@ -95,7 +95,7 @@ public MicrosoftGraphManagedAppOperation withLastModifiedDateTime(OffsetDateTime /** * Get the state property: The current state of the operation. - * + * * @return the state value. */ public String state() { @@ -104,7 +104,7 @@ public String state() { /** * Set the state property: The current state of the operation. - * + * * @param state the state value to set. * @return the MicrosoftGraphManagedAppOperation object itself. */ @@ -115,7 +115,7 @@ public MicrosoftGraphManagedAppOperation withState(String state) { /** * Get the version property: Version of the entity. - * + * * @return the version value. */ public String version() { @@ -124,7 +124,7 @@ public String version() { /** * Set the version property: Version of the entity. - * + * * @param version the version value to set. * @return the MicrosoftGraphManagedAppOperation object itself. */ @@ -135,17 +135,16 @@ public MicrosoftGraphManagedAppOperation withVersion(String version) { /** * Get the additionalProperties property: Represents an operation applied against an app registration. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Represents an operation applied against an app registration. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphManagedAppOperation object itself. */ @@ -154,15 +153,9 @@ public MicrosoftGraphManagedAppOperation withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphManagedAppOperation withId(String id) { super.withId(id); @@ -171,11 +164,75 @@ public MicrosoftGraphManagedAppOperation withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + jsonWriter.writeStringField("state", this.state); + jsonWriter.writeStringField("version", this.version); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphManagedAppOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphManagedAppOperation 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 MicrosoftGraphManagedAppOperation. + */ + public static MicrosoftGraphManagedAppOperation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphManagedAppOperation deserializedMicrosoftGraphManagedAppOperation + = new MicrosoftGraphManagedAppOperation(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppOperation.withId(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppOperation.displayName = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppOperation.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppOperation.state = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppOperation.version = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphManagedAppOperation.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphManagedAppOperation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppPolicy.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppPolicy.java index 98ef9542289d6..a3ce196f6077e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppPolicy.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppPolicy.java @@ -5,63 +5,62 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; /** * managedAppPolicy - * - *

The ManagedAppPolicy resource represents a base type for platform specific policies. + * + * The ManagedAppPolicy resource represents a base type for platform specific policies. */ @Fluent public final class MicrosoftGraphManagedAppPolicy extends MicrosoftGraphEntity { /* * The date and time the policy was created. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * The policy's description. */ - @JsonProperty(value = "description") private String description; /* * Policy display name. */ - @JsonProperty(value = "displayName") private String displayName; /* * Last time the policy was modified. */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * Version of the entity. */ - @JsonProperty(value = "version") private String version; /* * The ManagedAppPolicy resource represents a base type for platform specific policies. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphManagedAppPolicy class. */ + /** + * Creates an instance of MicrosoftGraphManagedAppPolicy class. + */ public MicrosoftGraphManagedAppPolicy() { } /** * Get the createdDateTime property: The date and time the policy was created. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -70,7 +69,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: The date and time the policy was created. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphManagedAppPolicy object itself. */ @@ -81,7 +80,7 @@ public MicrosoftGraphManagedAppPolicy withCreatedDateTime(OffsetDateTime created /** * Get the description property: The policy's description. - * + * * @return the description value. */ public String description() { @@ -90,7 +89,7 @@ public String description() { /** * Set the description property: The policy's description. - * + * * @param description the description value to set. * @return the MicrosoftGraphManagedAppPolicy object itself. */ @@ -101,7 +100,7 @@ public MicrosoftGraphManagedAppPolicy withDescription(String description) { /** * Get the displayName property: Policy display name. - * + * * @return the displayName value. */ public String displayName() { @@ -110,7 +109,7 @@ public String displayName() { /** * Set the displayName property: Policy display name. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphManagedAppPolicy object itself. */ @@ -121,7 +120,7 @@ public MicrosoftGraphManagedAppPolicy withDisplayName(String displayName) { /** * Get the lastModifiedDateTime property: Last time the policy was modified. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -130,7 +129,7 @@ public OffsetDateTime lastModifiedDateTime() { /** * Set the lastModifiedDateTime property: Last time the policy was modified. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphManagedAppPolicy object itself. */ @@ -141,7 +140,7 @@ public MicrosoftGraphManagedAppPolicy withLastModifiedDateTime(OffsetDateTime la /** * Get the version property: Version of the entity. - * + * * @return the version value. */ public String version() { @@ -150,7 +149,7 @@ public String version() { /** * Set the version property: Version of the entity. - * + * * @param version the version value to set. * @return the MicrosoftGraphManagedAppPolicy object itself. */ @@ -162,10 +161,9 @@ public MicrosoftGraphManagedAppPolicy withVersion(String version) { /** * Get the additionalProperties property: The ManagedAppPolicy resource represents a base type for platform specific * policies. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -173,7 +171,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: The ManagedAppPolicy resource represents a base type for platform specific * policies. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphManagedAppPolicy object itself. */ @@ -182,15 +180,9 @@ public MicrosoftGraphManagedAppPolicy withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphManagedAppPolicy withId(String id) { super.withId(id); @@ -199,11 +191,80 @@ public MicrosoftGraphManagedAppPolicy withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + jsonWriter.writeStringField("version", this.version); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphManagedAppPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphManagedAppPolicy 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 MicrosoftGraphManagedAppPolicy. + */ + public static MicrosoftGraphManagedAppPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphManagedAppPolicy deserializedMicrosoftGraphManagedAppPolicy + = new MicrosoftGraphManagedAppPolicy(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppPolicy.withId(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppPolicy.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppPolicy.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppPolicy.displayName = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppPolicy.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("version".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppPolicy.version = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphManagedAppPolicy.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphManagedAppPolicy; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppRegistration.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppRegistration.java index b7b9a4a69949e..a3dcaf8460073 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppRegistration.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedAppRegistration.java @@ -5,127 +5,114 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * managedAppRegistration - * - *

The ManagedAppEntity is the base entity type for all other entity types under app management workflow. + * + * The ManagedAppEntity is the base entity type for all other entity types under app management workflow. */ @Fluent public final class MicrosoftGraphManagedAppRegistration extends MicrosoftGraphEntity { /* * The identifier for a mobile app. */ - @JsonProperty(value = "appIdentifier") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map appIdentifier; /* * App version */ - @JsonProperty(value = "applicationVersion") private String applicationVersion; /* * Date and time of creation */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * Host device name */ - @JsonProperty(value = "deviceName") private String deviceName; /* * App management SDK generated tag, which helps relate apps hosted on the same device. Not guaranteed to relate * apps in all conditions. */ - @JsonProperty(value = "deviceTag") private String deviceTag; /* * Host device type */ - @JsonProperty(value = "deviceType") private String deviceType; /* * Zero or more reasons an app registration is flagged. E.g. app running on rooted device */ - @JsonProperty(value = "flaggedReasons") private List flaggedReasons; /* * Date and time of last the app synced with management service. */ - @JsonProperty(value = "lastSyncDateTime") private OffsetDateTime lastSyncDateTime; /* * App management SDK version */ - @JsonProperty(value = "managementSdkVersion") private String managementSdkVersion; /* * Operating System version */ - @JsonProperty(value = "platformVersion") private String platformVersion; /* * The user Id to who this app registration belongs. */ - @JsonProperty(value = "userId") private String userId; /* * Version of the entity. */ - @JsonProperty(value = "version") private String version; /* * Zero or more policys already applied on the registered app when it last synchronized with managment service. */ - @JsonProperty(value = "appliedPolicies") private List appliedPolicies; /* * Zero or more policies admin intended for the app as of now. */ - @JsonProperty(value = "intendedPolicies") private List intendedPolicies; /* * Zero or more long running operations triggered on the app registration. */ - @JsonProperty(value = "operations") private List operations; /* * The ManagedAppEntity is the base entity type for all other entity types under app management workflow. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphManagedAppRegistration class. */ + /** + * Creates an instance of MicrosoftGraphManagedAppRegistration class. + */ public MicrosoftGraphManagedAppRegistration() { } /** * Get the appIdentifier property: The identifier for a mobile app. - * + * * @return the appIdentifier value. */ public Map appIdentifier() { @@ -134,7 +121,7 @@ public Map appIdentifier() { /** * Set the appIdentifier property: The identifier for a mobile app. - * + * * @param appIdentifier the appIdentifier value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ @@ -145,7 +132,7 @@ public MicrosoftGraphManagedAppRegistration withAppIdentifier(Map flaggedReasons() { @@ -258,19 +245,19 @@ public List flaggedReasons() { /** * Set the flaggedReasons property: Zero or more reasons an app registration is flagged. E.g. app running on rooted * device. - * + * * @param flaggedReasons the flaggedReasons value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ - public MicrosoftGraphManagedAppRegistration withFlaggedReasons( - List flaggedReasons) { + public MicrosoftGraphManagedAppRegistration + withFlaggedReasons(List flaggedReasons) { this.flaggedReasons = flaggedReasons; return this; } /** * Get the lastSyncDateTime property: Date and time of last the app synced with management service. - * + * * @return the lastSyncDateTime value. */ public OffsetDateTime lastSyncDateTime() { @@ -279,7 +266,7 @@ public OffsetDateTime lastSyncDateTime() { /** * Set the lastSyncDateTime property: Date and time of last the app synced with management service. - * + * * @param lastSyncDateTime the lastSyncDateTime value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ @@ -290,7 +277,7 @@ public MicrosoftGraphManagedAppRegistration withLastSyncDateTime(OffsetDateTime /** * Get the managementSdkVersion property: App management SDK version. - * + * * @return the managementSdkVersion value. */ public String managementSdkVersion() { @@ -299,7 +286,7 @@ public String managementSdkVersion() { /** * Set the managementSdkVersion property: App management SDK version. - * + * * @param managementSdkVersion the managementSdkVersion value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ @@ -310,7 +297,7 @@ public MicrosoftGraphManagedAppRegistration withManagementSdkVersion(String mana /** * Get the platformVersion property: Operating System version. - * + * * @return the platformVersion value. */ public String platformVersion() { @@ -319,7 +306,7 @@ public String platformVersion() { /** * Set the platformVersion property: Operating System version. - * + * * @param platformVersion the platformVersion value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ @@ -330,7 +317,7 @@ public MicrosoftGraphManagedAppRegistration withPlatformVersion(String platformV /** * Get the userId property: The user Id to who this app registration belongs. - * + * * @return the userId value. */ public String userId() { @@ -339,7 +326,7 @@ public String userId() { /** * Set the userId property: The user Id to who this app registration belongs. - * + * * @param userId the userId value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ @@ -350,7 +337,7 @@ public MicrosoftGraphManagedAppRegistration withUserId(String userId) { /** * Get the version property: Version of the entity. - * + * * @return the version value. */ public String version() { @@ -359,7 +346,7 @@ public String version() { /** * Set the version property: Version of the entity. - * + * * @param version the version value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ @@ -371,7 +358,7 @@ public MicrosoftGraphManagedAppRegistration withVersion(String version) { /** * Get the appliedPolicies property: Zero or more policys already applied on the registered app when it last * synchronized with managment service. - * + * * @return the appliedPolicies value. */ public List appliedPolicies() { @@ -381,19 +368,19 @@ public List appliedPolicies() { /** * Set the appliedPolicies property: Zero or more policys already applied on the registered app when it last * synchronized with managment service. - * + * * @param appliedPolicies the appliedPolicies value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ - public MicrosoftGraphManagedAppRegistration withAppliedPolicies( - List appliedPolicies) { + public MicrosoftGraphManagedAppRegistration + withAppliedPolicies(List appliedPolicies) { this.appliedPolicies = appliedPolicies; return this; } /** * Get the intendedPolicies property: Zero or more policies admin intended for the app as of now. - * + * * @return the intendedPolicies value. */ public List intendedPolicies() { @@ -402,19 +389,19 @@ public List intendedPolicies() { /** * Set the intendedPolicies property: Zero or more policies admin intended for the app as of now. - * + * * @param intendedPolicies the intendedPolicies value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ - public MicrosoftGraphManagedAppRegistration withIntendedPolicies( - List intendedPolicies) { + public MicrosoftGraphManagedAppRegistration + withIntendedPolicies(List intendedPolicies) { this.intendedPolicies = intendedPolicies; return this; } /** * Get the operations property: Zero or more long running operations triggered on the app registration. - * + * * @return the operations value. */ public List operations() { @@ -423,7 +410,7 @@ public List operations() { /** * Set the operations property: Zero or more long running operations triggered on the app registration. - * + * * @param operations the operations value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ @@ -435,10 +422,9 @@ public MicrosoftGraphManagedAppRegistration withOperations(List additionalProperties() { return this.additionalProperties; } @@ -446,7 +432,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: The ManagedAppEntity is the base entity type for all other entity types * under app management workflow. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphManagedAppRegistration object itself. */ @@ -455,15 +441,9 @@ public MicrosoftGraphManagedAppRegistration withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphManagedAppRegistration withId(String id) { super.withId(id); @@ -472,7 +452,7 @@ public MicrosoftGraphManagedAppRegistration withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -488,4 +468,116 @@ public void validate() { operations().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeMapField("appIdentifier", this.appIdentifier, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("applicationVersion", this.applicationVersion); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("deviceName", this.deviceName); + jsonWriter.writeStringField("deviceTag", this.deviceTag); + jsonWriter.writeStringField("deviceType", this.deviceType); + jsonWriter.writeArrayField("flaggedReasons", this.flaggedReasons, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("lastSyncDateTime", + this.lastSyncDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSyncDateTime)); + jsonWriter.writeStringField("managementSdkVersion", this.managementSdkVersion); + jsonWriter.writeStringField("platformVersion", this.platformVersion); + jsonWriter.writeStringField("userId", this.userId); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeArrayField("appliedPolicies", this.appliedPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("intendedPolicies", this.intendedPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphManagedAppRegistration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphManagedAppRegistration 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 MicrosoftGraphManagedAppRegistration. + */ + public static MicrosoftGraphManagedAppRegistration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphManagedAppRegistration deserializedMicrosoftGraphManagedAppRegistration + = new MicrosoftGraphManagedAppRegistration(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.withId(reader.getString()); + } else if ("appIdentifier".equals(fieldName)) { + Map appIdentifier = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphManagedAppRegistration.appIdentifier = appIdentifier; + } else if ("applicationVersion".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.applicationVersion = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("deviceName".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.deviceName = reader.getString(); + } else if ("deviceTag".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.deviceTag = reader.getString(); + } else if ("deviceType".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.deviceType = reader.getString(); + } else if ("flaggedReasons".equals(fieldName)) { + List flaggedReasons = reader + .readArray(reader1 -> MicrosoftGraphManagedAppFlaggedReason.fromString(reader1.getString())); + deserializedMicrosoftGraphManagedAppRegistration.flaggedReasons = flaggedReasons; + } else if ("lastSyncDateTime".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.lastSyncDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("managementSdkVersion".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.managementSdkVersion = reader.getString(); + } else if ("platformVersion".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.platformVersion = reader.getString(); + } else if ("userId".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.userId = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedMicrosoftGraphManagedAppRegistration.version = reader.getString(); + } else if ("appliedPolicies".equals(fieldName)) { + List appliedPolicies + = reader.readArray(reader1 -> MicrosoftGraphManagedAppPolicy.fromJson(reader1)); + deserializedMicrosoftGraphManagedAppRegistration.appliedPolicies = appliedPolicies; + } else if ("intendedPolicies".equals(fieldName)) { + List intendedPolicies + = reader.readArray(reader1 -> MicrosoftGraphManagedAppPolicy.fromJson(reader1)); + deserializedMicrosoftGraphManagedAppRegistration.intendedPolicies = intendedPolicies; + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> MicrosoftGraphManagedAppOperation.fromJson(reader1)); + deserializedMicrosoftGraphManagedAppRegistration.operations = operations; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphManagedAppRegistration.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphManagedAppRegistration; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDevice.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDevice.java index c762f36ed6f3f..abe83eaf5b901 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDevice.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDevice.java @@ -5,335 +5,286 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * managedDevice - * - *

Devices that are managed or pre-enrolled through Intune. + * + * Devices that are managed or pre-enrolled through Intune. */ @Fluent public final class MicrosoftGraphManagedDevice extends MicrosoftGraphEntity { /* * Code that allows the Activation Lock on a device to be bypassed. */ - @JsonProperty(value = "activationLockBypassCode") private String activationLockBypassCode; /* * Android security patch level */ - @JsonProperty(value = "androidSecurityPatchLevel") private String androidSecurityPatchLevel; /* * The unique identifier for the Azure Active Directory device. Read only. */ - @JsonProperty(value = "azureADDeviceId") private String azureADDeviceId; /* * Whether the device is Azure Active Directory registered. */ - @JsonProperty(value = "azureADRegistered") private Boolean azureADRegistered; /* * The DateTime when device compliance grace period expires */ - @JsonProperty(value = "complianceGracePeriodExpirationDateTime") private OffsetDateTime complianceGracePeriodExpirationDateTime; /* * complianceState */ - @JsonProperty(value = "complianceState") private MicrosoftGraphComplianceState complianceState; /* - * configurationManagerClientEnabledFeatures - * * configuration Manager client enabled features */ - @JsonProperty(value = "configurationManagerClientEnabledFeatures") private MicrosoftGraphConfigurationManagerClientEnabledFeatures configurationManagerClientEnabledFeatures; /* * List of ComplexType deviceActionResult objects. */ - @JsonProperty(value = "deviceActionResults") private List deviceActionResults; /* * Device category display name */ - @JsonProperty(value = "deviceCategoryDisplayName") private String deviceCategoryDisplayName; /* * deviceEnrollmentType */ - @JsonProperty(value = "deviceEnrollmentType") private MicrosoftGraphDeviceEnrollmentType deviceEnrollmentType; /* * deviceHealthAttestationState */ - @JsonProperty(value = "deviceHealthAttestationState") private MicrosoftGraphDeviceHealthAttestationState deviceHealthAttestationState; /* * Name of the device */ - @JsonProperty(value = "deviceName") private String deviceName; /* * deviceRegistrationState */ - @JsonProperty(value = "deviceRegistrationState") private MicrosoftGraphDeviceRegistrationState deviceRegistrationState; /* * Whether the device is Exchange ActiveSync activated. */ - @JsonProperty(value = "easActivated") private Boolean easActivated; /* * Exchange ActivationSync activation time of the device. */ - @JsonProperty(value = "easActivationDateTime") private OffsetDateTime easActivationDateTime; /* * Exchange ActiveSync Id of the device. */ - @JsonProperty(value = "easDeviceId") private String easDeviceId; /* * Email(s) for the user associated with the device */ - @JsonProperty(value = "emailAddress") private String emailAddress; /* * Enrollment time of the device. */ - @JsonProperty(value = "enrolledDateTime") private OffsetDateTime enrolledDateTime; /* * deviceManagementExchangeAccessState */ - @JsonProperty(value = "exchangeAccessState") private MicrosoftGraphDeviceManagementExchangeAccessState exchangeAccessState; /* * deviceManagementExchangeAccessStateReason */ - @JsonProperty(value = "exchangeAccessStateReason") private MicrosoftGraphDeviceManagementExchangeAccessStateReason exchangeAccessStateReason; /* * Last time the device contacted Exchange. */ - @JsonProperty(value = "exchangeLastSuccessfulSyncDateTime") private OffsetDateTime exchangeLastSuccessfulSyncDateTime; /* * Free Storage in Bytes */ - @JsonProperty(value = "freeStorageSpaceInBytes") private Long freeStorageSpaceInBytes; /* * IMEI */ - @JsonProperty(value = "imei") private String imei; /* * Device encryption status */ - @JsonProperty(value = "isEncrypted") private Boolean isEncrypted; /* * Device supervised status */ - @JsonProperty(value = "isSupervised") private Boolean isSupervised; /* * whether the device is jail broken or rooted. */ - @JsonProperty(value = "jailBroken") private String jailBroken; /* * The date and time that the device last completed a successful sync with Intune. */ - @JsonProperty(value = "lastSyncDateTime") private OffsetDateTime lastSyncDateTime; /* * Automatically generated name to identify a device. Can be overwritten to a user friendly name. */ - @JsonProperty(value = "managedDeviceName") private String managedDeviceName; /* * managedDeviceOwnerType */ - @JsonProperty(value = "managedDeviceOwnerType") private MicrosoftGraphManagedDeviceOwnerType managedDeviceOwnerType; /* * managementAgentType */ - @JsonProperty(value = "managementAgent") private MicrosoftGraphManagementAgentType managementAgent; /* * Manufacturer of the device */ - @JsonProperty(value = "manufacturer") private String manufacturer; /* * MEID */ - @JsonProperty(value = "meid") private String meid; /* * Model of the device */ - @JsonProperty(value = "model") private String model; /* * Operating system of the device. Windows, iOS, etc. */ - @JsonProperty(value = "operatingSystem") private String operatingSystem; /* * Operating system version of the device. */ - @JsonProperty(value = "osVersion") private String osVersion; /* * managedDevicePartnerReportedHealthState */ - @JsonProperty(value = "partnerReportedThreatState") private MicrosoftGraphManagedDevicePartnerReportedHealthState partnerReportedThreatState; /* * Phone number of the device */ - @JsonProperty(value = "phoneNumber") private String phoneNumber; /* * An error string that identifies issues when creating Remote Assistance session objects. */ - @JsonProperty(value = "remoteAssistanceSessionErrorDetails") private String remoteAssistanceSessionErrorDetails; /* * Url that allows a Remote Assistance session to be established with the device. */ - @JsonProperty(value = "remoteAssistanceSessionUrl") private String remoteAssistanceSessionUrl; /* * SerialNumber */ - @JsonProperty(value = "serialNumber") private String serialNumber; /* * Subscriber Carrier */ - @JsonProperty(value = "subscriberCarrier") private String subscriberCarrier; /* * Total Storage in Bytes */ - @JsonProperty(value = "totalStorageSpaceInBytes") private Long totalStorageSpaceInBytes; /* * User display name */ - @JsonProperty(value = "userDisplayName") private String userDisplayName; /* * Unique Identifier for the user associated with the device */ - @JsonProperty(value = "userId") private String userId; /* * Device user principal name */ - @JsonProperty(value = "userPrincipalName") private String userPrincipalName; /* * Wi-Fi MAC */ - @JsonProperty(value = "wiFiMacAddress") private String wiFiMacAddress; /* * Device compliance policy states for this device. */ - @JsonProperty(value = "deviceCompliancePolicyStates") private List deviceCompliancePolicyStates; /* * Device configuration states for this device. */ - @JsonProperty(value = "deviceConfigurationStates") private List deviceConfigurationStates; /* - * deviceCategory - * * Device categories provides a way to organize your devices. Using device categories, company administrators can - * define their own categories that make sense to their company. These categories can then be applied to a device - * in the Intune Azure console or selected by a user during device enrollment. You can filter reports and create + * define their own categories that make sense to their company. These categories can then be applied to a device in + * the Intune Azure console or selected by a user during device enrollment. You can filter reports and create * dynamic Azure Active Directory device groups based on device categories. */ - @JsonProperty(value = "deviceCategory") private MicrosoftGraphDeviceCategory deviceCategory; /* * Devices that are managed or pre-enrolled through Intune */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphManagedDevice class. */ + /** + * Creates an instance of MicrosoftGraphManagedDevice class. + */ public MicrosoftGraphManagedDevice() { } /** * Get the activationLockBypassCode property: Code that allows the Activation Lock on a device to be bypassed. - * + * * @return the activationLockBypassCode value. */ public String activationLockBypassCode() { @@ -342,7 +293,7 @@ public String activationLockBypassCode() { /** * Set the activationLockBypassCode property: Code that allows the Activation Lock on a device to be bypassed. - * + * * @param activationLockBypassCode the activationLockBypassCode value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -353,7 +304,7 @@ public MicrosoftGraphManagedDevice withActivationLockBypassCode(String activatio /** * Get the androidSecurityPatchLevel property: Android security patch level. - * + * * @return the androidSecurityPatchLevel value. */ public String androidSecurityPatchLevel() { @@ -362,7 +313,7 @@ public String androidSecurityPatchLevel() { /** * Set the androidSecurityPatchLevel property: Android security patch level. - * + * * @param androidSecurityPatchLevel the androidSecurityPatchLevel value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -373,7 +324,7 @@ public MicrosoftGraphManagedDevice withAndroidSecurityPatchLevel(String androidS /** * Get the azureADDeviceId property: The unique identifier for the Azure Active Directory device. Read only. - * + * * @return the azureADDeviceId value. */ public String azureADDeviceId() { @@ -382,7 +333,7 @@ public String azureADDeviceId() { /** * Set the azureADDeviceId property: The unique identifier for the Azure Active Directory device. Read only. - * + * * @param azureADDeviceId the azureADDeviceId value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -393,7 +344,7 @@ public MicrosoftGraphManagedDevice withAzureADDeviceId(String azureADDeviceId) { /** * Get the azureADRegistered property: Whether the device is Azure Active Directory registered. - * + * * @return the azureADRegistered value. */ public Boolean azureADRegistered() { @@ -402,7 +353,7 @@ public Boolean azureADRegistered() { /** * Set the azureADRegistered property: Whether the device is Azure Active Directory registered. - * + * * @param azureADRegistered the azureADRegistered value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -414,7 +365,7 @@ public MicrosoftGraphManagedDevice withAzureADRegistered(Boolean azureADRegister /** * Get the complianceGracePeriodExpirationDateTime property: The DateTime when device compliance grace period * expires. - * + * * @return the complianceGracePeriodExpirationDateTime value. */ public OffsetDateTime complianceGracePeriodExpirationDateTime() { @@ -424,19 +375,19 @@ public OffsetDateTime complianceGracePeriodExpirationDateTime() { /** * Set the complianceGracePeriodExpirationDateTime property: The DateTime when device compliance grace period * expires. - * + * * @param complianceGracePeriodExpirationDateTime the complianceGracePeriodExpirationDateTime value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withComplianceGracePeriodExpirationDateTime( - OffsetDateTime complianceGracePeriodExpirationDateTime) { + public MicrosoftGraphManagedDevice + withComplianceGracePeriodExpirationDateTime(OffsetDateTime complianceGracePeriodExpirationDateTime) { this.complianceGracePeriodExpirationDateTime = complianceGracePeriodExpirationDateTime; return this; } /** * Get the complianceState property: complianceState. - * + * * @return the complianceState value. */ public MicrosoftGraphComplianceState complianceState() { @@ -445,7 +396,7 @@ public MicrosoftGraphComplianceState complianceState() { /** * Set the complianceState property: complianceState. - * + * * @param complianceState the complianceState value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -455,10 +406,8 @@ public MicrosoftGraphManagedDevice withComplianceState(MicrosoftGraphComplianceS } /** - * Get the configurationManagerClientEnabledFeatures property: configurationManagerClientEnabledFeatures - * - *

configuration Manager client enabled features. - * + * Get the configurationManagerClientEnabledFeatures property: configuration Manager client enabled features. + * * @return the configurationManagerClientEnabledFeatures value. */ public MicrosoftGraphConfigurationManagerClientEnabledFeatures configurationManagerClientEnabledFeatures() { @@ -466,10 +415,8 @@ public MicrosoftGraphConfigurationManagerClientEnabledFeatures configurationMana } /** - * Set the configurationManagerClientEnabledFeatures property: configurationManagerClientEnabledFeatures - * - *

configuration Manager client enabled features. - * + * Set the configurationManagerClientEnabledFeatures property: configuration Manager client enabled features. + * * @param configurationManagerClientEnabledFeatures the configurationManagerClientEnabledFeatures value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -481,7 +428,7 @@ public MicrosoftGraphManagedDevice withConfigurationManagerClientEnabledFeatures /** * Get the deviceActionResults property: List of ComplexType deviceActionResult objects. - * + * * @return the deviceActionResults value. */ public List deviceActionResults() { @@ -490,19 +437,19 @@ public List deviceActionResults() { /** * Set the deviceActionResults property: List of ComplexType deviceActionResult objects. - * + * * @param deviceActionResults the deviceActionResults value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withDeviceActionResults( - List deviceActionResults) { + public MicrosoftGraphManagedDevice + withDeviceActionResults(List deviceActionResults) { this.deviceActionResults = deviceActionResults; return this; } /** * Get the deviceCategoryDisplayName property: Device category display name. - * + * * @return the deviceCategoryDisplayName value. */ public String deviceCategoryDisplayName() { @@ -511,7 +458,7 @@ public String deviceCategoryDisplayName() { /** * Set the deviceCategoryDisplayName property: Device category display name. - * + * * @param deviceCategoryDisplayName the deviceCategoryDisplayName value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -522,7 +469,7 @@ public MicrosoftGraphManagedDevice withDeviceCategoryDisplayName(String deviceCa /** * Get the deviceEnrollmentType property: deviceEnrollmentType. - * + * * @return the deviceEnrollmentType value. */ public MicrosoftGraphDeviceEnrollmentType deviceEnrollmentType() { @@ -531,19 +478,19 @@ public MicrosoftGraphDeviceEnrollmentType deviceEnrollmentType() { /** * Set the deviceEnrollmentType property: deviceEnrollmentType. - * + * * @param deviceEnrollmentType the deviceEnrollmentType value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withDeviceEnrollmentType( - MicrosoftGraphDeviceEnrollmentType deviceEnrollmentType) { + public MicrosoftGraphManagedDevice + withDeviceEnrollmentType(MicrosoftGraphDeviceEnrollmentType deviceEnrollmentType) { this.deviceEnrollmentType = deviceEnrollmentType; return this; } /** * Get the deviceHealthAttestationState property: deviceHealthAttestationState. - * + * * @return the deviceHealthAttestationState value. */ public MicrosoftGraphDeviceHealthAttestationState deviceHealthAttestationState() { @@ -552,19 +499,19 @@ public MicrosoftGraphDeviceHealthAttestationState deviceHealthAttestationState() /** * Set the deviceHealthAttestationState property: deviceHealthAttestationState. - * + * * @param deviceHealthAttestationState the deviceHealthAttestationState value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withDeviceHealthAttestationState( - MicrosoftGraphDeviceHealthAttestationState deviceHealthAttestationState) { + public MicrosoftGraphManagedDevice + withDeviceHealthAttestationState(MicrosoftGraphDeviceHealthAttestationState deviceHealthAttestationState) { this.deviceHealthAttestationState = deviceHealthAttestationState; return this; } /** * Get the deviceName property: Name of the device. - * + * * @return the deviceName value. */ public String deviceName() { @@ -573,7 +520,7 @@ public String deviceName() { /** * Set the deviceName property: Name of the device. - * + * * @param deviceName the deviceName value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -584,7 +531,7 @@ public MicrosoftGraphManagedDevice withDeviceName(String deviceName) { /** * Get the deviceRegistrationState property: deviceRegistrationState. - * + * * @return the deviceRegistrationState value. */ public MicrosoftGraphDeviceRegistrationState deviceRegistrationState() { @@ -593,19 +540,19 @@ public MicrosoftGraphDeviceRegistrationState deviceRegistrationState() { /** * Set the deviceRegistrationState property: deviceRegistrationState. - * + * * @param deviceRegistrationState the deviceRegistrationState value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withDeviceRegistrationState( - MicrosoftGraphDeviceRegistrationState deviceRegistrationState) { + public MicrosoftGraphManagedDevice + withDeviceRegistrationState(MicrosoftGraphDeviceRegistrationState deviceRegistrationState) { this.deviceRegistrationState = deviceRegistrationState; return this; } /** * Get the easActivated property: Whether the device is Exchange ActiveSync activated. - * + * * @return the easActivated value. */ public Boolean easActivated() { @@ -614,7 +561,7 @@ public Boolean easActivated() { /** * Set the easActivated property: Whether the device is Exchange ActiveSync activated. - * + * * @param easActivated the easActivated value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -625,7 +572,7 @@ public MicrosoftGraphManagedDevice withEasActivated(Boolean easActivated) { /** * Get the easActivationDateTime property: Exchange ActivationSync activation time of the device. - * + * * @return the easActivationDateTime value. */ public OffsetDateTime easActivationDateTime() { @@ -634,7 +581,7 @@ public OffsetDateTime easActivationDateTime() { /** * Set the easActivationDateTime property: Exchange ActivationSync activation time of the device. - * + * * @param easActivationDateTime the easActivationDateTime value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -645,7 +592,7 @@ public MicrosoftGraphManagedDevice withEasActivationDateTime(OffsetDateTime easA /** * Get the easDeviceId property: Exchange ActiveSync Id of the device. - * + * * @return the easDeviceId value. */ public String easDeviceId() { @@ -654,7 +601,7 @@ public String easDeviceId() { /** * Set the easDeviceId property: Exchange ActiveSync Id of the device. - * + * * @param easDeviceId the easDeviceId value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -665,7 +612,7 @@ public MicrosoftGraphManagedDevice withEasDeviceId(String easDeviceId) { /** * Get the emailAddress property: Email(s) for the user associated with the device. - * + * * @return the emailAddress value. */ public String emailAddress() { @@ -674,7 +621,7 @@ public String emailAddress() { /** * Set the emailAddress property: Email(s) for the user associated with the device. - * + * * @param emailAddress the emailAddress value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -685,7 +632,7 @@ public MicrosoftGraphManagedDevice withEmailAddress(String emailAddress) { /** * Get the enrolledDateTime property: Enrollment time of the device. - * + * * @return the enrolledDateTime value. */ public OffsetDateTime enrolledDateTime() { @@ -694,7 +641,7 @@ public OffsetDateTime enrolledDateTime() { /** * Set the enrolledDateTime property: Enrollment time of the device. - * + * * @param enrolledDateTime the enrolledDateTime value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -705,7 +652,7 @@ public MicrosoftGraphManagedDevice withEnrolledDateTime(OffsetDateTime enrolledD /** * Get the exchangeAccessState property: deviceManagementExchangeAccessState. - * + * * @return the exchangeAccessState value. */ public MicrosoftGraphDeviceManagementExchangeAccessState exchangeAccessState() { @@ -714,19 +661,19 @@ public MicrosoftGraphDeviceManagementExchangeAccessState exchangeAccessState() { /** * Set the exchangeAccessState property: deviceManagementExchangeAccessState. - * + * * @param exchangeAccessState the exchangeAccessState value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withExchangeAccessState( - MicrosoftGraphDeviceManagementExchangeAccessState exchangeAccessState) { + public MicrosoftGraphManagedDevice + withExchangeAccessState(MicrosoftGraphDeviceManagementExchangeAccessState exchangeAccessState) { this.exchangeAccessState = exchangeAccessState; return this; } /** * Get the exchangeAccessStateReason property: deviceManagementExchangeAccessStateReason. - * + * * @return the exchangeAccessStateReason value. */ public MicrosoftGraphDeviceManagementExchangeAccessStateReason exchangeAccessStateReason() { @@ -735,7 +682,7 @@ public MicrosoftGraphDeviceManagementExchangeAccessStateReason exchangeAccessSta /** * Set the exchangeAccessStateReason property: deviceManagementExchangeAccessStateReason. - * + * * @param exchangeAccessStateReason the exchangeAccessStateReason value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -747,7 +694,7 @@ public MicrosoftGraphManagedDevice withExchangeAccessStateReason( /** * Get the exchangeLastSuccessfulSyncDateTime property: Last time the device contacted Exchange. - * + * * @return the exchangeLastSuccessfulSyncDateTime value. */ public OffsetDateTime exchangeLastSuccessfulSyncDateTime() { @@ -756,19 +703,19 @@ public OffsetDateTime exchangeLastSuccessfulSyncDateTime() { /** * Set the exchangeLastSuccessfulSyncDateTime property: Last time the device contacted Exchange. - * + * * @param exchangeLastSuccessfulSyncDateTime the exchangeLastSuccessfulSyncDateTime value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withExchangeLastSuccessfulSyncDateTime( - OffsetDateTime exchangeLastSuccessfulSyncDateTime) { + public MicrosoftGraphManagedDevice + withExchangeLastSuccessfulSyncDateTime(OffsetDateTime exchangeLastSuccessfulSyncDateTime) { this.exchangeLastSuccessfulSyncDateTime = exchangeLastSuccessfulSyncDateTime; return this; } /** * Get the freeStorageSpaceInBytes property: Free Storage in Bytes. - * + * * @return the freeStorageSpaceInBytes value. */ public Long freeStorageSpaceInBytes() { @@ -777,7 +724,7 @@ public Long freeStorageSpaceInBytes() { /** * Set the freeStorageSpaceInBytes property: Free Storage in Bytes. - * + * * @param freeStorageSpaceInBytes the freeStorageSpaceInBytes value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -788,7 +735,7 @@ public MicrosoftGraphManagedDevice withFreeStorageSpaceInBytes(Long freeStorageS /** * Get the imei property: IMEI. - * + * * @return the imei value. */ public String imei() { @@ -797,7 +744,7 @@ public String imei() { /** * Set the imei property: IMEI. - * + * * @param imei the imei value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -808,7 +755,7 @@ public MicrosoftGraphManagedDevice withImei(String imei) { /** * Get the isEncrypted property: Device encryption status. - * + * * @return the isEncrypted value. */ public Boolean isEncrypted() { @@ -817,7 +764,7 @@ public Boolean isEncrypted() { /** * Set the isEncrypted property: Device encryption status. - * + * * @param isEncrypted the isEncrypted value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -828,7 +775,7 @@ public MicrosoftGraphManagedDevice withIsEncrypted(Boolean isEncrypted) { /** * Get the isSupervised property: Device supervised status. - * + * * @return the isSupervised value. */ public Boolean isSupervised() { @@ -837,7 +784,7 @@ public Boolean isSupervised() { /** * Set the isSupervised property: Device supervised status. - * + * * @param isSupervised the isSupervised value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -848,7 +795,7 @@ public MicrosoftGraphManagedDevice withIsSupervised(Boolean isSupervised) { /** * Get the jailBroken property: whether the device is jail broken or rooted. - * + * * @return the jailBroken value. */ public String jailBroken() { @@ -857,7 +804,7 @@ public String jailBroken() { /** * Set the jailBroken property: whether the device is jail broken or rooted. - * + * * @param jailBroken the jailBroken value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -869,7 +816,7 @@ public MicrosoftGraphManagedDevice withJailBroken(String jailBroken) { /** * Get the lastSyncDateTime property: The date and time that the device last completed a successful sync with * Intune. - * + * * @return the lastSyncDateTime value. */ public OffsetDateTime lastSyncDateTime() { @@ -879,7 +826,7 @@ public OffsetDateTime lastSyncDateTime() { /** * Set the lastSyncDateTime property: The date and time that the device last completed a successful sync with * Intune. - * + * * @param lastSyncDateTime the lastSyncDateTime value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -891,7 +838,7 @@ public MicrosoftGraphManagedDevice withLastSyncDateTime(OffsetDateTime lastSyncD /** * Get the managedDeviceName property: Automatically generated name to identify a device. Can be overwritten to a * user friendly name. - * + * * @return the managedDeviceName value. */ public String managedDeviceName() { @@ -901,7 +848,7 @@ public String managedDeviceName() { /** * Set the managedDeviceName property: Automatically generated name to identify a device. Can be overwritten to a * user friendly name. - * + * * @param managedDeviceName the managedDeviceName value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -912,7 +859,7 @@ public MicrosoftGraphManagedDevice withManagedDeviceName(String managedDeviceNam /** * Get the managedDeviceOwnerType property: managedDeviceOwnerType. - * + * * @return the managedDeviceOwnerType value. */ public MicrosoftGraphManagedDeviceOwnerType managedDeviceOwnerType() { @@ -921,19 +868,19 @@ public MicrosoftGraphManagedDeviceOwnerType managedDeviceOwnerType() { /** * Set the managedDeviceOwnerType property: managedDeviceOwnerType. - * + * * @param managedDeviceOwnerType the managedDeviceOwnerType value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withManagedDeviceOwnerType( - MicrosoftGraphManagedDeviceOwnerType managedDeviceOwnerType) { + public MicrosoftGraphManagedDevice + withManagedDeviceOwnerType(MicrosoftGraphManagedDeviceOwnerType managedDeviceOwnerType) { this.managedDeviceOwnerType = managedDeviceOwnerType; return this; } /** * Get the managementAgent property: managementAgentType. - * + * * @return the managementAgent value. */ public MicrosoftGraphManagementAgentType managementAgent() { @@ -942,7 +889,7 @@ public MicrosoftGraphManagementAgentType managementAgent() { /** * Set the managementAgent property: managementAgentType. - * + * * @param managementAgent the managementAgent value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -953,7 +900,7 @@ public MicrosoftGraphManagedDevice withManagementAgent(MicrosoftGraphManagementA /** * Get the manufacturer property: Manufacturer of the device. - * + * * @return the manufacturer value. */ public String manufacturer() { @@ -962,7 +909,7 @@ public String manufacturer() { /** * Set the manufacturer property: Manufacturer of the device. - * + * * @param manufacturer the manufacturer value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -973,7 +920,7 @@ public MicrosoftGraphManagedDevice withManufacturer(String manufacturer) { /** * Get the meid property: MEID. - * + * * @return the meid value. */ public String meid() { @@ -982,7 +929,7 @@ public String meid() { /** * Set the meid property: MEID. - * + * * @param meid the meid value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -993,7 +940,7 @@ public MicrosoftGraphManagedDevice withMeid(String meid) { /** * Get the model property: Model of the device. - * + * * @return the model value. */ public String model() { @@ -1002,7 +949,7 @@ public String model() { /** * Set the model property: Model of the device. - * + * * @param model the model value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1013,7 +960,7 @@ public MicrosoftGraphManagedDevice withModel(String model) { /** * Get the operatingSystem property: Operating system of the device. Windows, iOS, etc. - * + * * @return the operatingSystem value. */ public String operatingSystem() { @@ -1022,7 +969,7 @@ public String operatingSystem() { /** * Set the operatingSystem property: Operating system of the device. Windows, iOS, etc. - * + * * @param operatingSystem the operatingSystem value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1033,7 +980,7 @@ public MicrosoftGraphManagedDevice withOperatingSystem(String operatingSystem) { /** * Get the osVersion property: Operating system version of the device. - * + * * @return the osVersion value. */ public String osVersion() { @@ -1042,7 +989,7 @@ public String osVersion() { /** * Set the osVersion property: Operating system version of the device. - * + * * @param osVersion the osVersion value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1053,7 +1000,7 @@ public MicrosoftGraphManagedDevice withOsVersion(String osVersion) { /** * Get the partnerReportedThreatState property: managedDevicePartnerReportedHealthState. - * + * * @return the partnerReportedThreatState value. */ public MicrosoftGraphManagedDevicePartnerReportedHealthState partnerReportedThreatState() { @@ -1062,7 +1009,7 @@ public MicrosoftGraphManagedDevicePartnerReportedHealthState partnerReportedThre /** * Set the partnerReportedThreatState property: managedDevicePartnerReportedHealthState. - * + * * @param partnerReportedThreatState the partnerReportedThreatState value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1074,7 +1021,7 @@ public MicrosoftGraphManagedDevice withPartnerReportedThreatState( /** * Get the phoneNumber property: Phone number of the device. - * + * * @return the phoneNumber value. */ public String phoneNumber() { @@ -1083,7 +1030,7 @@ public String phoneNumber() { /** * Set the phoneNumber property: Phone number of the device. - * + * * @param phoneNumber the phoneNumber value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1095,7 +1042,7 @@ public MicrosoftGraphManagedDevice withPhoneNumber(String phoneNumber) { /** * Get the remoteAssistanceSessionErrorDetails property: An error string that identifies issues when creating Remote * Assistance session objects. - * + * * @return the remoteAssistanceSessionErrorDetails value. */ public String remoteAssistanceSessionErrorDetails() { @@ -1105,12 +1052,12 @@ public String remoteAssistanceSessionErrorDetails() { /** * Set the remoteAssistanceSessionErrorDetails property: An error string that identifies issues when creating Remote * Assistance session objects. - * + * * @param remoteAssistanceSessionErrorDetails the remoteAssistanceSessionErrorDetails value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withRemoteAssistanceSessionErrorDetails( - String remoteAssistanceSessionErrorDetails) { + public MicrosoftGraphManagedDevice + withRemoteAssistanceSessionErrorDetails(String remoteAssistanceSessionErrorDetails) { this.remoteAssistanceSessionErrorDetails = remoteAssistanceSessionErrorDetails; return this; } @@ -1118,7 +1065,7 @@ public MicrosoftGraphManagedDevice withRemoteAssistanceSessionErrorDetails( /** * Get the remoteAssistanceSessionUrl property: Url that allows a Remote Assistance session to be established with * the device. - * + * * @return the remoteAssistanceSessionUrl value. */ public String remoteAssistanceSessionUrl() { @@ -1128,7 +1075,7 @@ public String remoteAssistanceSessionUrl() { /** * Set the remoteAssistanceSessionUrl property: Url that allows a Remote Assistance session to be established with * the device. - * + * * @param remoteAssistanceSessionUrl the remoteAssistanceSessionUrl value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1139,7 +1086,7 @@ public MicrosoftGraphManagedDevice withRemoteAssistanceSessionUrl(String remoteA /** * Get the serialNumber property: SerialNumber. - * + * * @return the serialNumber value. */ public String serialNumber() { @@ -1148,7 +1095,7 @@ public String serialNumber() { /** * Set the serialNumber property: SerialNumber. - * + * * @param serialNumber the serialNumber value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1159,7 +1106,7 @@ public MicrosoftGraphManagedDevice withSerialNumber(String serialNumber) { /** * Get the subscriberCarrier property: Subscriber Carrier. - * + * * @return the subscriberCarrier value. */ public String subscriberCarrier() { @@ -1168,7 +1115,7 @@ public String subscriberCarrier() { /** * Set the subscriberCarrier property: Subscriber Carrier. - * + * * @param subscriberCarrier the subscriberCarrier value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1179,7 +1126,7 @@ public MicrosoftGraphManagedDevice withSubscriberCarrier(String subscriberCarrie /** * Get the totalStorageSpaceInBytes property: Total Storage in Bytes. - * + * * @return the totalStorageSpaceInBytes value. */ public Long totalStorageSpaceInBytes() { @@ -1188,7 +1135,7 @@ public Long totalStorageSpaceInBytes() { /** * Set the totalStorageSpaceInBytes property: Total Storage in Bytes. - * + * * @param totalStorageSpaceInBytes the totalStorageSpaceInBytes value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1199,7 +1146,7 @@ public MicrosoftGraphManagedDevice withTotalStorageSpaceInBytes(Long totalStorag /** * Get the userDisplayName property: User display name. - * + * * @return the userDisplayName value. */ public String userDisplayName() { @@ -1208,7 +1155,7 @@ public String userDisplayName() { /** * Set the userDisplayName property: User display name. - * + * * @param userDisplayName the userDisplayName value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1219,7 +1166,7 @@ public MicrosoftGraphManagedDevice withUserDisplayName(String userDisplayName) { /** * Get the userId property: Unique Identifier for the user associated with the device. - * + * * @return the userId value. */ public String userId() { @@ -1228,7 +1175,7 @@ public String userId() { /** * Set the userId property: Unique Identifier for the user associated with the device. - * + * * @param userId the userId value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1239,7 +1186,7 @@ public MicrosoftGraphManagedDevice withUserId(String userId) { /** * Get the userPrincipalName property: Device user principal name. - * + * * @return the userPrincipalName value. */ public String userPrincipalName() { @@ -1248,7 +1195,7 @@ public String userPrincipalName() { /** * Set the userPrincipalName property: Device user principal name. - * + * * @param userPrincipalName the userPrincipalName value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1259,7 +1206,7 @@ public MicrosoftGraphManagedDevice withUserPrincipalName(String userPrincipalNam /** * Get the wiFiMacAddress property: Wi-Fi MAC. - * + * * @return the wiFiMacAddress value. */ public String wiFiMacAddress() { @@ -1268,7 +1215,7 @@ public String wiFiMacAddress() { /** * Set the wiFiMacAddress property: Wi-Fi MAC. - * + * * @param wiFiMacAddress the wiFiMacAddress value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1279,7 +1226,7 @@ public MicrosoftGraphManagedDevice withWiFiMacAddress(String wiFiMacAddress) { /** * Get the deviceCompliancePolicyStates property: Device compliance policy states for this device. - * + * * @return the deviceCompliancePolicyStates value. */ public List deviceCompliancePolicyStates() { @@ -1288,19 +1235,19 @@ public List deviceCompliancePolicySta /** * Set the deviceCompliancePolicyStates property: Device compliance policy states for this device. - * + * * @param deviceCompliancePolicyStates the deviceCompliancePolicyStates value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withDeviceCompliancePolicyStates( - List deviceCompliancePolicyStates) { + public MicrosoftGraphManagedDevice + withDeviceCompliancePolicyStates(List deviceCompliancePolicyStates) { this.deviceCompliancePolicyStates = deviceCompliancePolicyStates; return this; } /** * Get the deviceConfigurationStates property: Device configuration states for this device. - * + * * @return the deviceConfigurationStates value. */ public List deviceConfigurationStates() { @@ -1309,24 +1256,23 @@ public List deviceConfigurationStates() /** * Set the deviceConfigurationStates property: Device configuration states for this device. - * + * * @param deviceConfigurationStates the deviceConfigurationStates value to set. * @return the MicrosoftGraphManagedDevice object itself. */ - public MicrosoftGraphManagedDevice withDeviceConfigurationStates( - List deviceConfigurationStates) { + public MicrosoftGraphManagedDevice + withDeviceConfigurationStates(List deviceConfigurationStates) { this.deviceConfigurationStates = deviceConfigurationStates; return this; } /** - * Get the deviceCategory property: deviceCategory - * - *

Device categories provides a way to organize your devices. Using device categories, company administrators can - * define their own categories that make sense to their company. These categories can then be applied to a device in - * the Intune Azure console or selected by a user during device enrollment. You can filter reports and create - * dynamic Azure Active Directory device groups based on device categories. - * + * Get the deviceCategory property: Device categories provides a way to organize your devices. Using device + * categories, company administrators can define their own categories that make sense to their company. These + * categories can then be applied to a device in the Intune Azure console or selected by a user during device + * enrollment. You can filter reports and create dynamic Azure Active Directory device groups based on device + * categories. + * * @return the deviceCategory value. */ public MicrosoftGraphDeviceCategory deviceCategory() { @@ -1334,13 +1280,12 @@ public MicrosoftGraphDeviceCategory deviceCategory() { } /** - * Set the deviceCategory property: deviceCategory - * - *

Device categories provides a way to organize your devices. Using device categories, company administrators can - * define their own categories that make sense to their company. These categories can then be applied to a device in - * the Intune Azure console or selected by a user during device enrollment. You can filter reports and create - * dynamic Azure Active Directory device groups based on device categories. - * + * Set the deviceCategory property: Device categories provides a way to organize your devices. Using device + * categories, company administrators can define their own categories that make sense to their company. These + * categories can then be applied to a device in the Intune Azure console or selected by a user during device + * enrollment. You can filter reports and create dynamic Azure Active Directory device groups based on device + * categories. + * * @param deviceCategory the deviceCategory value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1351,17 +1296,16 @@ public MicrosoftGraphManagedDevice withDeviceCategory(MicrosoftGraphDeviceCatego /** * Get the additionalProperties property: Devices that are managed or pre-enrolled through Intune. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: Devices that are managed or pre-enrolled through Intune. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphManagedDevice object itself. */ @@ -1370,15 +1314,9 @@ public MicrosoftGraphManagedDevice withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphManagedDevice withId(String id) { super.withId(id); @@ -1387,7 +1325,7 @@ public MicrosoftGraphManagedDevice withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -1412,4 +1350,250 @@ public void validate() { deviceCategory().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("activationLockBypassCode", this.activationLockBypassCode); + jsonWriter.writeStringField("androidSecurityPatchLevel", this.androidSecurityPatchLevel); + jsonWriter.writeStringField("azureADDeviceId", this.azureADDeviceId); + jsonWriter.writeBooleanField("azureADRegistered", this.azureADRegistered); + jsonWriter.writeStringField("complianceGracePeriodExpirationDateTime", + this.complianceGracePeriodExpirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.complianceGracePeriodExpirationDateTime)); + jsonWriter.writeStringField("complianceState", + this.complianceState == null ? null : this.complianceState.toString()); + jsonWriter.writeJsonField("configurationManagerClientEnabledFeatures", + this.configurationManagerClientEnabledFeatures); + jsonWriter.writeArrayField("deviceActionResults", this.deviceActionResults, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("deviceCategoryDisplayName", this.deviceCategoryDisplayName); + jsonWriter.writeStringField("deviceEnrollmentType", + this.deviceEnrollmentType == null ? null : this.deviceEnrollmentType.toString()); + jsonWriter.writeJsonField("deviceHealthAttestationState", this.deviceHealthAttestationState); + jsonWriter.writeStringField("deviceName", this.deviceName); + jsonWriter.writeStringField("deviceRegistrationState", + this.deviceRegistrationState == null ? null : this.deviceRegistrationState.toString()); + jsonWriter.writeBooleanField("easActivated", this.easActivated); + jsonWriter.writeStringField("easActivationDateTime", + this.easActivationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.easActivationDateTime)); + jsonWriter.writeStringField("easDeviceId", this.easDeviceId); + jsonWriter.writeStringField("emailAddress", this.emailAddress); + jsonWriter.writeStringField("enrolledDateTime", + this.enrolledDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.enrolledDateTime)); + jsonWriter.writeStringField("exchangeAccessState", + this.exchangeAccessState == null ? null : this.exchangeAccessState.toString()); + jsonWriter.writeStringField("exchangeAccessStateReason", + this.exchangeAccessStateReason == null ? null : this.exchangeAccessStateReason.toString()); + jsonWriter.writeStringField("exchangeLastSuccessfulSyncDateTime", + this.exchangeLastSuccessfulSyncDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.exchangeLastSuccessfulSyncDateTime)); + jsonWriter.writeNumberField("freeStorageSpaceInBytes", this.freeStorageSpaceInBytes); + jsonWriter.writeStringField("imei", this.imei); + jsonWriter.writeBooleanField("isEncrypted", this.isEncrypted); + jsonWriter.writeBooleanField("isSupervised", this.isSupervised); + jsonWriter.writeStringField("jailBroken", this.jailBroken); + jsonWriter.writeStringField("lastSyncDateTime", + this.lastSyncDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastSyncDateTime)); + jsonWriter.writeStringField("managedDeviceName", this.managedDeviceName); + jsonWriter.writeStringField("managedDeviceOwnerType", + this.managedDeviceOwnerType == null ? null : this.managedDeviceOwnerType.toString()); + jsonWriter.writeStringField("managementAgent", + this.managementAgent == null ? null : this.managementAgent.toString()); + jsonWriter.writeStringField("manufacturer", this.manufacturer); + jsonWriter.writeStringField("meid", this.meid); + jsonWriter.writeStringField("model", this.model); + jsonWriter.writeStringField("operatingSystem", this.operatingSystem); + jsonWriter.writeStringField("osVersion", this.osVersion); + jsonWriter.writeStringField("partnerReportedThreatState", + this.partnerReportedThreatState == null ? null : this.partnerReportedThreatState.toString()); + jsonWriter.writeStringField("phoneNumber", this.phoneNumber); + jsonWriter.writeStringField("remoteAssistanceSessionErrorDetails", this.remoteAssistanceSessionErrorDetails); + jsonWriter.writeStringField("remoteAssistanceSessionUrl", this.remoteAssistanceSessionUrl); + jsonWriter.writeStringField("serialNumber", this.serialNumber); + jsonWriter.writeStringField("subscriberCarrier", this.subscriberCarrier); + jsonWriter.writeNumberField("totalStorageSpaceInBytes", this.totalStorageSpaceInBytes); + jsonWriter.writeStringField("userDisplayName", this.userDisplayName); + jsonWriter.writeStringField("userId", this.userId); + jsonWriter.writeStringField("userPrincipalName", this.userPrincipalName); + jsonWriter.writeStringField("wiFiMacAddress", this.wiFiMacAddress); + jsonWriter.writeArrayField("deviceCompliancePolicyStates", this.deviceCompliancePolicyStates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("deviceConfigurationStates", this.deviceConfigurationStates, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("deviceCategory", this.deviceCategory); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphManagedDevice from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphManagedDevice 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 MicrosoftGraphManagedDevice. + */ + public static MicrosoftGraphManagedDevice fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphManagedDevice deserializedMicrosoftGraphManagedDevice = new MicrosoftGraphManagedDevice(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.withId(reader.getString()); + } else if ("activationLockBypassCode".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.activationLockBypassCode = reader.getString(); + } else if ("androidSecurityPatchLevel".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.androidSecurityPatchLevel = reader.getString(); + } else if ("azureADDeviceId".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.azureADDeviceId = reader.getString(); + } else if ("azureADRegistered".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.azureADRegistered + = reader.getNullable(JsonReader::getBoolean); + } else if ("complianceGracePeriodExpirationDateTime".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.complianceGracePeriodExpirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("complianceState".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.complianceState + = MicrosoftGraphComplianceState.fromString(reader.getString()); + } else if ("configurationManagerClientEnabledFeatures".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.configurationManagerClientEnabledFeatures + = MicrosoftGraphConfigurationManagerClientEnabledFeatures.fromJson(reader); + } else if ("deviceActionResults".equals(fieldName)) { + List deviceActionResults + = reader.readArray(reader1 -> MicrosoftGraphDeviceActionResult.fromJson(reader1)); + deserializedMicrosoftGraphManagedDevice.deviceActionResults = deviceActionResults; + } else if ("deviceCategoryDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.deviceCategoryDisplayName = reader.getString(); + } else if ("deviceEnrollmentType".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.deviceEnrollmentType + = MicrosoftGraphDeviceEnrollmentType.fromString(reader.getString()); + } else if ("deviceHealthAttestationState".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.deviceHealthAttestationState + = MicrosoftGraphDeviceHealthAttestationState.fromJson(reader); + } else if ("deviceName".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.deviceName = reader.getString(); + } else if ("deviceRegistrationState".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.deviceRegistrationState + = MicrosoftGraphDeviceRegistrationState.fromString(reader.getString()); + } else if ("easActivated".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.easActivated = reader.getNullable(JsonReader::getBoolean); + } else if ("easActivationDateTime".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.easActivationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("easDeviceId".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.easDeviceId = reader.getString(); + } else if ("emailAddress".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.emailAddress = reader.getString(); + } else if ("enrolledDateTime".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.enrolledDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("exchangeAccessState".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.exchangeAccessState + = MicrosoftGraphDeviceManagementExchangeAccessState.fromString(reader.getString()); + } else if ("exchangeAccessStateReason".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.exchangeAccessStateReason + = MicrosoftGraphDeviceManagementExchangeAccessStateReason.fromString(reader.getString()); + } else if ("exchangeLastSuccessfulSyncDateTime".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.exchangeLastSuccessfulSyncDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("freeStorageSpaceInBytes".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.freeStorageSpaceInBytes + = reader.getNullable(JsonReader::getLong); + } else if ("imei".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.imei = reader.getString(); + } else if ("isEncrypted".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.isEncrypted = reader.getNullable(JsonReader::getBoolean); + } else if ("isSupervised".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.isSupervised = reader.getNullable(JsonReader::getBoolean); + } else if ("jailBroken".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.jailBroken = reader.getString(); + } else if ("lastSyncDateTime".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.lastSyncDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("managedDeviceName".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.managedDeviceName = reader.getString(); + } else if ("managedDeviceOwnerType".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.managedDeviceOwnerType + = MicrosoftGraphManagedDeviceOwnerType.fromString(reader.getString()); + } else if ("managementAgent".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.managementAgent + = MicrosoftGraphManagementAgentType.fromString(reader.getString()); + } else if ("manufacturer".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.manufacturer = reader.getString(); + } else if ("meid".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.meid = reader.getString(); + } else if ("model".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.model = reader.getString(); + } else if ("operatingSystem".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.operatingSystem = reader.getString(); + } else if ("osVersion".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.osVersion = reader.getString(); + } else if ("partnerReportedThreatState".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.partnerReportedThreatState + = MicrosoftGraphManagedDevicePartnerReportedHealthState.fromString(reader.getString()); + } else if ("phoneNumber".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.phoneNumber = reader.getString(); + } else if ("remoteAssistanceSessionErrorDetails".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.remoteAssistanceSessionErrorDetails = reader.getString(); + } else if ("remoteAssistanceSessionUrl".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.remoteAssistanceSessionUrl = reader.getString(); + } else if ("serialNumber".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.serialNumber = reader.getString(); + } else if ("subscriberCarrier".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.subscriberCarrier = reader.getString(); + } else if ("totalStorageSpaceInBytes".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.totalStorageSpaceInBytes + = reader.getNullable(JsonReader::getLong); + } else if ("userDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.userDisplayName = reader.getString(); + } else if ("userId".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.userId = reader.getString(); + } else if ("userPrincipalName".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.userPrincipalName = reader.getString(); + } else if ("wiFiMacAddress".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.wiFiMacAddress = reader.getString(); + } else if ("deviceCompliancePolicyStates".equals(fieldName)) { + List deviceCompliancePolicyStates + = reader.readArray(reader1 -> MicrosoftGraphDeviceCompliancePolicyState.fromJson(reader1)); + deserializedMicrosoftGraphManagedDevice.deviceCompliancePolicyStates = deviceCompliancePolicyStates; + } else if ("deviceConfigurationStates".equals(fieldName)) { + List deviceConfigurationStates + = reader.readArray(reader1 -> MicrosoftGraphDeviceConfigurationState.fromJson(reader1)); + deserializedMicrosoftGraphManagedDevice.deviceConfigurationStates = deviceConfigurationStates; + } else if ("deviceCategory".equals(fieldName)) { + deserializedMicrosoftGraphManagedDevice.deviceCategory + = MicrosoftGraphDeviceCategory.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphManagedDevice.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphManagedDevice; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDeviceOwnerType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDeviceOwnerType.java index 1851333934a94..ecca018464d74 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDeviceOwnerType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDeviceOwnerType.java @@ -5,24 +5,31 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** managedDeviceOwnerType. */ +/** + * managedDeviceOwnerType. + */ public final class MicrosoftGraphManagedDeviceOwnerType extends ExpandableStringEnum { - /** Static value unknown for MicrosoftGraphManagedDeviceOwnerType. */ + /** + * Static value unknown for MicrosoftGraphManagedDeviceOwnerType. + */ public static final MicrosoftGraphManagedDeviceOwnerType UNKNOWN = fromString("unknown"); - /** Static value company for MicrosoftGraphManagedDeviceOwnerType. */ + /** + * Static value company for MicrosoftGraphManagedDeviceOwnerType. + */ public static final MicrosoftGraphManagedDeviceOwnerType COMPANY = fromString("company"); - /** Static value personal for MicrosoftGraphManagedDeviceOwnerType. */ + /** + * Static value personal for MicrosoftGraphManagedDeviceOwnerType. + */ public static final MicrosoftGraphManagedDeviceOwnerType PERSONAL = fromString("personal"); /** * Creates a new instance of MicrosoftGraphManagedDeviceOwnerType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -31,18 +38,17 @@ public MicrosoftGraphManagedDeviceOwnerType() { /** * Creates or finds a MicrosoftGraphManagedDeviceOwnerType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphManagedDeviceOwnerType. */ - @JsonCreator public static MicrosoftGraphManagedDeviceOwnerType fromString(String name) { return fromString(name, MicrosoftGraphManagedDeviceOwnerType.class); } /** * Gets known MicrosoftGraphManagedDeviceOwnerType values. - * + * * @return known MicrosoftGraphManagedDeviceOwnerType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDevicePartnerReportedHealthState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDevicePartnerReportedHealthState.java index aa6dcab0f806d..770d18b081428 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDevicePartnerReportedHealthState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagedDevicePartnerReportedHealthState.java @@ -5,48 +5,69 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** managedDevicePartnerReportedHealthState. */ +/** + * managedDevicePartnerReportedHealthState. + */ public final class MicrosoftGraphManagedDevicePartnerReportedHealthState extends ExpandableStringEnum { - /** Static value unknown for MicrosoftGraphManagedDevicePartnerReportedHealthState. */ + /** + * Static value unknown for MicrosoftGraphManagedDevicePartnerReportedHealthState. + */ public static final MicrosoftGraphManagedDevicePartnerReportedHealthState UNKNOWN = fromString("unknown"); - /** Static value activated for MicrosoftGraphManagedDevicePartnerReportedHealthState. */ + /** + * Static value activated for MicrosoftGraphManagedDevicePartnerReportedHealthState. + */ public static final MicrosoftGraphManagedDevicePartnerReportedHealthState ACTIVATED = fromString("activated"); - /** Static value deactivated for MicrosoftGraphManagedDevicePartnerReportedHealthState. */ + /** + * Static value deactivated for MicrosoftGraphManagedDevicePartnerReportedHealthState. + */ public static final MicrosoftGraphManagedDevicePartnerReportedHealthState DEACTIVATED = fromString("deactivated"); - /** Static value secured for MicrosoftGraphManagedDevicePartnerReportedHealthState. */ + /** + * Static value secured for MicrosoftGraphManagedDevicePartnerReportedHealthState. + */ public static final MicrosoftGraphManagedDevicePartnerReportedHealthState SECURED = fromString("secured"); - /** Static value lowSeverity for MicrosoftGraphManagedDevicePartnerReportedHealthState. */ + /** + * Static value lowSeverity for MicrosoftGraphManagedDevicePartnerReportedHealthState. + */ public static final MicrosoftGraphManagedDevicePartnerReportedHealthState LOW_SEVERITY = fromString("lowSeverity"); - /** Static value mediumSeverity for MicrosoftGraphManagedDevicePartnerReportedHealthState. */ - public static final MicrosoftGraphManagedDevicePartnerReportedHealthState MEDIUM_SEVERITY = - fromString("mediumSeverity"); + /** + * Static value mediumSeverity for MicrosoftGraphManagedDevicePartnerReportedHealthState. + */ + public static final MicrosoftGraphManagedDevicePartnerReportedHealthState MEDIUM_SEVERITY + = fromString("mediumSeverity"); - /** Static value highSeverity for MicrosoftGraphManagedDevicePartnerReportedHealthState. */ - public static final MicrosoftGraphManagedDevicePartnerReportedHealthState HIGH_SEVERITY = - fromString("highSeverity"); + /** + * Static value highSeverity for MicrosoftGraphManagedDevicePartnerReportedHealthState. + */ + public static final MicrosoftGraphManagedDevicePartnerReportedHealthState HIGH_SEVERITY + = fromString("highSeverity"); - /** Static value unresponsive for MicrosoftGraphManagedDevicePartnerReportedHealthState. */ + /** + * Static value unresponsive for MicrosoftGraphManagedDevicePartnerReportedHealthState. + */ public static final MicrosoftGraphManagedDevicePartnerReportedHealthState UNRESPONSIVE = fromString("unresponsive"); - /** Static value compromised for MicrosoftGraphManagedDevicePartnerReportedHealthState. */ + /** + * Static value compromised for MicrosoftGraphManagedDevicePartnerReportedHealthState. + */ public static final MicrosoftGraphManagedDevicePartnerReportedHealthState COMPROMISED = fromString("compromised"); - /** Static value misconfigured for MicrosoftGraphManagedDevicePartnerReportedHealthState. */ - public static final MicrosoftGraphManagedDevicePartnerReportedHealthState MISCONFIGURED = - fromString("misconfigured"); + /** + * Static value misconfigured for MicrosoftGraphManagedDevicePartnerReportedHealthState. + */ + public static final MicrosoftGraphManagedDevicePartnerReportedHealthState MISCONFIGURED + = fromString("misconfigured"); /** * Creates a new instance of MicrosoftGraphManagedDevicePartnerReportedHealthState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -55,18 +76,17 @@ public MicrosoftGraphManagedDevicePartnerReportedHealthState() { /** * Creates or finds a MicrosoftGraphManagedDevicePartnerReportedHealthState from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphManagedDevicePartnerReportedHealthState. */ - @JsonCreator public static MicrosoftGraphManagedDevicePartnerReportedHealthState fromString(String name) { return fromString(name, MicrosoftGraphManagedDevicePartnerReportedHealthState.class); } /** * Gets known MicrosoftGraphManagedDevicePartnerReportedHealthState values. - * + * * @return known MicrosoftGraphManagedDevicePartnerReportedHealthState values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagementAgentType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagementAgentType.java index bf3983b92f364..a294a74627051 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagementAgentType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphManagementAgentType.java @@ -5,51 +5,74 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** managementAgentType. */ +/** + * managementAgentType. + */ public final class MicrosoftGraphManagementAgentType extends ExpandableStringEnum { - /** Static value eas for MicrosoftGraphManagementAgentType. */ + /** + * Static value eas for MicrosoftGraphManagementAgentType. + */ public static final MicrosoftGraphManagementAgentType EAS = fromString("eas"); - /** Static value mdm for MicrosoftGraphManagementAgentType. */ + /** + * Static value mdm for MicrosoftGraphManagementAgentType. + */ public static final MicrosoftGraphManagementAgentType MDM = fromString("mdm"); - /** Static value easMdm for MicrosoftGraphManagementAgentType. */ + /** + * Static value easMdm for MicrosoftGraphManagementAgentType. + */ public static final MicrosoftGraphManagementAgentType EAS_MDM = fromString("easMdm"); - /** Static value intuneClient for MicrosoftGraphManagementAgentType. */ + /** + * Static value intuneClient for MicrosoftGraphManagementAgentType. + */ public static final MicrosoftGraphManagementAgentType INTUNE_CLIENT = fromString("intuneClient"); - /** Static value easIntuneClient for MicrosoftGraphManagementAgentType. */ + /** + * Static value easIntuneClient for MicrosoftGraphManagementAgentType. + */ public static final MicrosoftGraphManagementAgentType EAS_INTUNE_CLIENT = fromString("easIntuneClient"); - /** Static value configurationManagerClient for MicrosoftGraphManagementAgentType. */ - public static final MicrosoftGraphManagementAgentType CONFIGURATION_MANAGER_CLIENT = - fromString("configurationManagerClient"); + /** + * Static value configurationManagerClient for MicrosoftGraphManagementAgentType. + */ + public static final MicrosoftGraphManagementAgentType CONFIGURATION_MANAGER_CLIENT + = fromString("configurationManagerClient"); - /** Static value configurationManagerClientMdm for MicrosoftGraphManagementAgentType. */ - public static final MicrosoftGraphManagementAgentType CONFIGURATION_MANAGER_CLIENT_MDM = - fromString("configurationManagerClientMdm"); + /** + * Static value configurationManagerClientMdm for MicrosoftGraphManagementAgentType. + */ + public static final MicrosoftGraphManagementAgentType CONFIGURATION_MANAGER_CLIENT_MDM + = fromString("configurationManagerClientMdm"); - /** Static value configurationManagerClientMdmEas for MicrosoftGraphManagementAgentType. */ - public static final MicrosoftGraphManagementAgentType CONFIGURATION_MANAGER_CLIENT_MDM_EAS = - fromString("configurationManagerClientMdmEas"); + /** + * Static value configurationManagerClientMdmEas for MicrosoftGraphManagementAgentType. + */ + public static final MicrosoftGraphManagementAgentType CONFIGURATION_MANAGER_CLIENT_MDM_EAS + = fromString("configurationManagerClientMdmEas"); - /** Static value unknown for MicrosoftGraphManagementAgentType. */ + /** + * Static value unknown for MicrosoftGraphManagementAgentType. + */ public static final MicrosoftGraphManagementAgentType UNKNOWN = fromString("unknown"); - /** Static value jamf for MicrosoftGraphManagementAgentType. */ + /** + * Static value jamf for MicrosoftGraphManagementAgentType. + */ public static final MicrosoftGraphManagementAgentType JAMF = fromString("jamf"); - /** Static value googleCloudDevicePolicyController for MicrosoftGraphManagementAgentType. */ - public static final MicrosoftGraphManagementAgentType GOOGLE_CLOUD_DEVICE_POLICY_CONTROLLER = - fromString("googleCloudDevicePolicyController"); + /** + * Static value googleCloudDevicePolicyController for MicrosoftGraphManagementAgentType. + */ + public static final MicrosoftGraphManagementAgentType GOOGLE_CLOUD_DEVICE_POLICY_CONTROLLER + = fromString("googleCloudDevicePolicyController"); /** * Creates a new instance of MicrosoftGraphManagementAgentType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -58,18 +81,17 @@ public MicrosoftGraphManagementAgentType() { /** * Creates or finds a MicrosoftGraphManagementAgentType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphManagementAgentType. */ - @JsonCreator public static MicrosoftGraphManagementAgentType fromString(String name) { return fromString(name, MicrosoftGraphManagementAgentType.class); } /** * Gets known MicrosoftGraphManagementAgentType values. - * + * * @return known MicrosoftGraphManagementAgentType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMdmAuthority.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMdmAuthority.java index 7e55ef9aa2d5a..df7fa71168bf6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMdmAuthority.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMdmAuthority.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** mdmAuthority. */ +/** + * mdmAuthority. + */ public final class MicrosoftGraphMdmAuthority extends ExpandableStringEnum { - /** Static value unknown for MicrosoftGraphMdmAuthority. */ + /** + * Static value unknown for MicrosoftGraphMdmAuthority. + */ public static final MicrosoftGraphMdmAuthority UNKNOWN = fromString("unknown"); - /** Static value intune for MicrosoftGraphMdmAuthority. */ + /** + * Static value intune for MicrosoftGraphMdmAuthority. + */ public static final MicrosoftGraphMdmAuthority INTUNE = fromString("intune"); - /** Static value sccm for MicrosoftGraphMdmAuthority. */ + /** + * Static value sccm for MicrosoftGraphMdmAuthority. + */ public static final MicrosoftGraphMdmAuthority SCCM = fromString("sccm"); - /** Static value office365 for MicrosoftGraphMdmAuthority. */ + /** + * Static value office365 for MicrosoftGraphMdmAuthority. + */ public static final MicrosoftGraphMdmAuthority OFFICE365 = fromString("office365"); /** * Creates a new instance of MicrosoftGraphMdmAuthority value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public MicrosoftGraphMdmAuthority() { /** * Creates or finds a MicrosoftGraphMdmAuthority from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphMdmAuthority. */ - @JsonCreator public static MicrosoftGraphMdmAuthority fromString(String name) { return fromString(name, MicrosoftGraphMdmAuthority.class); } /** * Gets known MicrosoftGraphMdmAuthority values. - * + * * @return known MicrosoftGraphMdmAuthority values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMeetingParticipantInfo.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMeetingParticipantInfo.java index 41f46a24feb01..2abee31a2a5d5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMeetingParticipantInfo.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMeetingParticipantInfo.java @@ -5,46 +5,49 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** meetingParticipantInfo. */ +/** + * meetingParticipantInfo. + */ @Fluent -public final class MicrosoftGraphMeetingParticipantInfo { +public final class MicrosoftGraphMeetingParticipantInfo + implements JsonSerializable { /* * identitySet */ - @JsonProperty(value = "identity") private MicrosoftGraphIdentitySet identity; /* * onlineMeetingRole */ - @JsonProperty(value = "role") private MicrosoftGraphOnlineMeetingRole role; /* * User principal name of the participant. */ - @JsonProperty(value = "upn") private String upn; /* * meetingParticipantInfo */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphMeetingParticipantInfo class. */ + /** + * Creates an instance of MicrosoftGraphMeetingParticipantInfo class. + */ public MicrosoftGraphMeetingParticipantInfo() { } /** * Get the identity property: identitySet. - * + * * @return the identity value. */ public MicrosoftGraphIdentitySet identity() { @@ -53,7 +56,7 @@ public MicrosoftGraphIdentitySet identity() { /** * Set the identity property: identitySet. - * + * * @param identity the identity value to set. * @return the MicrosoftGraphMeetingParticipantInfo object itself. */ @@ -64,7 +67,7 @@ public MicrosoftGraphMeetingParticipantInfo withIdentity(MicrosoftGraphIdentityS /** * Get the role property: onlineMeetingRole. - * + * * @return the role value. */ public MicrosoftGraphOnlineMeetingRole role() { @@ -73,7 +76,7 @@ public MicrosoftGraphOnlineMeetingRole role() { /** * Set the role property: onlineMeetingRole. - * + * * @param role the role value to set. * @return the MicrosoftGraphMeetingParticipantInfo object itself. */ @@ -84,7 +87,7 @@ public MicrosoftGraphMeetingParticipantInfo withRole(MicrosoftGraphOnlineMeeting /** * Get the upn property: User principal name of the participant. - * + * * @return the upn value. */ public String upn() { @@ -93,7 +96,7 @@ public String upn() { /** * Set the upn property: User principal name of the participant. - * + * * @param upn the upn value to set. * @return the MicrosoftGraphMeetingParticipantInfo object itself. */ @@ -104,17 +107,16 @@ public MicrosoftGraphMeetingParticipantInfo withUpn(String upn) { /** * Get the additionalProperties property: meetingParticipantInfo. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: meetingParticipantInfo. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphMeetingParticipantInfo object itself. */ @@ -123,17 +125,9 @@ public MicrosoftGraphMeetingParticipantInfo withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -141,4 +135,60 @@ public void validate() { identity().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); + jsonWriter.writeStringField("upn", this.upn); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphMeetingParticipantInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphMeetingParticipantInfo 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 MicrosoftGraphMeetingParticipantInfo. + */ + public static MicrosoftGraphMeetingParticipantInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphMeetingParticipantInfo deserializedMicrosoftGraphMeetingParticipantInfo + = new MicrosoftGraphMeetingParticipantInfo(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedMicrosoftGraphMeetingParticipantInfo.identity + = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("role".equals(fieldName)) { + deserializedMicrosoftGraphMeetingParticipantInfo.role + = MicrosoftGraphOnlineMeetingRole.fromString(reader.getString()); + } else if ("upn".equals(fieldName)) { + deserializedMicrosoftGraphMeetingParticipantInfo.upn = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphMeetingParticipantInfo.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphMeetingParticipantInfo; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMeetingParticipants.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMeetingParticipants.java index fcdb22aa107b7..6f8ec79e4cad8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMeetingParticipants.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMeetingParticipants.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** meetingParticipants. */ +/** + * meetingParticipants. + */ @Fluent -public final class MicrosoftGraphMeetingParticipants { +public final class MicrosoftGraphMeetingParticipants implements JsonSerializable { /* * The attendees property. */ - @JsonProperty(value = "attendees") private List attendees; /* * meetingParticipantInfo */ - @JsonProperty(value = "organizer") private MicrosoftGraphMeetingParticipantInfo organizer; /* * meetingParticipants */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphMeetingParticipants class. */ + /** + * Creates an instance of MicrosoftGraphMeetingParticipants class. + */ public MicrosoftGraphMeetingParticipants() { } /** * Get the attendees property: The attendees property. - * + * * @return the attendees value. */ public List attendees() { @@ -48,7 +51,7 @@ public List attendees() { /** * Set the attendees property: The attendees property. - * + * * @param attendees the attendees value to set. * @return the MicrosoftGraphMeetingParticipants object itself. */ @@ -59,7 +62,7 @@ public MicrosoftGraphMeetingParticipants withAttendees(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: meetingParticipants. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphMeetingParticipants object itself. */ @@ -98,17 +100,9 @@ public MicrosoftGraphMeetingParticipants withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -119,4 +113,58 @@ public void validate() { organizer().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("attendees", this.attendees, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("organizer", this.organizer); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphMeetingParticipants from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphMeetingParticipants 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 MicrosoftGraphMeetingParticipants. + */ + public static MicrosoftGraphMeetingParticipants fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphMeetingParticipants deserializedMicrosoftGraphMeetingParticipants + = new MicrosoftGraphMeetingParticipants(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attendees".equals(fieldName)) { + List attendees + = reader.readArray(reader1 -> MicrosoftGraphMeetingParticipantInfo.fromJson(reader1)); + deserializedMicrosoftGraphMeetingParticipants.attendees = attendees; + } else if ("organizer".equals(fieldName)) { + deserializedMicrosoftGraphMeetingParticipants.organizer + = MicrosoftGraphMeetingParticipantInfo.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphMeetingParticipants.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphMeetingParticipants; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessage.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessage.java index 2be23cb49289b..17f43e697f11c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessage.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessage.java @@ -7,16 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.Base64Url; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -/** message. */ +/** + * message. + */ @Fluent public final class MicrosoftGraphMessage extends MicrosoftGraphOutlookItem { private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; @@ -24,49 +28,41 @@ public final class MicrosoftGraphMessage extends MicrosoftGraphOutlookItem { /* * The Bcc: recipients for the message. */ - @JsonProperty(value = "bccRecipients") private List bccRecipients; /* * itemBody */ - @JsonProperty(value = "body") private MicrosoftGraphItemBody body; /* * The first 255 characters of the message body. It is in text format. */ - @JsonProperty(value = "bodyPreview") private String bodyPreview; /* * The Cc: recipients for the message. */ - @JsonProperty(value = "ccRecipients") private List ccRecipients; /* * The ID of the conversation the email belongs to. */ - @JsonProperty(value = "conversationId") private String conversationId; /* * Indicates the position of the message within the conversation. */ - @JsonProperty(value = "conversationIndex") private Base64Url conversationIndex; /* * followupFlag */ - @JsonProperty(value = "flag") private MicrosoftGraphFollowupFlag flag; /* * recipient */ - @JsonProperty(value = "from") private MicrosoftGraphRecipient from; /* @@ -74,156 +70,136 @@ public final class MicrosoftGraphMessage extends MicrosoftGraphOutlookItem { * contains only inline attachments, this property is false. To verify the existence of inline attachments, parse * the body property to look for a src attribute, such as . */ - @JsonProperty(value = "hasAttachments") private Boolean hasAttachments; /* * importance */ - @JsonProperty(value = "importance") private MicrosoftGraphImportance importance; /* * inferenceClassificationType */ - @JsonProperty(value = "inferenceClassification") private MicrosoftGraphInferenceClassificationType inferenceClassification; /* * A collection of message headers defined by RFC5322. The set includes message headers indicating the network path * taken by a message from the sender to the recipient. It can also contain custom message headers that hold app - * data for the message. Returned only on applying a $select query option. Read-only. + * data for the message. Returned only on applying a $select query option. Read-only. */ - @JsonProperty(value = "internetMessageHeaders") private List internetMessageHeaders; /* * The message ID in the format specified by RFC2822. */ - @JsonProperty(value = "internetMessageId") private String internetMessageId; /* * Indicates whether a read receipt is requested for the message. */ - @JsonProperty(value = "isDeliveryReceiptRequested") private Boolean isDeliveryReceiptRequested; /* * Indicates whether the message is a draft. A message is a draft if it hasn't been sent yet. */ - @JsonProperty(value = "isDraft") private Boolean isDraft; /* * Indicates whether the message has been read. */ - @JsonProperty(value = "isRead") private Boolean isRead; /* * Indicates whether a read receipt is requested for the message. */ - @JsonProperty(value = "isReadReceiptRequested") private Boolean isReadReceiptRequested; /* * The unique identifier for the message's parent mailFolder. */ - @JsonProperty(value = "parentFolderId") private String parentFolderId; /* - * The date and time the message was received. The date and time information uses ISO 8601 format and is always in + * The date and time the message was received. The date and time information uses ISO 8601 format and is always in * UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. */ - @JsonProperty(value = "receivedDateTime") private OffsetDateTime receivedDateTime; /* * The email addresses to use when replying. */ - @JsonProperty(value = "replyTo") private List replyTo; /* * recipient */ - @JsonProperty(value = "sender") private MicrosoftGraphRecipient sender; /* - * The date and time the message was sent. The date and time information uses ISO 8601 format and is always in UTC + * The date and time the message was sent. The date and time information uses ISO 8601 format and is always in UTC * time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. */ - @JsonProperty(value = "sentDateTime") private OffsetDateTime sentDateTime; /* * The subject of the message. */ - @JsonProperty(value = "subject") private String subject; /* * The To: recipients for the message. */ - @JsonProperty(value = "toRecipients") private List toRecipients; /* * itemBody */ - @JsonProperty(value = "uniqueBody") private MicrosoftGraphItemBody uniqueBody; /* * The URL to open the message in Outlook on the web.You can append an ispopout argument to the end of the URL to * change how the message is displayed. If ispopout is not present or if it is set to 1, then the message is shown * in a popout window. If ispopout is set to 0, then the browser will show the message in the Outlook on the web - * review pane.The message will open in the browser if you are logged in to your mailbox via Outlook on the web. - * You will be prompted to login if you are not already logged in with the browser.This URL cannot be accessed from + * review pane.The message will open in the browser if you are logged in to your mailbox via Outlook on the web. You + * will be prompted to login if you are not already logged in with the browser.This URL cannot be accessed from * within an iFrame. */ - @JsonProperty(value = "webLink") private String webLink; /* * The fileAttachment and itemAttachment attachments for the message. */ - @JsonProperty(value = "attachments") private List attachments; /* * The collection of open extensions defined for the message. Nullable. */ - @JsonProperty(value = "extensions") private List extensions; /* * The collection of multi-value extended properties defined for the message. Nullable. */ - @JsonProperty(value = "multiValueExtendedProperties") private List multiValueExtendedProperties; /* * The collection of single-value extended properties defined for the message. Nullable. */ - @JsonProperty(value = "singleValueExtendedProperties") private List singleValueExtendedProperties; /* * message */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphMessage class. */ + /** + * Creates an instance of MicrosoftGraphMessage class. + */ public MicrosoftGraphMessage() { } /** * Get the bccRecipients property: The Bcc: recipients for the message. - * + * * @return the bccRecipients value. */ public List bccRecipients() { @@ -232,7 +208,7 @@ public List bccRecipients() { /** * Set the bccRecipients property: The Bcc: recipients for the message. - * + * * @param bccRecipients the bccRecipients value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -243,7 +219,7 @@ public MicrosoftGraphMessage withBccRecipients(List bcc /** * Get the body property: itemBody. - * + * * @return the body value. */ public MicrosoftGraphItemBody body() { @@ -252,7 +228,7 @@ public MicrosoftGraphItemBody body() { /** * Set the body property: itemBody. - * + * * @param body the body value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -263,7 +239,7 @@ public MicrosoftGraphMessage withBody(MicrosoftGraphItemBody body) { /** * Get the bodyPreview property: The first 255 characters of the message body. It is in text format. - * + * * @return the bodyPreview value. */ public String bodyPreview() { @@ -272,7 +248,7 @@ public String bodyPreview() { /** * Set the bodyPreview property: The first 255 characters of the message body. It is in text format. - * + * * @param bodyPreview the bodyPreview value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -283,7 +259,7 @@ public MicrosoftGraphMessage withBodyPreview(String bodyPreview) { /** * Get the ccRecipients property: The Cc: recipients for the message. - * + * * @return the ccRecipients value. */ public List ccRecipients() { @@ -292,7 +268,7 @@ public List ccRecipients() { /** * Set the ccRecipients property: The Cc: recipients for the message. - * + * * @param ccRecipients the ccRecipients value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -303,7 +279,7 @@ public MicrosoftGraphMessage withCcRecipients(List ccRe /** * Get the conversationId property: The ID of the conversation the email belongs to. - * + * * @return the conversationId value. */ public String conversationId() { @@ -312,7 +288,7 @@ public String conversationId() { /** * Set the conversationId property: The ID of the conversation the email belongs to. - * + * * @param conversationId the conversationId value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -323,7 +299,7 @@ public MicrosoftGraphMessage withConversationId(String conversationId) { /** * Get the conversationIndex property: Indicates the position of the message within the conversation. - * + * * @return the conversationIndex value. */ public byte[] conversationIndex() { @@ -335,7 +311,7 @@ public byte[] conversationIndex() { /** * Set the conversationIndex property: Indicates the position of the message within the conversation. - * + * * @param conversationIndex the conversationIndex value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -350,7 +326,7 @@ public MicrosoftGraphMessage withConversationIndex(byte[] conversationIndex) { /** * Get the flag property: followupFlag. - * + * * @return the flag value. */ public MicrosoftGraphFollowupFlag flag() { @@ -359,7 +335,7 @@ public MicrosoftGraphFollowupFlag flag() { /** * Set the flag property: followupFlag. - * + * * @param flag the flag value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -370,7 +346,7 @@ public MicrosoftGraphMessage withFlag(MicrosoftGraphFollowupFlag flag) { /** * Get the from property: recipient. - * + * * @return the from value. */ public MicrosoftGraphRecipient from() { @@ -379,7 +355,7 @@ public MicrosoftGraphRecipient from() { /** * Set the from property: recipient. - * + * * @param from the from value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -392,8 +368,8 @@ public MicrosoftGraphMessage withFrom(MicrosoftGraphRecipient from) { * Get the hasAttachments property: Indicates whether the message has attachments. This property doesn't include * inline attachments, so if a message contains only inline attachments, this property is false. To verify the * existence of inline attachments, parse the body property to look for a src attribute, such as <IMG - * src='cid:image001.jpg@01D26CD8.6C05F070'>. - * + * src='cid:image001.jpg@01D26CD8.6C05F070'>. + * * @return the hasAttachments value. */ public Boolean hasAttachments() { @@ -404,8 +380,8 @@ public Boolean hasAttachments() { * Set the hasAttachments property: Indicates whether the message has attachments. This property doesn't include * inline attachments, so if a message contains only inline attachments, this property is false. To verify the * existence of inline attachments, parse the body property to look for a src attribute, such as <IMG - * src='cid:image001.jpg@01D26CD8.6C05F070'>. - * + * src='cid:image001.jpg@01D26CD8.6C05F070'>. + * * @param hasAttachments the hasAttachments value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -416,7 +392,7 @@ public MicrosoftGraphMessage withHasAttachments(Boolean hasAttachments) { /** * Get the importance property: importance. - * + * * @return the importance value. */ public MicrosoftGraphImportance importance() { @@ -425,7 +401,7 @@ public MicrosoftGraphImportance importance() { /** * Set the importance property: importance. - * + * * @param importance the importance value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -436,7 +412,7 @@ public MicrosoftGraphMessage withImportance(MicrosoftGraphImportance importance) /** * Get the inferenceClassification property: inferenceClassificationType. - * + * * @return the inferenceClassification value. */ public MicrosoftGraphInferenceClassificationType inferenceClassification() { @@ -445,12 +421,12 @@ public MicrosoftGraphInferenceClassificationType inferenceClassification() { /** * Set the inferenceClassification property: inferenceClassificationType. - * + * * @param inferenceClassification the inferenceClassification value to set. * @return the MicrosoftGraphMessage object itself. */ - public MicrosoftGraphMessage withInferenceClassification( - MicrosoftGraphInferenceClassificationType inferenceClassification) { + public MicrosoftGraphMessage + withInferenceClassification(MicrosoftGraphInferenceClassificationType inferenceClassification) { this.inferenceClassification = inferenceClassification; return this; } @@ -460,7 +436,7 @@ public MicrosoftGraphMessage withInferenceClassification( * message headers indicating the network path taken by a message from the sender to the recipient. It can also * contain custom message headers that hold app data for the message. Returned only on applying a $select query * option. Read-only. - * + * * @return the internetMessageHeaders value. */ public List internetMessageHeaders() { @@ -472,19 +448,19 @@ public List internetMessageHeaders() { * message headers indicating the network path taken by a message from the sender to the recipient. It can also * contain custom message headers that hold app data for the message. Returned only on applying a $select query * option. Read-only. - * + * * @param internetMessageHeaders the internetMessageHeaders value to set. * @return the MicrosoftGraphMessage object itself. */ - public MicrosoftGraphMessage withInternetMessageHeaders( - List internetMessageHeaders) { + public MicrosoftGraphMessage + withInternetMessageHeaders(List internetMessageHeaders) { this.internetMessageHeaders = internetMessageHeaders; return this; } /** * Get the internetMessageId property: The message ID in the format specified by RFC2822. - * + * * @return the internetMessageId value. */ public String internetMessageId() { @@ -493,7 +469,7 @@ public String internetMessageId() { /** * Set the internetMessageId property: The message ID in the format specified by RFC2822. - * + * * @param internetMessageId the internetMessageId value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -504,7 +480,7 @@ public MicrosoftGraphMessage withInternetMessageId(String internetMessageId) { /** * Get the isDeliveryReceiptRequested property: Indicates whether a read receipt is requested for the message. - * + * * @return the isDeliveryReceiptRequested value. */ public Boolean isDeliveryReceiptRequested() { @@ -513,7 +489,7 @@ public Boolean isDeliveryReceiptRequested() { /** * Set the isDeliveryReceiptRequested property: Indicates whether a read receipt is requested for the message. - * + * * @param isDeliveryReceiptRequested the isDeliveryReceiptRequested value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -525,7 +501,7 @@ public MicrosoftGraphMessage withIsDeliveryReceiptRequested(Boolean isDeliveryRe /** * Get the isDraft property: Indicates whether the message is a draft. A message is a draft if it hasn't been sent * yet. - * + * * @return the isDraft value. */ public Boolean isDraft() { @@ -535,7 +511,7 @@ public Boolean isDraft() { /** * Set the isDraft property: Indicates whether the message is a draft. A message is a draft if it hasn't been sent * yet. - * + * * @param isDraft the isDraft value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -546,7 +522,7 @@ public MicrosoftGraphMessage withIsDraft(Boolean isDraft) { /** * Get the isRead property: Indicates whether the message has been read. - * + * * @return the isRead value. */ public Boolean isRead() { @@ -555,7 +531,7 @@ public Boolean isRead() { /** * Set the isRead property: Indicates whether the message has been read. - * + * * @param isRead the isRead value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -566,7 +542,7 @@ public MicrosoftGraphMessage withIsRead(Boolean isRead) { /** * Get the isReadReceiptRequested property: Indicates whether a read receipt is requested for the message. - * + * * @return the isReadReceiptRequested value. */ public Boolean isReadReceiptRequested() { @@ -575,7 +551,7 @@ public Boolean isReadReceiptRequested() { /** * Set the isReadReceiptRequested property: Indicates whether a read receipt is requested for the message. - * + * * @param isReadReceiptRequested the isReadReceiptRequested value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -586,7 +562,7 @@ public MicrosoftGraphMessage withIsReadReceiptRequested(Boolean isReadReceiptReq /** * Get the parentFolderId property: The unique identifier for the message's parent mailFolder. - * + * * @return the parentFolderId value. */ public String parentFolderId() { @@ -595,7 +571,7 @@ public String parentFolderId() { /** * Set the parentFolderId property: The unique identifier for the message's parent mailFolder. - * + * * @param parentFolderId the parentFolderId value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -608,7 +584,7 @@ public MicrosoftGraphMessage withParentFolderId(String parentFolderId) { * Get the receivedDateTime property: The date and time the message was received. The date and time information uses * ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @return the receivedDateTime value. */ public OffsetDateTime receivedDateTime() { @@ -619,7 +595,7 @@ public OffsetDateTime receivedDateTime() { * Set the receivedDateTime property: The date and time the message was received. The date and time information uses * ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @param receivedDateTime the receivedDateTime value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -630,7 +606,7 @@ public MicrosoftGraphMessage withReceivedDateTime(OffsetDateTime receivedDateTim /** * Get the replyTo property: The email addresses to use when replying. - * + * * @return the replyTo value. */ public List replyTo() { @@ -639,7 +615,7 @@ public List replyTo() { /** * Set the replyTo property: The email addresses to use when replying. - * + * * @param replyTo the replyTo value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -650,7 +626,7 @@ public MicrosoftGraphMessage withReplyTo(List replyTo) /** * Get the sender property: recipient. - * + * * @return the sender value. */ public MicrosoftGraphRecipient sender() { @@ -659,7 +635,7 @@ public MicrosoftGraphRecipient sender() { /** * Set the sender property: recipient. - * + * * @param sender the sender value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -672,7 +648,7 @@ public MicrosoftGraphMessage withSender(MicrosoftGraphRecipient sender) { * Get the sentDateTime property: The date and time the message was sent. The date and time information uses ISO * 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @return the sentDateTime value. */ public OffsetDateTime sentDateTime() { @@ -683,7 +659,7 @@ public OffsetDateTime sentDateTime() { * Set the sentDateTime property: The date and time the message was sent. The date and time information uses ISO * 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @param sentDateTime the sentDateTime value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -694,7 +670,7 @@ public MicrosoftGraphMessage withSentDateTime(OffsetDateTime sentDateTime) { /** * Get the subject property: The subject of the message. - * + * * @return the subject value. */ public String subject() { @@ -703,7 +679,7 @@ public String subject() { /** * Set the subject property: The subject of the message. - * + * * @param subject the subject value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -714,7 +690,7 @@ public MicrosoftGraphMessage withSubject(String subject) { /** * Get the toRecipients property: The To: recipients for the message. - * + * * @return the toRecipients value. */ public List toRecipients() { @@ -723,7 +699,7 @@ public List toRecipients() { /** * Set the toRecipients property: The To: recipients for the message. - * + * * @param toRecipients the toRecipients value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -734,7 +710,7 @@ public MicrosoftGraphMessage withToRecipients(List toRe /** * Get the uniqueBody property: itemBody. - * + * * @return the uniqueBody value. */ public MicrosoftGraphItemBody uniqueBody() { @@ -743,7 +719,7 @@ public MicrosoftGraphItemBody uniqueBody() { /** * Set the uniqueBody property: itemBody. - * + * * @param uniqueBody the uniqueBody value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -759,7 +735,7 @@ public MicrosoftGraphMessage withUniqueBody(MicrosoftGraphItemBody uniqueBody) { * the Outlook on the web review pane.The message will open in the browser if you are logged in to your mailbox via * Outlook on the web. You will be prompted to login if you are not already logged in with the browser.This URL * cannot be accessed from within an iFrame. - * + * * @return the webLink value. */ public String webLink() { @@ -773,7 +749,7 @@ public String webLink() { * the Outlook on the web review pane.The message will open in the browser if you are logged in to your mailbox via * Outlook on the web. You will be prompted to login if you are not already logged in with the browser.This URL * cannot be accessed from within an iFrame. - * + * * @param webLink the webLink value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -784,7 +760,7 @@ public MicrosoftGraphMessage withWebLink(String webLink) { /** * Get the attachments property: The fileAttachment and itemAttachment attachments for the message. - * + * * @return the attachments value. */ public List attachments() { @@ -793,7 +769,7 @@ public List attachments() { /** * Set the attachments property: The fileAttachment and itemAttachment attachments for the message. - * + * * @param attachments the attachments value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -804,7 +780,7 @@ public MicrosoftGraphMessage withAttachments(List atta /** * Get the extensions property: The collection of open extensions defined for the message. Nullable. - * + * * @return the extensions value. */ public List extensions() { @@ -813,7 +789,7 @@ public List extensions() { /** * Set the extensions property: The collection of open extensions defined for the message. Nullable. - * + * * @param extensions the extensions value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -825,7 +801,7 @@ public MicrosoftGraphMessage withExtensions(List extens /** * Get the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * message. Nullable. - * + * * @return the multiValueExtendedProperties value. */ public List multiValueExtendedProperties() { @@ -835,7 +811,7 @@ public List multiValueExtendedPr /** * Set the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * message. Nullable. - * + * * @param multiValueExtendedProperties the multiValueExtendedProperties value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -848,7 +824,7 @@ public MicrosoftGraphMessage withMultiValueExtendedProperties( /** * Get the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the message. Nullable. - * + * * @return the singleValueExtendedProperties value. */ public List singleValueExtendedProperties() { @@ -858,7 +834,7 @@ public List singleValueExtended /** * Set the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the message. Nullable. - * + * * @param singleValueExtendedProperties the singleValueExtendedProperties value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -870,17 +846,16 @@ public MicrosoftGraphMessage withSingleValueExtendedProperties( /** * Get the additionalProperties property: message. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: message. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphMessage object itself. */ @@ -889,43 +864,45 @@ public MicrosoftGraphMessage withAdditionalProperties(Map additi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphMessage withCategories(List categories) { super.withCategories(categories); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphMessage withChangeKey(String changeKey) { super.withChangeKey(changeKey); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphMessage withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphMessage withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphMessage withId(String id) { super.withId(id); @@ -934,7 +911,7 @@ public MicrosoftGraphMessage withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -983,4 +960,193 @@ public void validate() { singleValueExtendedProperties().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("categories", categories(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("changeKey", changeKey()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeArrayField("bccRecipients", this.bccRecipients, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("body", this.body); + jsonWriter.writeStringField("bodyPreview", this.bodyPreview); + jsonWriter.writeArrayField("ccRecipients", this.ccRecipients, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("conversationId", this.conversationId); + jsonWriter.writeStringField("conversationIndex", Objects.toString(this.conversationIndex, null)); + jsonWriter.writeJsonField("flag", this.flag); + jsonWriter.writeJsonField("from", this.from); + jsonWriter.writeBooleanField("hasAttachments", this.hasAttachments); + jsonWriter.writeStringField("importance", this.importance == null ? null : this.importance.toString()); + jsonWriter.writeStringField("inferenceClassification", + this.inferenceClassification == null ? null : this.inferenceClassification.toString()); + jsonWriter.writeArrayField("internetMessageHeaders", this.internetMessageHeaders, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("internetMessageId", this.internetMessageId); + jsonWriter.writeBooleanField("isDeliveryReceiptRequested", this.isDeliveryReceiptRequested); + jsonWriter.writeBooleanField("isDraft", this.isDraft); + jsonWriter.writeBooleanField("isRead", this.isRead); + jsonWriter.writeBooleanField("isReadReceiptRequested", this.isReadReceiptRequested); + jsonWriter.writeStringField("parentFolderId", this.parentFolderId); + jsonWriter.writeStringField("receivedDateTime", + this.receivedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.receivedDateTime)); + jsonWriter.writeArrayField("replyTo", this.replyTo, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("sender", this.sender); + jsonWriter.writeStringField("sentDateTime", + this.sentDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sentDateTime)); + jsonWriter.writeStringField("subject", this.subject); + jsonWriter.writeArrayField("toRecipients", this.toRecipients, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("uniqueBody", this.uniqueBody); + jsonWriter.writeStringField("webLink", this.webLink); + jsonWriter.writeArrayField("attachments", this.attachments, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("multiValueExtendedProperties", this.multiValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("singleValueExtendedProperties", this.singleValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphMessage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphMessage 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 MicrosoftGraphMessage. + */ + public static MicrosoftGraphMessage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphMessage deserializedMicrosoftGraphMessage = new MicrosoftGraphMessage(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphMessage.withId(reader.getString()); + } else if ("categories".equals(fieldName)) { + List categories = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphMessage.withCategories(categories); + } else if ("changeKey".equals(fieldName)) { + deserializedMicrosoftGraphMessage.withChangeKey(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphMessage.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphMessage.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("bccRecipients".equals(fieldName)) { + List bccRecipients + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphMessage.bccRecipients = bccRecipients; + } else if ("body".equals(fieldName)) { + deserializedMicrosoftGraphMessage.body = MicrosoftGraphItemBody.fromJson(reader); + } else if ("bodyPreview".equals(fieldName)) { + deserializedMicrosoftGraphMessage.bodyPreview = reader.getString(); + } else if ("ccRecipients".equals(fieldName)) { + List ccRecipients + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphMessage.ccRecipients = ccRecipients; + } else if ("conversationId".equals(fieldName)) { + deserializedMicrosoftGraphMessage.conversationId = reader.getString(); + } else if ("conversationIndex".equals(fieldName)) { + deserializedMicrosoftGraphMessage.conversationIndex + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("flag".equals(fieldName)) { + deserializedMicrosoftGraphMessage.flag = MicrosoftGraphFollowupFlag.fromJson(reader); + } else if ("from".equals(fieldName)) { + deserializedMicrosoftGraphMessage.from = MicrosoftGraphRecipient.fromJson(reader); + } else if ("hasAttachments".equals(fieldName)) { + deserializedMicrosoftGraphMessage.hasAttachments = reader.getNullable(JsonReader::getBoolean); + } else if ("importance".equals(fieldName)) { + deserializedMicrosoftGraphMessage.importance + = MicrosoftGraphImportance.fromString(reader.getString()); + } else if ("inferenceClassification".equals(fieldName)) { + deserializedMicrosoftGraphMessage.inferenceClassification + = MicrosoftGraphInferenceClassificationType.fromString(reader.getString()); + } else if ("internetMessageHeaders".equals(fieldName)) { + List internetMessageHeaders + = reader.readArray(reader1 -> MicrosoftGraphInternetMessageHeader.fromJson(reader1)); + deserializedMicrosoftGraphMessage.internetMessageHeaders = internetMessageHeaders; + } else if ("internetMessageId".equals(fieldName)) { + deserializedMicrosoftGraphMessage.internetMessageId = reader.getString(); + } else if ("isDeliveryReceiptRequested".equals(fieldName)) { + deserializedMicrosoftGraphMessage.isDeliveryReceiptRequested + = reader.getNullable(JsonReader::getBoolean); + } else if ("isDraft".equals(fieldName)) { + deserializedMicrosoftGraphMessage.isDraft = reader.getNullable(JsonReader::getBoolean); + } else if ("isRead".equals(fieldName)) { + deserializedMicrosoftGraphMessage.isRead = reader.getNullable(JsonReader::getBoolean); + } else if ("isReadReceiptRequested".equals(fieldName)) { + deserializedMicrosoftGraphMessage.isReadReceiptRequested + = reader.getNullable(JsonReader::getBoolean); + } else if ("parentFolderId".equals(fieldName)) { + deserializedMicrosoftGraphMessage.parentFolderId = reader.getString(); + } else if ("receivedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphMessage.receivedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("replyTo".equals(fieldName)) { + List replyTo + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphMessage.replyTo = replyTo; + } else if ("sender".equals(fieldName)) { + deserializedMicrosoftGraphMessage.sender = MicrosoftGraphRecipient.fromJson(reader); + } else if ("sentDateTime".equals(fieldName)) { + deserializedMicrosoftGraphMessage.sentDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("subject".equals(fieldName)) { + deserializedMicrosoftGraphMessage.subject = reader.getString(); + } else if ("toRecipients".equals(fieldName)) { + List toRecipients + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphMessage.toRecipients = toRecipients; + } else if ("uniqueBody".equals(fieldName)) { + deserializedMicrosoftGraphMessage.uniqueBody = MicrosoftGraphItemBody.fromJson(reader); + } else if ("webLink".equals(fieldName)) { + deserializedMicrosoftGraphMessage.webLink = reader.getString(); + } else if ("attachments".equals(fieldName)) { + List attachments + = reader.readArray(reader1 -> MicrosoftGraphAttachment.fromJson(reader1)); + deserializedMicrosoftGraphMessage.attachments = attachments; + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> MicrosoftGraphExtension.fromJson(reader1)); + deserializedMicrosoftGraphMessage.extensions = extensions; + } else if ("multiValueExtendedProperties".equals(fieldName)) { + List multiValueExtendedProperties + = reader.readArray(reader1 -> MicrosoftGraphMultiValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphMessage.multiValueExtendedProperties = multiValueExtendedProperties; + } else if ("singleValueExtendedProperties".equals(fieldName)) { + List singleValueExtendedProperties = reader + .readArray(reader1 -> MicrosoftGraphSingleValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphMessage.singleValueExtendedProperties = singleValueExtendedProperties; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphMessage.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphMessage; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageActionFlag.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageActionFlag.java index 112c368f1084c..5a611f8df3feb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageActionFlag.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageActionFlag.java @@ -5,47 +5,70 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** messageActionFlag. */ +/** + * messageActionFlag. + */ public final class MicrosoftGraphMessageActionFlag extends ExpandableStringEnum { - /** Static value any for MicrosoftGraphMessageActionFlag. */ + /** + * Static value any for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag ANY = fromString("any"); - /** Static value call for MicrosoftGraphMessageActionFlag. */ + /** + * Static value call for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag CALL = fromString("call"); - /** Static value doNotForward for MicrosoftGraphMessageActionFlag. */ + /** + * Static value doNotForward for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag DO_NOT_FORWARD = fromString("doNotForward"); - /** Static value followUp for MicrosoftGraphMessageActionFlag. */ + /** + * Static value followUp for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag FOLLOW_UP = fromString("followUp"); - /** Static value fyi for MicrosoftGraphMessageActionFlag. */ + /** + * Static value fyi for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag FYI = fromString("fyi"); - /** Static value forward for MicrosoftGraphMessageActionFlag. */ + /** + * Static value forward for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag FORWARD = fromString("forward"); - /** Static value noResponseNecessary for MicrosoftGraphMessageActionFlag. */ + /** + * Static value noResponseNecessary for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag NO_RESPONSE_NECESSARY = fromString("noResponseNecessary"); - /** Static value read for MicrosoftGraphMessageActionFlag. */ + /** + * Static value read for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag READ = fromString("read"); - /** Static value reply for MicrosoftGraphMessageActionFlag. */ + /** + * Static value reply for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag REPLY = fromString("reply"); - /** Static value replyToAll for MicrosoftGraphMessageActionFlag. */ + /** + * Static value replyToAll for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag REPLY_TO_ALL = fromString("replyToAll"); - /** Static value review for MicrosoftGraphMessageActionFlag. */ + /** + * Static value review for MicrosoftGraphMessageActionFlag. + */ public static final MicrosoftGraphMessageActionFlag REVIEW = fromString("review"); /** * Creates a new instance of MicrosoftGraphMessageActionFlag value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -54,18 +77,17 @@ public MicrosoftGraphMessageActionFlag() { /** * Creates or finds a MicrosoftGraphMessageActionFlag from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphMessageActionFlag. */ - @JsonCreator public static MicrosoftGraphMessageActionFlag fromString(String name) { return fromString(name, MicrosoftGraphMessageActionFlag.class); } /** * Gets known MicrosoftGraphMessageActionFlag values. - * + * * @return known MicrosoftGraphMessageActionFlag values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRule.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRule.java index 8c30edf30333c..4c05d340b9008 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRule.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRule.java @@ -5,76 +5,72 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** messageRule. */ +/** + * messageRule. + */ @Fluent public final class MicrosoftGraphMessageRule extends MicrosoftGraphEntity { /* * messageRuleActions */ - @JsonProperty(value = "actions") private MicrosoftGraphMessageRuleActions actions; /* * messageRulePredicates */ - @JsonProperty(value = "conditions") private MicrosoftGraphMessageRulePredicates conditions; /* * The display name of the rule. */ - @JsonProperty(value = "displayName") private String displayName; /* * messageRulePredicates */ - @JsonProperty(value = "exceptions") private MicrosoftGraphMessageRulePredicates exceptions; /* * Indicates whether the rule is in an error condition. Read-only. */ - @JsonProperty(value = "hasError") private Boolean hasError; /* * Indicates whether the rule is enabled to be applied to messages. */ - @JsonProperty(value = "isEnabled") private Boolean isEnabled; /* * Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API. */ - @JsonProperty(value = "isReadOnly") private Boolean isReadOnly; /* * Indicates the order in which the rule is executed, among other rules. */ - @JsonProperty(value = "sequence") private Integer sequence; /* * messageRule */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphMessageRule class. */ + /** + * Creates an instance of MicrosoftGraphMessageRule class. + */ public MicrosoftGraphMessageRule() { } /** * Get the actions property: messageRuleActions. - * + * * @return the actions value. */ public MicrosoftGraphMessageRuleActions actions() { @@ -83,7 +79,7 @@ public MicrosoftGraphMessageRuleActions actions() { /** * Set the actions property: messageRuleActions. - * + * * @param actions the actions value to set. * @return the MicrosoftGraphMessageRule object itself. */ @@ -94,7 +90,7 @@ public MicrosoftGraphMessageRule withActions(MicrosoftGraphMessageRuleActions ac /** * Get the conditions property: messageRulePredicates. - * + * * @return the conditions value. */ public MicrosoftGraphMessageRulePredicates conditions() { @@ -103,7 +99,7 @@ public MicrosoftGraphMessageRulePredicates conditions() { /** * Set the conditions property: messageRulePredicates. - * + * * @param conditions the conditions value to set. * @return the MicrosoftGraphMessageRule object itself. */ @@ -114,7 +110,7 @@ public MicrosoftGraphMessageRule withConditions(MicrosoftGraphMessageRulePredica /** * Get the displayName property: The display name of the rule. - * + * * @return the displayName value. */ public String displayName() { @@ -123,7 +119,7 @@ public String displayName() { /** * Set the displayName property: The display name of the rule. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphMessageRule object itself. */ @@ -134,7 +130,7 @@ public MicrosoftGraphMessageRule withDisplayName(String displayName) { /** * Get the exceptions property: messageRulePredicates. - * + * * @return the exceptions value. */ public MicrosoftGraphMessageRulePredicates exceptions() { @@ -143,7 +139,7 @@ public MicrosoftGraphMessageRulePredicates exceptions() { /** * Set the exceptions property: messageRulePredicates. - * + * * @param exceptions the exceptions value to set. * @return the MicrosoftGraphMessageRule object itself. */ @@ -154,7 +150,7 @@ public MicrosoftGraphMessageRule withExceptions(MicrosoftGraphMessageRulePredica /** * Get the hasError property: Indicates whether the rule is in an error condition. Read-only. - * + * * @return the hasError value. */ public Boolean hasError() { @@ -163,7 +159,7 @@ public Boolean hasError() { /** * Set the hasError property: Indicates whether the rule is in an error condition. Read-only. - * + * * @param hasError the hasError value to set. * @return the MicrosoftGraphMessageRule object itself. */ @@ -174,7 +170,7 @@ public MicrosoftGraphMessageRule withHasError(Boolean hasError) { /** * Get the isEnabled property: Indicates whether the rule is enabled to be applied to messages. - * + * * @return the isEnabled value. */ public Boolean isEnabled() { @@ -183,7 +179,7 @@ public Boolean isEnabled() { /** * Set the isEnabled property: Indicates whether the rule is enabled to be applied to messages. - * + * * @param isEnabled the isEnabled value to set. * @return the MicrosoftGraphMessageRule object itself. */ @@ -195,7 +191,7 @@ public MicrosoftGraphMessageRule withIsEnabled(Boolean isEnabled) { /** * Get the isReadOnly property: Indicates if the rule is read-only and cannot be modified or deleted by the rules * REST API. - * + * * @return the isReadOnly value. */ public Boolean isReadOnly() { @@ -205,7 +201,7 @@ public Boolean isReadOnly() { /** * Set the isReadOnly property: Indicates if the rule is read-only and cannot be modified or deleted by the rules * REST API. - * + * * @param isReadOnly the isReadOnly value to set. * @return the MicrosoftGraphMessageRule object itself. */ @@ -216,7 +212,7 @@ public MicrosoftGraphMessageRule withIsReadOnly(Boolean isReadOnly) { /** * Get the sequence property: Indicates the order in which the rule is executed, among other rules. - * + * * @return the sequence value. */ public Integer sequence() { @@ -225,7 +221,7 @@ public Integer sequence() { /** * Set the sequence property: Indicates the order in which the rule is executed, among other rules. - * + * * @param sequence the sequence value to set. * @return the MicrosoftGraphMessageRule object itself. */ @@ -236,17 +232,16 @@ public MicrosoftGraphMessageRule withSequence(Integer sequence) { /** * Get the additionalProperties property: messageRule. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: messageRule. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphMessageRule object itself. */ @@ -255,15 +250,9 @@ public MicrosoftGraphMessageRule withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphMessageRule withId(String id) { super.withId(id); @@ -272,7 +261,7 @@ public MicrosoftGraphMessageRule withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -288,4 +277,77 @@ public void validate() { exceptions().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("actions", this.actions); + jsonWriter.writeJsonField("conditions", this.conditions); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeJsonField("exceptions", this.exceptions); + jsonWriter.writeBooleanField("hasError", this.hasError); + jsonWriter.writeBooleanField("isEnabled", this.isEnabled); + jsonWriter.writeBooleanField("isReadOnly", this.isReadOnly); + jsonWriter.writeNumberField("sequence", this.sequence); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphMessageRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphMessageRule 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 MicrosoftGraphMessageRule. + */ + public static MicrosoftGraphMessageRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphMessageRule deserializedMicrosoftGraphMessageRule = new MicrosoftGraphMessageRule(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphMessageRule.withId(reader.getString()); + } else if ("actions".equals(fieldName)) { + deserializedMicrosoftGraphMessageRule.actions = MicrosoftGraphMessageRuleActions.fromJson(reader); + } else if ("conditions".equals(fieldName)) { + deserializedMicrosoftGraphMessageRule.conditions + = MicrosoftGraphMessageRulePredicates.fromJson(reader); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphMessageRule.displayName = reader.getString(); + } else if ("exceptions".equals(fieldName)) { + deserializedMicrosoftGraphMessageRule.exceptions + = MicrosoftGraphMessageRulePredicates.fromJson(reader); + } else if ("hasError".equals(fieldName)) { + deserializedMicrosoftGraphMessageRule.hasError = reader.getNullable(JsonReader::getBoolean); + } else if ("isEnabled".equals(fieldName)) { + deserializedMicrosoftGraphMessageRule.isEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("isReadOnly".equals(fieldName)) { + deserializedMicrosoftGraphMessageRule.isReadOnly = reader.getNullable(JsonReader::getBoolean); + } else if ("sequence".equals(fieldName)) { + deserializedMicrosoftGraphMessageRule.sequence = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphMessageRule.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphMessageRule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRuleActions.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRuleActions.java index 4aedef44439c8..2d5ef92f47c0b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRuleActions.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRuleActions.java @@ -5,95 +5,89 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** messageRuleActions. */ +/** + * messageRuleActions. + */ @Fluent -public final class MicrosoftGraphMessageRuleActions { +public final class MicrosoftGraphMessageRuleActions implements JsonSerializable { /* * A list of categories to be assigned to a message. */ - @JsonProperty(value = "assignCategories") private List assignCategories; /* * The ID of a folder that a message is to be copied to. */ - @JsonProperty(value = "copyToFolder") private String copyToFolder; /* * Indicates whether a message should be moved to the Deleted Items folder. */ - @JsonProperty(value = "delete") private Boolean delete; /* * The email addresses of the recipients to which a message should be forwarded as an attachment. */ - @JsonProperty(value = "forwardAsAttachmentTo") private List forwardAsAttachmentTo; /* * The email addresses of the recipients to which a message should be forwarded. */ - @JsonProperty(value = "forwardTo") private List forwardTo; /* * Indicates whether a message should be marked as read. */ - @JsonProperty(value = "markAsRead") private Boolean markAsRead; /* * importance */ - @JsonProperty(value = "markImportance") private MicrosoftGraphImportance markImportance; /* * The ID of the folder that a message will be moved to. */ - @JsonProperty(value = "moveToFolder") private String moveToFolder; /* * Indicates whether a message should be permanently deleted and not saved to the Deleted Items folder. */ - @JsonProperty(value = "permanentDelete") private Boolean permanentDelete; /* * The email addresses to which a message should be redirected. */ - @JsonProperty(value = "redirectTo") private List redirectTo; /* * Indicates whether subsequent rules should be evaluated. */ - @JsonProperty(value = "stopProcessingRules") private Boolean stopProcessingRules; /* * messageRuleActions */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphMessageRuleActions class. */ + /** + * Creates an instance of MicrosoftGraphMessageRuleActions class. + */ public MicrosoftGraphMessageRuleActions() { } /** * Get the assignCategories property: A list of categories to be assigned to a message. - * + * * @return the assignCategories value. */ public List assignCategories() { @@ -102,7 +96,7 @@ public List assignCategories() { /** * Set the assignCategories property: A list of categories to be assigned to a message. - * + * * @param assignCategories the assignCategories value to set. * @return the MicrosoftGraphMessageRuleActions object itself. */ @@ -113,7 +107,7 @@ public MicrosoftGraphMessageRuleActions withAssignCategories(List assign /** * Get the copyToFolder property: The ID of a folder that a message is to be copied to. - * + * * @return the copyToFolder value. */ public String copyToFolder() { @@ -122,7 +116,7 @@ public String copyToFolder() { /** * Set the copyToFolder property: The ID of a folder that a message is to be copied to. - * + * * @param copyToFolder the copyToFolder value to set. * @return the MicrosoftGraphMessageRuleActions object itself. */ @@ -133,7 +127,7 @@ public MicrosoftGraphMessageRuleActions withCopyToFolder(String copyToFolder) { /** * Get the delete property: Indicates whether a message should be moved to the Deleted Items folder. - * + * * @return the delete value. */ public Boolean delete() { @@ -142,7 +136,7 @@ public Boolean delete() { /** * Set the delete property: Indicates whether a message should be moved to the Deleted Items folder. - * + * * @param delete the delete value to set. * @return the MicrosoftGraphMessageRuleActions object itself. */ @@ -154,7 +148,7 @@ public MicrosoftGraphMessageRuleActions withDelete(Boolean delete) { /** * Get the forwardAsAttachmentTo property: The email addresses of the recipients to which a message should be * forwarded as an attachment. - * + * * @return the forwardAsAttachmentTo value. */ public List forwardAsAttachmentTo() { @@ -164,19 +158,19 @@ public List forwardAsAttachmentTo() { /** * Set the forwardAsAttachmentTo property: The email addresses of the recipients to which a message should be * forwarded as an attachment. - * + * * @param forwardAsAttachmentTo the forwardAsAttachmentTo value to set. * @return the MicrosoftGraphMessageRuleActions object itself. */ - public MicrosoftGraphMessageRuleActions withForwardAsAttachmentTo( - List forwardAsAttachmentTo) { + public MicrosoftGraphMessageRuleActions + withForwardAsAttachmentTo(List forwardAsAttachmentTo) { this.forwardAsAttachmentTo = forwardAsAttachmentTo; return this; } /** * Get the forwardTo property: The email addresses of the recipients to which a message should be forwarded. - * + * * @return the forwardTo value. */ public List forwardTo() { @@ -185,7 +179,7 @@ public List forwardTo() { /** * Set the forwardTo property: The email addresses of the recipients to which a message should be forwarded. - * + * * @param forwardTo the forwardTo value to set. * @return the MicrosoftGraphMessageRuleActions object itself. */ @@ -196,7 +190,7 @@ public MicrosoftGraphMessageRuleActions withForwardTo(List redirectTo() { @@ -287,7 +281,7 @@ public List redirectTo() { /** * Set the redirectTo property: The email addresses to which a message should be redirected. - * + * * @param redirectTo the redirectTo value to set. * @return the MicrosoftGraphMessageRuleActions object itself. */ @@ -298,7 +292,7 @@ public MicrosoftGraphMessageRuleActions withRedirectTo(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: messageRuleActions. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphMessageRuleActions object itself. */ @@ -337,17 +330,9 @@ public MicrosoftGraphMessageRuleActions withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -361,4 +346,96 @@ public void validate() { redirectTo().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("assignCategories", this.assignCategories, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("copyToFolder", this.copyToFolder); + jsonWriter.writeBooleanField("delete", this.delete); + jsonWriter.writeArrayField("forwardAsAttachmentTo", this.forwardAsAttachmentTo, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("forwardTo", this.forwardTo, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("markAsRead", this.markAsRead); + jsonWriter.writeStringField("markImportance", + this.markImportance == null ? null : this.markImportance.toString()); + jsonWriter.writeStringField("moveToFolder", this.moveToFolder); + jsonWriter.writeBooleanField("permanentDelete", this.permanentDelete); + jsonWriter.writeArrayField("redirectTo", this.redirectTo, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("stopProcessingRules", this.stopProcessingRules); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphMessageRuleActions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphMessageRuleActions 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 MicrosoftGraphMessageRuleActions. + */ + public static MicrosoftGraphMessageRuleActions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphMessageRuleActions deserializedMicrosoftGraphMessageRuleActions + = new MicrosoftGraphMessageRuleActions(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("assignCategories".equals(fieldName)) { + List assignCategories = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphMessageRuleActions.assignCategories = assignCategories; + } else if ("copyToFolder".equals(fieldName)) { + deserializedMicrosoftGraphMessageRuleActions.copyToFolder = reader.getString(); + } else if ("delete".equals(fieldName)) { + deserializedMicrosoftGraphMessageRuleActions.delete = reader.getNullable(JsonReader::getBoolean); + } else if ("forwardAsAttachmentTo".equals(fieldName)) { + List forwardAsAttachmentTo + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphMessageRuleActions.forwardAsAttachmentTo = forwardAsAttachmentTo; + } else if ("forwardTo".equals(fieldName)) { + List forwardTo + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphMessageRuleActions.forwardTo = forwardTo; + } else if ("markAsRead".equals(fieldName)) { + deserializedMicrosoftGraphMessageRuleActions.markAsRead + = reader.getNullable(JsonReader::getBoolean); + } else if ("markImportance".equals(fieldName)) { + deserializedMicrosoftGraphMessageRuleActions.markImportance + = MicrosoftGraphImportance.fromString(reader.getString()); + } else if ("moveToFolder".equals(fieldName)) { + deserializedMicrosoftGraphMessageRuleActions.moveToFolder = reader.getString(); + } else if ("permanentDelete".equals(fieldName)) { + deserializedMicrosoftGraphMessageRuleActions.permanentDelete + = reader.getNullable(JsonReader::getBoolean); + } else if ("redirectTo".equals(fieldName)) { + List redirectTo + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphMessageRuleActions.redirectTo = redirectTo; + } else if ("stopProcessingRules".equals(fieldName)) { + deserializedMicrosoftGraphMessageRuleActions.stopProcessingRules + = reader.getNullable(JsonReader::getBoolean); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphMessageRuleActions.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphMessageRuleActions; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRulePredicates.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRulePredicates.java index bcfad8b848471..8f378fdbe6f70 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRulePredicates.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMessageRulePredicates.java @@ -5,230 +5,205 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** messageRulePredicates. */ +/** + * messageRulePredicates. + */ @Fluent -public final class MicrosoftGraphMessageRulePredicates { +public final class MicrosoftGraphMessageRulePredicates + implements JsonSerializable { /* * Represents the strings that should appear in the body of an incoming message in order for the condition or * exception to apply. */ - @JsonProperty(value = "bodyContains") private List bodyContains; /* * Represents the strings that should appear in the body or subject of an incoming message in order for the * condition or exception to apply. */ - @JsonProperty(value = "bodyOrSubjectContains") private List bodyOrSubjectContains; /* - * Represents the categories that an incoming message should be labeled with in order for the condition or - * exception to apply. + * Represents the categories that an incoming message should be labeled with in order for the condition or exception + * to apply. */ - @JsonProperty(value = "categories") private List categories; /* * Represents the specific sender email addresses of an incoming message in order for the condition or exception to * apply. */ - @JsonProperty(value = "fromAddresses") private List fromAddresses; /* * Indicates whether an incoming message must have attachments in order for the condition or exception to apply. */ - @JsonProperty(value = "hasAttachments") private Boolean hasAttachments; /* * Represents the strings that appear in the headers of an incoming message in order for the condition or exception * to apply. */ - @JsonProperty(value = "headerContains") private List headerContains; /* * importance */ - @JsonProperty(value = "importance") private MicrosoftGraphImportance importance; /* * Indicates whether an incoming message must be an approval request in order for the condition or exception to * apply. */ - @JsonProperty(value = "isApprovalRequest") private Boolean isApprovalRequest; /* * Indicates whether an incoming message must be automatically forwarded in order for the condition or exception to * apply. */ - @JsonProperty(value = "isAutomaticForward") private Boolean isAutomaticForward; /* * Indicates whether an incoming message must be an auto reply in order for the condition or exception to apply. */ - @JsonProperty(value = "isAutomaticReply") private Boolean isAutomaticReply; /* * Indicates whether an incoming message must be encrypted in order for the condition or exception to apply. */ - @JsonProperty(value = "isEncrypted") private Boolean isEncrypted; /* - * Indicates whether an incoming message must be a meeting request in order for the condition or exception to - * apply. + * Indicates whether an incoming message must be a meeting request in order for the condition or exception to apply. */ - @JsonProperty(value = "isMeetingRequest") private Boolean isMeetingRequest; /* * Indicates whether an incoming message must be a meeting response in order for the condition or exception to * apply. */ - @JsonProperty(value = "isMeetingResponse") private Boolean isMeetingResponse; /* * Indicates whether an incoming message must be a non-delivery report in order for the condition or exception to * apply. */ - @JsonProperty(value = "isNonDeliveryReport") private Boolean isNonDeliveryReport; /* - * Indicates whether an incoming message must be permission controlled (RMS-protected) in order for the condition - * or exception to apply. + * Indicates whether an incoming message must be permission controlled (RMS-protected) in order for the condition or + * exception to apply. */ - @JsonProperty(value = "isPermissionControlled") private Boolean isPermissionControlled; /* * Indicates whether an incoming message must be a read receipt in order for the condition or exception to apply. */ - @JsonProperty(value = "isReadReceipt") private Boolean isReadReceipt; /* * Indicates whether an incoming message must be S/MIME-signed in order for the condition or exception to apply. */ - @JsonProperty(value = "isSigned") private Boolean isSigned; /* * Indicates whether an incoming message must be a voice mail in order for the condition or exception to apply. */ - @JsonProperty(value = "isVoicemail") private Boolean isVoicemail; /* * messageActionFlag */ - @JsonProperty(value = "messageActionFlag") private MicrosoftGraphMessageActionFlag messageActionFlag; /* * Indicates whether the owner of the mailbox must not be a recipient of an incoming message in order for the * condition or exception to apply. */ - @JsonProperty(value = "notSentToMe") private Boolean notSentToMe; /* * Represents the strings that appear in either the toRecipients or ccRecipients properties of an incoming message * in order for the condition or exception to apply. */ - @JsonProperty(value = "recipientContains") private List recipientContains; /* * Represents the strings that appear in the from property of an incoming message in order for the condition or * exception to apply. */ - @JsonProperty(value = "senderContains") private List senderContains; /* * sensitivity */ - @JsonProperty(value = "sensitivity") private MicrosoftGraphSensitivity sensitivity; /* * Indicates whether the owner of the mailbox must be in the ccRecipients property of an incoming message in order * for the condition or exception to apply. */ - @JsonProperty(value = "sentCcMe") private Boolean sentCcMe; /* * Indicates whether the owner of the mailbox must be the only recipient in an incoming message in order for the * condition or exception to apply. */ - @JsonProperty(value = "sentOnlyToMe") private Boolean sentOnlyToMe; /* * Represents the email addresses that an incoming message must have been sent to in order for the condition or * exception to apply. */ - @JsonProperty(value = "sentToAddresses") private List sentToAddresses; /* * Indicates whether the owner of the mailbox must be in the toRecipients property of an incoming message in order * for the condition or exception to apply. */ - @JsonProperty(value = "sentToMe") private Boolean sentToMe; /* * Indicates whether the owner of the mailbox must be in either a toRecipients or ccRecipients property of an * incoming message in order for the condition or exception to apply. */ - @JsonProperty(value = "sentToOrCcMe") private Boolean sentToOrCcMe; /* * Represents the strings that appear in the subject of an incoming message in order for the condition or exception * to apply. */ - @JsonProperty(value = "subjectContains") private List subjectContains; /* * sizeRange */ - @JsonProperty(value = "withinSizeRange") private MicrosoftGraphSizeRange withinSizeRange; /* * messageRulePredicates */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphMessageRulePredicates class. */ + /** + * Creates an instance of MicrosoftGraphMessageRulePredicates class. + */ public MicrosoftGraphMessageRulePredicates() { } /** * Get the bodyContains property: Represents the strings that should appear in the body of an incoming message in * order for the condition or exception to apply. - * + * * @return the bodyContains value. */ public List bodyContains() { @@ -238,7 +213,7 @@ public List bodyContains() { /** * Set the bodyContains property: Represents the strings that should appear in the body of an incoming message in * order for the condition or exception to apply. - * + * * @param bodyContains the bodyContains value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -250,7 +225,7 @@ public MicrosoftGraphMessageRulePredicates withBodyContains(List bodyCon /** * Get the bodyOrSubjectContains property: Represents the strings that should appear in the body or subject of an * incoming message in order for the condition or exception to apply. - * + * * @return the bodyOrSubjectContains value. */ public List bodyOrSubjectContains() { @@ -260,7 +235,7 @@ public List bodyOrSubjectContains() { /** * Set the bodyOrSubjectContains property: Represents the strings that should appear in the body or subject of an * incoming message in order for the condition or exception to apply. - * + * * @param bodyOrSubjectContains the bodyOrSubjectContains value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -272,7 +247,7 @@ public MicrosoftGraphMessageRulePredicates withBodyOrSubjectContains(List categories() { @@ -282,7 +257,7 @@ public List categories() { /** * Set the categories property: Represents the categories that an incoming message should be labeled with in order * for the condition or exception to apply. - * + * * @param categories the categories value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -294,7 +269,7 @@ public MicrosoftGraphMessageRulePredicates withCategories(List categorie /** * Get the fromAddresses property: Represents the specific sender email addresses of an incoming message in order * for the condition or exception to apply. - * + * * @return the fromAddresses value. */ public List fromAddresses() { @@ -304,7 +279,7 @@ public List fromAddresses() { /** * Set the fromAddresses property: Represents the specific sender email addresses of an incoming message in order * for the condition or exception to apply. - * + * * @param fromAddresses the fromAddresses value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -316,7 +291,7 @@ public MicrosoftGraphMessageRulePredicates withFromAddresses(List headerContains() { @@ -348,7 +323,7 @@ public List headerContains() { /** * Set the headerContains property: Represents the strings that appear in the headers of an incoming message in * order for the condition or exception to apply. - * + * * @param headerContains the headerContains value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -359,7 +334,7 @@ public MicrosoftGraphMessageRulePredicates withHeaderContains(List heade /** * Get the importance property: importance. - * + * * @return the importance value. */ public MicrosoftGraphImportance importance() { @@ -368,7 +343,7 @@ public MicrosoftGraphImportance importance() { /** * Set the importance property: importance. - * + * * @param importance the importance value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -380,7 +355,7 @@ public MicrosoftGraphMessageRulePredicates withImportance(MicrosoftGraphImportan /** * Get the isApprovalRequest property: Indicates whether an incoming message must be an approval request in order * for the condition or exception to apply. - * + * * @return the isApprovalRequest value. */ public Boolean isApprovalRequest() { @@ -390,7 +365,7 @@ public Boolean isApprovalRequest() { /** * Set the isApprovalRequest property: Indicates whether an incoming message must be an approval request in order * for the condition or exception to apply. - * + * * @param isApprovalRequest the isApprovalRequest value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -402,7 +377,7 @@ public MicrosoftGraphMessageRulePredicates withIsApprovalRequest(Boolean isAppro /** * Get the isAutomaticForward property: Indicates whether an incoming message must be automatically forwarded in * order for the condition or exception to apply. - * + * * @return the isAutomaticForward value. */ public Boolean isAutomaticForward() { @@ -412,7 +387,7 @@ public Boolean isAutomaticForward() { /** * Set the isAutomaticForward property: Indicates whether an incoming message must be automatically forwarded in * order for the condition or exception to apply. - * + * * @param isAutomaticForward the isAutomaticForward value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -424,7 +399,7 @@ public MicrosoftGraphMessageRulePredicates withIsAutomaticForward(Boolean isAuto /** * Get the isAutomaticReply property: Indicates whether an incoming message must be an auto reply in order for the * condition or exception to apply. - * + * * @return the isAutomaticReply value. */ public Boolean isAutomaticReply() { @@ -434,7 +409,7 @@ public Boolean isAutomaticReply() { /** * Set the isAutomaticReply property: Indicates whether an incoming message must be an auto reply in order for the * condition or exception to apply. - * + * * @param isAutomaticReply the isAutomaticReply value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -446,7 +421,7 @@ public MicrosoftGraphMessageRulePredicates withIsAutomaticReply(Boolean isAutoma /** * Get the isEncrypted property: Indicates whether an incoming message must be encrypted in order for the condition * or exception to apply. - * + * * @return the isEncrypted value. */ public Boolean isEncrypted() { @@ -456,7 +431,7 @@ public Boolean isEncrypted() { /** * Set the isEncrypted property: Indicates whether an incoming message must be encrypted in order for the condition * or exception to apply. - * + * * @param isEncrypted the isEncrypted value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -468,7 +443,7 @@ public MicrosoftGraphMessageRulePredicates withIsEncrypted(Boolean isEncrypted) /** * Get the isMeetingRequest property: Indicates whether an incoming message must be a meeting request in order for * the condition or exception to apply. - * + * * @return the isMeetingRequest value. */ public Boolean isMeetingRequest() { @@ -478,7 +453,7 @@ public Boolean isMeetingRequest() { /** * Set the isMeetingRequest property: Indicates whether an incoming message must be a meeting request in order for * the condition or exception to apply. - * + * * @param isMeetingRequest the isMeetingRequest value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -490,7 +465,7 @@ public MicrosoftGraphMessageRulePredicates withIsMeetingRequest(Boolean isMeetin /** * Get the isMeetingResponse property: Indicates whether an incoming message must be a meeting response in order for * the condition or exception to apply. - * + * * @return the isMeetingResponse value. */ public Boolean isMeetingResponse() { @@ -500,7 +475,7 @@ public Boolean isMeetingResponse() { /** * Set the isMeetingResponse property: Indicates whether an incoming message must be a meeting response in order for * the condition or exception to apply. - * + * * @param isMeetingResponse the isMeetingResponse value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -512,7 +487,7 @@ public MicrosoftGraphMessageRulePredicates withIsMeetingResponse(Boolean isMeeti /** * Get the isNonDeliveryReport property: Indicates whether an incoming message must be a non-delivery report in * order for the condition or exception to apply. - * + * * @return the isNonDeliveryReport value. */ public Boolean isNonDeliveryReport() { @@ -522,7 +497,7 @@ public Boolean isNonDeliveryReport() { /** * Set the isNonDeliveryReport property: Indicates whether an incoming message must be a non-delivery report in * order for the condition or exception to apply. - * + * * @param isNonDeliveryReport the isNonDeliveryReport value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -534,7 +509,7 @@ public MicrosoftGraphMessageRulePredicates withIsNonDeliveryReport(Boolean isNon /** * Get the isPermissionControlled property: Indicates whether an incoming message must be permission controlled * (RMS-protected) in order for the condition or exception to apply. - * + * * @return the isPermissionControlled value. */ public Boolean isPermissionControlled() { @@ -544,7 +519,7 @@ public Boolean isPermissionControlled() { /** * Set the isPermissionControlled property: Indicates whether an incoming message must be permission controlled * (RMS-protected) in order for the condition or exception to apply. - * + * * @param isPermissionControlled the isPermissionControlled value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -556,7 +531,7 @@ public MicrosoftGraphMessageRulePredicates withIsPermissionControlled(Boolean is /** * Get the isReadReceipt property: Indicates whether an incoming message must be a read receipt in order for the * condition or exception to apply. - * + * * @return the isReadReceipt value. */ public Boolean isReadReceipt() { @@ -566,7 +541,7 @@ public Boolean isReadReceipt() { /** * Set the isReadReceipt property: Indicates whether an incoming message must be a read receipt in order for the * condition or exception to apply. - * + * * @param isReadReceipt the isReadReceipt value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -578,7 +553,7 @@ public MicrosoftGraphMessageRulePredicates withIsReadReceipt(Boolean isReadRecei /** * Get the isSigned property: Indicates whether an incoming message must be S/MIME-signed in order for the condition * or exception to apply. - * + * * @return the isSigned value. */ public Boolean isSigned() { @@ -588,7 +563,7 @@ public Boolean isSigned() { /** * Set the isSigned property: Indicates whether an incoming message must be S/MIME-signed in order for the condition * or exception to apply. - * + * * @param isSigned the isSigned value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -600,7 +575,7 @@ public MicrosoftGraphMessageRulePredicates withIsSigned(Boolean isSigned) { /** * Get the isVoicemail property: Indicates whether an incoming message must be a voice mail in order for the * condition or exception to apply. - * + * * @return the isVoicemail value. */ public Boolean isVoicemail() { @@ -610,7 +585,7 @@ public Boolean isVoicemail() { /** * Set the isVoicemail property: Indicates whether an incoming message must be a voice mail in order for the * condition or exception to apply. - * + * * @param isVoicemail the isVoicemail value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -621,7 +596,7 @@ public MicrosoftGraphMessageRulePredicates withIsVoicemail(Boolean isVoicemail) /** * Get the messageActionFlag property: messageActionFlag. - * + * * @return the messageActionFlag value. */ public MicrosoftGraphMessageActionFlag messageActionFlag() { @@ -630,12 +605,12 @@ public MicrosoftGraphMessageActionFlag messageActionFlag() { /** * Set the messageActionFlag property: messageActionFlag. - * + * * @param messageActionFlag the messageActionFlag value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ - public MicrosoftGraphMessageRulePredicates withMessageActionFlag( - MicrosoftGraphMessageActionFlag messageActionFlag) { + public MicrosoftGraphMessageRulePredicates + withMessageActionFlag(MicrosoftGraphMessageActionFlag messageActionFlag) { this.messageActionFlag = messageActionFlag; return this; } @@ -643,7 +618,7 @@ public MicrosoftGraphMessageRulePredicates withMessageActionFlag( /** * Get the notSentToMe property: Indicates whether the owner of the mailbox must not be a recipient of an incoming * message in order for the condition or exception to apply. - * + * * @return the notSentToMe value. */ public Boolean notSentToMe() { @@ -653,7 +628,7 @@ public Boolean notSentToMe() { /** * Set the notSentToMe property: Indicates whether the owner of the mailbox must not be a recipient of an incoming * message in order for the condition or exception to apply. - * + * * @param notSentToMe the notSentToMe value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -665,7 +640,7 @@ public MicrosoftGraphMessageRulePredicates withNotSentToMe(Boolean notSentToMe) /** * Get the recipientContains property: Represents the strings that appear in either the toRecipients or ccRecipients * properties of an incoming message in order for the condition or exception to apply. - * + * * @return the recipientContains value. */ public List recipientContains() { @@ -675,7 +650,7 @@ public List recipientContains() { /** * Set the recipientContains property: Represents the strings that appear in either the toRecipients or ccRecipients * properties of an incoming message in order for the condition or exception to apply. - * + * * @param recipientContains the recipientContains value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -687,7 +662,7 @@ public MicrosoftGraphMessageRulePredicates withRecipientContains(List re /** * Get the senderContains property: Represents the strings that appear in the from property of an incoming message * in order for the condition or exception to apply. - * + * * @return the senderContains value. */ public List senderContains() { @@ -697,7 +672,7 @@ public List senderContains() { /** * Set the senderContains property: Represents the strings that appear in the from property of an incoming message * in order for the condition or exception to apply. - * + * * @param senderContains the senderContains value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -708,7 +683,7 @@ public MicrosoftGraphMessageRulePredicates withSenderContains(List sende /** * Get the sensitivity property: sensitivity. - * + * * @return the sensitivity value. */ public MicrosoftGraphSensitivity sensitivity() { @@ -717,7 +692,7 @@ public MicrosoftGraphSensitivity sensitivity() { /** * Set the sensitivity property: sensitivity. - * + * * @param sensitivity the sensitivity value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -729,7 +704,7 @@ public MicrosoftGraphMessageRulePredicates withSensitivity(MicrosoftGraphSensiti /** * Get the sentCcMe property: Indicates whether the owner of the mailbox must be in the ccRecipients property of an * incoming message in order for the condition or exception to apply. - * + * * @return the sentCcMe value. */ public Boolean sentCcMe() { @@ -739,7 +714,7 @@ public Boolean sentCcMe() { /** * Set the sentCcMe property: Indicates whether the owner of the mailbox must be in the ccRecipients property of an * incoming message in order for the condition or exception to apply. - * + * * @param sentCcMe the sentCcMe value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -751,7 +726,7 @@ public MicrosoftGraphMessageRulePredicates withSentCcMe(Boolean sentCcMe) { /** * Get the sentOnlyToMe property: Indicates whether the owner of the mailbox must be the only recipient in an * incoming message in order for the condition or exception to apply. - * + * * @return the sentOnlyToMe value. */ public Boolean sentOnlyToMe() { @@ -761,7 +736,7 @@ public Boolean sentOnlyToMe() { /** * Set the sentOnlyToMe property: Indicates whether the owner of the mailbox must be the only recipient in an * incoming message in order for the condition or exception to apply. - * + * * @param sentOnlyToMe the sentOnlyToMe value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -773,7 +748,7 @@ public MicrosoftGraphMessageRulePredicates withSentOnlyToMe(Boolean sentOnlyToMe /** * Get the sentToAddresses property: Represents the email addresses that an incoming message must have been sent to * in order for the condition or exception to apply. - * + * * @return the sentToAddresses value. */ public List sentToAddresses() { @@ -783,7 +758,7 @@ public List sentToAddresses() { /** * Set the sentToAddresses property: Represents the email addresses that an incoming message must have been sent to * in order for the condition or exception to apply. - * + * * @param sentToAddresses the sentToAddresses value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -795,7 +770,7 @@ public MicrosoftGraphMessageRulePredicates withSentToAddresses(List subjectContains() { @@ -849,7 +824,7 @@ public List subjectContains() { /** * Set the subjectContains property: Represents the strings that appear in the subject of an incoming message in * order for the condition or exception to apply. - * + * * @param subjectContains the subjectContains value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -860,7 +835,7 @@ public MicrosoftGraphMessageRulePredicates withSubjectContains(List subj /** * Get the withinSizeRange property: sizeRange. - * + * * @return the withinSizeRange value. */ public MicrosoftGraphSizeRange withinSizeRange() { @@ -869,7 +844,7 @@ public MicrosoftGraphSizeRange withinSizeRange() { /** * Set the withinSizeRange property: sizeRange. - * + * * @param withinSizeRange the withinSizeRange value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -880,17 +855,16 @@ public MicrosoftGraphMessageRulePredicates withWithinSizeRange(MicrosoftGraphSiz /** * Get the additionalProperties property: messageRulePredicates. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: messageRulePredicates. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphMessageRulePredicates object itself. */ @@ -899,17 +873,9 @@ public MicrosoftGraphMessageRulePredicates withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -923,4 +889,178 @@ public void validate() { withinSizeRange().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("bodyContains", this.bodyContains, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("bodyOrSubjectContains", this.bodyOrSubjectContains, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("categories", this.categories, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("fromAddresses", this.fromAddresses, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("hasAttachments", this.hasAttachments); + jsonWriter.writeArrayField("headerContains", this.headerContains, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("importance", this.importance == null ? null : this.importance.toString()); + jsonWriter.writeBooleanField("isApprovalRequest", this.isApprovalRequest); + jsonWriter.writeBooleanField("isAutomaticForward", this.isAutomaticForward); + jsonWriter.writeBooleanField("isAutomaticReply", this.isAutomaticReply); + jsonWriter.writeBooleanField("isEncrypted", this.isEncrypted); + jsonWriter.writeBooleanField("isMeetingRequest", this.isMeetingRequest); + jsonWriter.writeBooleanField("isMeetingResponse", this.isMeetingResponse); + jsonWriter.writeBooleanField("isNonDeliveryReport", this.isNonDeliveryReport); + jsonWriter.writeBooleanField("isPermissionControlled", this.isPermissionControlled); + jsonWriter.writeBooleanField("isReadReceipt", this.isReadReceipt); + jsonWriter.writeBooleanField("isSigned", this.isSigned); + jsonWriter.writeBooleanField("isVoicemail", this.isVoicemail); + jsonWriter.writeStringField("messageActionFlag", + this.messageActionFlag == null ? null : this.messageActionFlag.toString()); + jsonWriter.writeBooleanField("notSentToMe", this.notSentToMe); + jsonWriter.writeArrayField("recipientContains", this.recipientContains, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("senderContains", this.senderContains, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("sensitivity", this.sensitivity == null ? null : this.sensitivity.toString()); + jsonWriter.writeBooleanField("sentCcMe", this.sentCcMe); + jsonWriter.writeBooleanField("sentOnlyToMe", this.sentOnlyToMe); + jsonWriter.writeArrayField("sentToAddresses", this.sentToAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("sentToMe", this.sentToMe); + jsonWriter.writeBooleanField("sentToOrCcMe", this.sentToOrCcMe); + jsonWriter.writeArrayField("subjectContains", this.subjectContains, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("withinSizeRange", this.withinSizeRange); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphMessageRulePredicates from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphMessageRulePredicates 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 MicrosoftGraphMessageRulePredicates. + */ + public static MicrosoftGraphMessageRulePredicates fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphMessageRulePredicates deserializedMicrosoftGraphMessageRulePredicates + = new MicrosoftGraphMessageRulePredicates(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("bodyContains".equals(fieldName)) { + List bodyContains = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphMessageRulePredicates.bodyContains = bodyContains; + } else if ("bodyOrSubjectContains".equals(fieldName)) { + List bodyOrSubjectContains = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphMessageRulePredicates.bodyOrSubjectContains = bodyOrSubjectContains; + } else if ("categories".equals(fieldName)) { + List categories = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphMessageRulePredicates.categories = categories; + } else if ("fromAddresses".equals(fieldName)) { + List fromAddresses + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphMessageRulePredicates.fromAddresses = fromAddresses; + } else if ("hasAttachments".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.hasAttachments + = reader.getNullable(JsonReader::getBoolean); + } else if ("headerContains".equals(fieldName)) { + List headerContains = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphMessageRulePredicates.headerContains = headerContains; + } else if ("importance".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.importance + = MicrosoftGraphImportance.fromString(reader.getString()); + } else if ("isApprovalRequest".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isApprovalRequest + = reader.getNullable(JsonReader::getBoolean); + } else if ("isAutomaticForward".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isAutomaticForward + = reader.getNullable(JsonReader::getBoolean); + } else if ("isAutomaticReply".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isAutomaticReply + = reader.getNullable(JsonReader::getBoolean); + } else if ("isEncrypted".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isEncrypted + = reader.getNullable(JsonReader::getBoolean); + } else if ("isMeetingRequest".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isMeetingRequest + = reader.getNullable(JsonReader::getBoolean); + } else if ("isMeetingResponse".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isMeetingResponse + = reader.getNullable(JsonReader::getBoolean); + } else if ("isNonDeliveryReport".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isNonDeliveryReport + = reader.getNullable(JsonReader::getBoolean); + } else if ("isPermissionControlled".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isPermissionControlled + = reader.getNullable(JsonReader::getBoolean); + } else if ("isReadReceipt".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isReadReceipt + = reader.getNullable(JsonReader::getBoolean); + } else if ("isSigned".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isSigned + = reader.getNullable(JsonReader::getBoolean); + } else if ("isVoicemail".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.isVoicemail + = reader.getNullable(JsonReader::getBoolean); + } else if ("messageActionFlag".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.messageActionFlag + = MicrosoftGraphMessageActionFlag.fromString(reader.getString()); + } else if ("notSentToMe".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.notSentToMe + = reader.getNullable(JsonReader::getBoolean); + } else if ("recipientContains".equals(fieldName)) { + List recipientContains = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphMessageRulePredicates.recipientContains = recipientContains; + } else if ("senderContains".equals(fieldName)) { + List senderContains = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphMessageRulePredicates.senderContains = senderContains; + } else if ("sensitivity".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.sensitivity + = MicrosoftGraphSensitivity.fromString(reader.getString()); + } else if ("sentCcMe".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.sentCcMe + = reader.getNullable(JsonReader::getBoolean); + } else if ("sentOnlyToMe".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.sentOnlyToMe + = reader.getNullable(JsonReader::getBoolean); + } else if ("sentToAddresses".equals(fieldName)) { + List sentToAddresses + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphMessageRulePredicates.sentToAddresses = sentToAddresses; + } else if ("sentToMe".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.sentToMe + = reader.getNullable(JsonReader::getBoolean); + } else if ("sentToOrCcMe".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.sentToOrCcMe + = reader.getNullable(JsonReader::getBoolean); + } else if ("subjectContains".equals(fieldName)) { + List subjectContains = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphMessageRulePredicates.subjectContains = subjectContains; + } else if ("withinSizeRange".equals(fieldName)) { + deserializedMicrosoftGraphMessageRulePredicates.withinSizeRange + = MicrosoftGraphSizeRange.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphMessageRulePredicates.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphMessageRulePredicates; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMultiValueLegacyExtendedProperty.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMultiValueLegacyExtendedProperty.java index 34ea12713803f..32112deb5ae76 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMultiValueLegacyExtendedProperty.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphMultiValueLegacyExtendedProperty.java @@ -5,35 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** multiValueLegacyExtendedProperty. */ +/** + * multiValueLegacyExtendedProperty. + */ @Fluent public final class MicrosoftGraphMultiValueLegacyExtendedProperty extends MicrosoftGraphEntity { /* * A collection of property values. */ - @JsonProperty(value = "value") private List value; /* * multiValueLegacyExtendedProperty */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphMultiValueLegacyExtendedProperty class. */ + /** + * Creates an instance of MicrosoftGraphMultiValueLegacyExtendedProperty class. + */ public MicrosoftGraphMultiValueLegacyExtendedProperty() { } /** * Get the value property: A collection of property values. - * + * * @return the value value. */ public List value() { @@ -42,7 +45,7 @@ public List value() { /** * Set the value property: A collection of property values. - * + * * @param value the value value to set. * @return the MicrosoftGraphMultiValueLegacyExtendedProperty object itself. */ @@ -53,35 +56,28 @@ public MicrosoftGraphMultiValueLegacyExtendedProperty withValue(List val /** * Get the additionalProperties property: multiValueLegacyExtendedProperty. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: multiValueLegacyExtendedProperty. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphMultiValueLegacyExtendedProperty object itself. */ - public MicrosoftGraphMultiValueLegacyExtendedProperty withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphMultiValueLegacyExtendedProperty + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphMultiValueLegacyExtendedProperty withId(String id) { super.withId(id); @@ -90,11 +86,63 @@ public MicrosoftGraphMultiValueLegacyExtendedProperty withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeString(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphMultiValueLegacyExtendedProperty from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphMultiValueLegacyExtendedProperty 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 MicrosoftGraphMultiValueLegacyExtendedProperty. + */ + public static MicrosoftGraphMultiValueLegacyExtendedProperty fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphMultiValueLegacyExtendedProperty deserializedMicrosoftGraphMultiValueLegacyExtendedProperty + = new MicrosoftGraphMultiValueLegacyExtendedProperty(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphMultiValueLegacyExtendedProperty.withId(reader.getString()); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphMultiValueLegacyExtendedProperty.value = value; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphMultiValueLegacyExtendedProperty.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphMultiValueLegacyExtendedProperty; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNotebook.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNotebook.java index 1a0ddb7cd9298..12e95f3d72e44 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNotebook.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNotebook.java @@ -5,80 +5,78 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** notebook. */ +/** + * notebook. + */ @Fluent public final class MicrosoftGraphNotebook extends MicrosoftGraphOnenoteEntityHierarchyModel { /* * Indicates whether this is the user's default notebook. Read-only. */ - @JsonProperty(value = "isDefault") private Boolean isDefault; /* * Indicates whether the notebook is shared. If true, the contents of the notebook can be seen by people other than * the owner. Read-only. */ - @JsonProperty(value = "isShared") private Boolean isShared; /* * notebookLinks */ - @JsonProperty(value = "links") private MicrosoftGraphNotebookLinks links; /* * The URL for the sectionGroups navigation property, which returns all the section groups in the notebook. * Read-only. */ - @JsonProperty(value = "sectionGroupsUrl") private String sectionGroupsUrl; /* * The URL for the sections navigation property, which returns all the sections in the notebook. Read-only. */ - @JsonProperty(value = "sectionsUrl") private String sectionsUrl; /* * onenoteUserRole */ - @JsonProperty(value = "userRole") private MicrosoftGraphOnenoteUserRole userRole; /* * The section groups in the notebook. Read-only. Nullable. */ - @JsonProperty(value = "sectionGroups") private List sectionGroups; /* * The sections in the notebook. Read-only. Nullable. */ - @JsonProperty(value = "sections") private List sections; /* * notebook */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphNotebook class. */ + /** + * Creates an instance of MicrosoftGraphNotebook class. + */ public MicrosoftGraphNotebook() { } /** * Get the isDefault property: Indicates whether this is the user's default notebook. Read-only. - * + * * @return the isDefault value. */ public Boolean isDefault() { @@ -87,7 +85,7 @@ public Boolean isDefault() { /** * Set the isDefault property: Indicates whether this is the user's default notebook. Read-only. - * + * * @param isDefault the isDefault value to set. * @return the MicrosoftGraphNotebook object itself. */ @@ -99,7 +97,7 @@ public MicrosoftGraphNotebook withIsDefault(Boolean isDefault) { /** * Get the isShared property: Indicates whether the notebook is shared. If true, the contents of the notebook can be * seen by people other than the owner. Read-only. - * + * * @return the isShared value. */ public Boolean isShared() { @@ -109,7 +107,7 @@ public Boolean isShared() { /** * Set the isShared property: Indicates whether the notebook is shared. If true, the contents of the notebook can be * seen by people other than the owner. Read-only. - * + * * @param isShared the isShared value to set. * @return the MicrosoftGraphNotebook object itself. */ @@ -120,7 +118,7 @@ public MicrosoftGraphNotebook withIsShared(Boolean isShared) { /** * Get the links property: notebookLinks. - * + * * @return the links value. */ public MicrosoftGraphNotebookLinks links() { @@ -129,7 +127,7 @@ public MicrosoftGraphNotebookLinks links() { /** * Set the links property: notebookLinks. - * + * * @param links the links value to set. * @return the MicrosoftGraphNotebook object itself. */ @@ -141,7 +139,7 @@ public MicrosoftGraphNotebook withLinks(MicrosoftGraphNotebookLinks links) { /** * Get the sectionGroupsUrl property: The URL for the sectionGroups navigation property, which returns all the * section groups in the notebook. Read-only. - * + * * @return the sectionGroupsUrl value. */ public String sectionGroupsUrl() { @@ -151,7 +149,7 @@ public String sectionGroupsUrl() { /** * Set the sectionGroupsUrl property: The URL for the sectionGroups navigation property, which returns all the * section groups in the notebook. Read-only. - * + * * @param sectionGroupsUrl the sectionGroupsUrl value to set. * @return the MicrosoftGraphNotebook object itself. */ @@ -163,7 +161,7 @@ public MicrosoftGraphNotebook withSectionGroupsUrl(String sectionGroupsUrl) { /** * Get the sectionsUrl property: The URL for the sections navigation property, which returns all the sections in the * notebook. Read-only. - * + * * @return the sectionsUrl value. */ public String sectionsUrl() { @@ -173,7 +171,7 @@ public String sectionsUrl() { /** * Set the sectionsUrl property: The URL for the sections navigation property, which returns all the sections in the * notebook. Read-only. - * + * * @param sectionsUrl the sectionsUrl value to set. * @return the MicrosoftGraphNotebook object itself. */ @@ -184,7 +182,7 @@ public MicrosoftGraphNotebook withSectionsUrl(String sectionsUrl) { /** * Get the userRole property: onenoteUserRole. - * + * * @return the userRole value. */ public MicrosoftGraphOnenoteUserRole userRole() { @@ -193,7 +191,7 @@ public MicrosoftGraphOnenoteUserRole userRole() { /** * Set the userRole property: onenoteUserRole. - * + * * @param userRole the userRole value to set. * @return the MicrosoftGraphNotebook object itself. */ @@ -204,7 +202,7 @@ public MicrosoftGraphNotebook withUserRole(MicrosoftGraphOnenoteUserRole userRol /** * Get the sectionGroups property: The section groups in the notebook. Read-only. Nullable. - * + * * @return the sectionGroups value. */ public List sectionGroups() { @@ -213,7 +211,7 @@ public List sectionGroups() { /** * Set the sectionGroups property: The section groups in the notebook. Read-only. Nullable. - * + * * @param sectionGroups the sectionGroups value to set. * @return the MicrosoftGraphNotebook object itself. */ @@ -224,7 +222,7 @@ public MicrosoftGraphNotebook withSectionGroups(List /** * Get the sections property: The sections in the notebook. Read-only. Nullable. - * + * * @return the sections value. */ public List sections() { @@ -233,7 +231,7 @@ public List sections() { /** * Set the sections property: The sections in the notebook. Read-only. Nullable. - * + * * @param sections the sections value to set. * @return the MicrosoftGraphNotebook object itself. */ @@ -244,17 +242,16 @@ public MicrosoftGraphNotebook withSections(List se /** * Get the additionalProperties property: notebook. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: notebook. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphNotebook object itself. */ @@ -263,57 +260,63 @@ public MicrosoftGraphNotebook withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphNotebook withCreatedBy(MicrosoftGraphIdentitySet createdBy) { super.withCreatedBy(createdBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphNotebook withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphNotebook withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphNotebook withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphNotebook withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphNotebook withSelf(String self) { super.withSelf(self); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphNotebook withId(String id) { super.withId(id); @@ -322,7 +325,7 @@ public MicrosoftGraphNotebook withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -338,4 +341,104 @@ public void validate() { sections().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("self", self()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeJsonField("createdBy", createdBy()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeBooleanField("isDefault", this.isDefault); + jsonWriter.writeBooleanField("isShared", this.isShared); + jsonWriter.writeJsonField("links", this.links); + jsonWriter.writeStringField("sectionGroupsUrl", this.sectionGroupsUrl); + jsonWriter.writeStringField("sectionsUrl", this.sectionsUrl); + jsonWriter.writeStringField("userRole", this.userRole == null ? null : this.userRole.toString()); + jsonWriter.writeArrayField("sectionGroups", this.sectionGroups, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sections", this.sections, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphNotebook from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphNotebook 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 MicrosoftGraphNotebook. + */ + public static MicrosoftGraphNotebook fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphNotebook deserializedMicrosoftGraphNotebook = new MicrosoftGraphNotebook(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.withId(reader.getString()); + } else if ("self".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.withSelf(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.withCreatedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.withDisplayName(reader.getString()); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("isDefault".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("isShared".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.isShared = reader.getNullable(JsonReader::getBoolean); + } else if ("links".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.links = MicrosoftGraphNotebookLinks.fromJson(reader); + } else if ("sectionGroupsUrl".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.sectionGroupsUrl = reader.getString(); + } else if ("sectionsUrl".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.sectionsUrl = reader.getString(); + } else if ("userRole".equals(fieldName)) { + deserializedMicrosoftGraphNotebook.userRole + = MicrosoftGraphOnenoteUserRole.fromString(reader.getString()); + } else if ("sectionGroups".equals(fieldName)) { + List sectionGroups + = reader.readArray(reader1 -> MicrosoftGraphSectionGroup.fromJson(reader1)); + deserializedMicrosoftGraphNotebook.sectionGroups = sectionGroups; + } else if ("sections".equals(fieldName)) { + List sections + = reader.readArray(reader1 -> MicrosoftGraphOnenoteSection.fromJson(reader1)); + deserializedMicrosoftGraphNotebook.sections = sections; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphNotebook.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphNotebook; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNotebookLinks.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNotebookLinks.java index 67f6256de5024..c9251b4549578 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNotebookLinks.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNotebookLinks.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** notebookLinks. */ +/** + * notebookLinks. + */ @Fluent -public final class MicrosoftGraphNotebookLinks { +public final class MicrosoftGraphNotebookLinks implements JsonSerializable { /* * externalLink */ - @JsonProperty(value = "oneNoteClientUrl") private MicrosoftGraphExternalLink oneNoteClientUrl; /* * externalLink */ - @JsonProperty(value = "oneNoteWebUrl") private MicrosoftGraphExternalLink oneNoteWebUrl; /* * notebookLinks */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphNotebookLinks class. */ + /** + * Creates an instance of MicrosoftGraphNotebookLinks class. + */ public MicrosoftGraphNotebookLinks() { } /** * Get the oneNoteClientUrl property: externalLink. - * + * * @return the oneNoteClientUrl value. */ public MicrosoftGraphExternalLink oneNoteClientUrl() { @@ -47,7 +50,7 @@ public MicrosoftGraphExternalLink oneNoteClientUrl() { /** * Set the oneNoteClientUrl property: externalLink. - * + * * @param oneNoteClientUrl the oneNoteClientUrl value to set. * @return the MicrosoftGraphNotebookLinks object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphNotebookLinks withOneNoteClientUrl(MicrosoftGraphExternalLi /** * Get the oneNoteWebUrl property: externalLink. - * + * * @return the oneNoteWebUrl value. */ public MicrosoftGraphExternalLink oneNoteWebUrl() { @@ -67,7 +70,7 @@ public MicrosoftGraphExternalLink oneNoteWebUrl() { /** * Set the oneNoteWebUrl property: externalLink. - * + * * @param oneNoteWebUrl the oneNoteWebUrl value to set. * @return the MicrosoftGraphNotebookLinks object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphNotebookLinks withOneNoteWebUrl(MicrosoftGraphExternalLink /** * Get the additionalProperties property: notebookLinks. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: notebookLinks. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphNotebookLinks object itself. */ @@ -97,17 +99,9 @@ public MicrosoftGraphNotebookLinks withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -118,4 +112,55 @@ public void validate() { oneNoteWebUrl().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("oneNoteClientUrl", this.oneNoteClientUrl); + jsonWriter.writeJsonField("oneNoteWebUrl", this.oneNoteWebUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphNotebookLinks from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphNotebookLinks 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 MicrosoftGraphNotebookLinks. + */ + public static MicrosoftGraphNotebookLinks fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphNotebookLinks deserializedMicrosoftGraphNotebookLinks = new MicrosoftGraphNotebookLinks(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("oneNoteClientUrl".equals(fieldName)) { + deserializedMicrosoftGraphNotebookLinks.oneNoteClientUrl + = MicrosoftGraphExternalLink.fromJson(reader); + } else if ("oneNoteWebUrl".equals(fieldName)) { + deserializedMicrosoftGraphNotebookLinks.oneNoteWebUrl = MicrosoftGraphExternalLink.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphNotebookLinks.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphNotebookLinks; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNumberColumn.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNumberColumn.java index cfb81c5bad08d..48befb4c3591c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNumberColumn.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphNumberColumn.java @@ -5,54 +5,55 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** numberColumn. */ +/** + * numberColumn. + */ @Fluent -public final class MicrosoftGraphNumberColumn { +public final class MicrosoftGraphNumberColumn implements JsonSerializable { /* * How many decimal places to display. See below for information about the possible values. */ - @JsonProperty(value = "decimalPlaces") private String decimalPlaces; /* * How the value should be presented in the UX. Must be one of number or percentage. If unspecified, treated as * number. */ - @JsonProperty(value = "displayAs") private String displayAs; /* * The maximum permitted value. */ - @JsonProperty(value = "maximum") private Double maximum; /* * The minimum permitted value. */ - @JsonProperty(value = "minimum") private Double minimum; /* * numberColumn */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphNumberColumn class. */ + /** + * Creates an instance of MicrosoftGraphNumberColumn class. + */ public MicrosoftGraphNumberColumn() { } /** * Get the decimalPlaces property: How many decimal places to display. See below for information about the possible * values. - * + * * @return the decimalPlaces value. */ public String decimalPlaces() { @@ -62,7 +63,7 @@ public String decimalPlaces() { /** * Set the decimalPlaces property: How many decimal places to display. See below for information about the possible * values. - * + * * @param decimalPlaces the decimalPlaces value to set. * @return the MicrosoftGraphNumberColumn object itself. */ @@ -74,7 +75,7 @@ public MicrosoftGraphNumberColumn withDecimalPlaces(String decimalPlaces) { /** * Get the displayAs property: How the value should be presented in the UX. Must be one of number or percentage. If * unspecified, treated as number. - * + * * @return the displayAs value. */ public String displayAs() { @@ -84,7 +85,7 @@ public String displayAs() { /** * Set the displayAs property: How the value should be presented in the UX. Must be one of number or percentage. If * unspecified, treated as number. - * + * * @param displayAs the displayAs value to set. * @return the MicrosoftGraphNumberColumn object itself. */ @@ -95,7 +96,7 @@ public MicrosoftGraphNumberColumn withDisplayAs(String displayAs) { /** * Get the maximum property: The maximum permitted value. - * + * * @return the maximum value. */ public Double maximum() { @@ -104,7 +105,7 @@ public Double maximum() { /** * Set the maximum property: The maximum permitted value. - * + * * @param maximum the maximum value to set. * @return the MicrosoftGraphNumberColumn object itself. */ @@ -115,7 +116,7 @@ public MicrosoftGraphNumberColumn withMaximum(Double maximum) { /** * Get the minimum property: The minimum permitted value. - * + * * @return the minimum value. */ public Double minimum() { @@ -124,7 +125,7 @@ public Double minimum() { /** * Set the minimum property: The minimum permitted value. - * + * * @param minimum the minimum value to set. * @return the MicrosoftGraphNumberColumn object itself. */ @@ -135,17 +136,16 @@ public MicrosoftGraphNumberColumn withMinimum(Double minimum) { /** * Get the additionalProperties property: numberColumn. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: numberColumn. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphNumberColumn object itself. */ @@ -154,19 +154,67 @@ public MicrosoftGraphNumberColumn withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("decimalPlaces", this.decimalPlaces); + jsonWriter.writeStringField("displayAs", this.displayAs); + jsonWriter.writeNumberField("maximum", this.maximum); + jsonWriter.writeNumberField("minimum", this.minimum); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphNumberColumn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphNumberColumn 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 MicrosoftGraphNumberColumn. + */ + public static MicrosoftGraphNumberColumn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphNumberColumn deserializedMicrosoftGraphNumberColumn = new MicrosoftGraphNumberColumn(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("decimalPlaces".equals(fieldName)) { + deserializedMicrosoftGraphNumberColumn.decimalPlaces = reader.getString(); + } else if ("displayAs".equals(fieldName)) { + deserializedMicrosoftGraphNumberColumn.displayAs = reader.getString(); + } else if ("maximum".equals(fieldName)) { + deserializedMicrosoftGraphNumberColumn.maximum = reader.getNullable(JsonReader::getDouble); + } else if ("minimum".equals(fieldName)) { + deserializedMicrosoftGraphNumberColumn.minimum = reader.getNullable(JsonReader::getDouble); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphNumberColumn.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphNumberColumn; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOAuth2PermissionGrant.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOAuth2PermissionGrant.java index c4725b32aac3e..58870a7d03d18 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOAuth2PermissionGrant.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOAuth2PermissionGrant.java @@ -5,21 +5,22 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** oAuth2PermissionGrant. */ +/** + * oAuth2PermissionGrant. + */ @Fluent public final class MicrosoftGraphOAuth2PermissionGrant extends MicrosoftGraphEntity { /* * The id of the client service principal for the application which is authorized to act on behalf of a signed-in * user when accessing an API. Required. Supports $filter (eq only). */ - @JsonProperty(value = "clientId") private String clientId; /* @@ -29,21 +30,18 @@ public final class MicrosoftGraphOAuth2PermissionGrant extends MicrosoftGraphEnt * may be authorized to consent on behalf of themselves in some cases, for some delegated permissions. Required. * Supports $filter (eq only). */ - @JsonProperty(value = "consentType") private String consentType; /* * The id of the user on behalf of whom the client is authorized to access the resource, when consentType is * Principal. If consentType is AllPrincipals this value is null. Required when consentType is Principal. */ - @JsonProperty(value = "principalId") private String principalId; /* * The id of the resource service principal to which access is authorized. This identifies the API which the client * is authorized to attempt to call on behalf of a signed-in user. */ - @JsonProperty(value = "resourceId") private String resourceId; /* @@ -52,22 +50,23 @@ public final class MicrosoftGraphOAuth2PermissionGrant extends MicrosoftGraphEnt * should match the value field of one of the delegated permissions defined by the API, listed in the * publishedPermissionScopes property of the resource service principal. */ - @JsonProperty(value = "scope") private String scope; /* * oAuth2PermissionGrant */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOAuth2PermissionGrant class. */ + /** + * Creates an instance of MicrosoftGraphOAuth2PermissionGrant class. + */ public MicrosoftGraphOAuth2PermissionGrant() { } /** * Get the clientId property: The id of the client service principal for the application which is authorized to act * on behalf of a signed-in user when accessing an API. Required. Supports $filter (eq only). - * + * * @return the clientId value. */ public String clientId() { @@ -77,7 +76,7 @@ public String clientId() { /** * Set the clientId property: The id of the client service principal for the application which is authorized to act * on behalf of a signed-in user when accessing an API. Required. Supports $filter (eq only). - * + * * @param clientId the clientId value to set. * @return the MicrosoftGraphOAuth2PermissionGrant object itself. */ @@ -92,7 +91,7 @@ public MicrosoftGraphOAuth2PermissionGrant withClientId(String clientId) { * indicates authorization to impersonate a specific user. Consent on behalf of all users can be granted by an * administrator. Non-admin users may be authorized to consent on behalf of themselves in some cases, for some * delegated permissions. Required. Supports $filter (eq only). - * + * * @return the consentType value. */ public String consentType() { @@ -105,7 +104,7 @@ public String consentType() { * indicates authorization to impersonate a specific user. Consent on behalf of all users can be granted by an * administrator. Non-admin users may be authorized to consent on behalf of themselves in some cases, for some * delegated permissions. Required. Supports $filter (eq only). - * + * * @param consentType the consentType value to set. * @return the MicrosoftGraphOAuth2PermissionGrant object itself. */ @@ -118,7 +117,7 @@ public MicrosoftGraphOAuth2PermissionGrant withConsentType(String consentType) { * Get the principalId property: The id of the user on behalf of whom the client is authorized to access the * resource, when consentType is Principal. If consentType is AllPrincipals this value is null. Required when * consentType is Principal. - * + * * @return the principalId value. */ public String principalId() { @@ -129,7 +128,7 @@ public String principalId() { * Set the principalId property: The id of the user on behalf of whom the client is authorized to access the * resource, when consentType is Principal. If consentType is AllPrincipals this value is null. Required when * consentType is Principal. - * + * * @param principalId the principalId value to set. * @return the MicrosoftGraphOAuth2PermissionGrant object itself. */ @@ -141,7 +140,7 @@ public MicrosoftGraphOAuth2PermissionGrant withPrincipalId(String principalId) { /** * Get the resourceId property: The id of the resource service principal to which access is authorized. This * identifies the API which the client is authorized to attempt to call on behalf of a signed-in user. - * + * * @return the resourceId value. */ public String resourceId() { @@ -151,7 +150,7 @@ public String resourceId() { /** * Set the resourceId property: The id of the resource service principal to which access is authorized. This * identifies the API which the client is authorized to attempt to call on behalf of a signed-in user. - * + * * @param resourceId the resourceId value to set. * @return the MicrosoftGraphOAuth2PermissionGrant object itself. */ @@ -165,7 +164,7 @@ public MicrosoftGraphOAuth2PermissionGrant withResourceId(String resourceId) { * included in access tokens for the resource application (the API). For example, openid User.Read * GroupMember.Read.All. Each claim value should match the value field of one of the delegated permissions defined * by the API, listed in the publishedPermissionScopes property of the resource service principal. - * + * * @return the scope value. */ public String scope() { @@ -177,7 +176,7 @@ public String scope() { * included in access tokens for the resource application (the API). For example, openid User.Read * GroupMember.Read.All. Each claim value should match the value field of one of the delegated permissions defined * by the API, listed in the publishedPermissionScopes property of the resource service principal. - * + * * @param scope the scope value to set. * @return the MicrosoftGraphOAuth2PermissionGrant object itself. */ @@ -188,17 +187,16 @@ public MicrosoftGraphOAuth2PermissionGrant withScope(String scope) { /** * Get the additionalProperties property: oAuth2PermissionGrant. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: oAuth2PermissionGrant. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOAuth2PermissionGrant object itself. */ @@ -207,15 +205,9 @@ public MicrosoftGraphOAuth2PermissionGrant withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOAuth2PermissionGrant withId(String id) { super.withId(id); @@ -224,11 +216,74 @@ public MicrosoftGraphOAuth2PermissionGrant withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("consentType", this.consentType); + jsonWriter.writeStringField("principalId", this.principalId); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("scope", this.scope); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOAuth2PermissionGrant from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOAuth2PermissionGrant 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 MicrosoftGraphOAuth2PermissionGrant. + */ + public static MicrosoftGraphOAuth2PermissionGrant fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOAuth2PermissionGrant deserializedMicrosoftGraphOAuth2PermissionGrant + = new MicrosoftGraphOAuth2PermissionGrant(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOAuth2PermissionGrant.withId(reader.getString()); + } else if ("clientId".equals(fieldName)) { + deserializedMicrosoftGraphOAuth2PermissionGrant.clientId = reader.getString(); + } else if ("consentType".equals(fieldName)) { + deserializedMicrosoftGraphOAuth2PermissionGrant.consentType = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedMicrosoftGraphOAuth2PermissionGrant.principalId = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedMicrosoftGraphOAuth2PermissionGrant.resourceId = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedMicrosoftGraphOAuth2PermissionGrant.scope = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOAuth2PermissionGrant.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOAuth2PermissionGrant; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphObjectIdentity.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphObjectIdentity.java index e3ecc0f432a15..70046e33d1bf6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphObjectIdentity.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphObjectIdentity.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** objectIdentity. */ +/** + * objectIdentity. + */ @Fluent -public final class MicrosoftGraphObjectIdentity { +public final class MicrosoftGraphObjectIdentity implements JsonSerializable { /* * Specifies the issuer of the identity, for example facebook.com.For local accounts (where signInType is not * federated), this property is the local B2C tenant default domain name, for example contoso.onmicrosoft.com.For * external users from other Azure AD organization, this will be the domain of the federated organization, for * example contoso.com.Supports $filter. 512 character limit. */ - @JsonProperty(value = "issuer") private String issuer; /* @@ -32,7 +34,6 @@ public final class MicrosoftGraphObjectIdentity { * addressuserName, issuerAssignedId must be a valid local part of an email addressSupports $filter. 512 character * limit. */ - @JsonProperty(value = "issuerAssignedId") private String issuerAssignedId; /* @@ -41,15 +42,16 @@ public final class MicrosoftGraphObjectIdentity { * Additional validation is enforced on issuerAssignedId when the sign-in type is set to emailAddress or userName. * This property can also be set to any custom string. */ - @JsonProperty(value = "signInType") private String signInType; /* * objectIdentity */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphObjectIdentity class. */ + /** + * Creates an instance of MicrosoftGraphObjectIdentity class. + */ public MicrosoftGraphObjectIdentity() { } @@ -58,7 +60,7 @@ public MicrosoftGraphObjectIdentity() { * signInType is not federated), this property is the local B2C tenant default domain name, for example * contoso.onmicrosoft.com.For external users from other Azure AD organization, this will be the domain of the * federated organization, for example contoso.com.Supports $filter. 512 character limit. - * + * * @return the issuer value. */ public String issuer() { @@ -70,7 +72,7 @@ public String issuer() { * signInType is not federated), this property is the local B2C tenant default domain name, for example * contoso.onmicrosoft.com.For external users from other Azure AD organization, this will be the domain of the * federated organization, for example contoso.com.Supports $filter. 512 character limit. - * + * * @param issuer the issuer value to set. * @return the MicrosoftGraphObjectIdentity object itself. */ @@ -86,7 +88,7 @@ public MicrosoftGraphObjectIdentity withIssuer(String issuer) { * is set to: emailAddress, (or starts with emailAddress like emailAddress1) issuerAssignedId must be a valid email * addressuserName, issuerAssignedId must be a valid local part of an email addressSupports $filter. 512 character * limit. - * + * * @return the issuerAssignedId value. */ public String issuerAssignedId() { @@ -100,7 +102,7 @@ public String issuerAssignedId() { * is set to: emailAddress, (or starts with emailAddress like emailAddress1) issuerAssignedId must be a valid email * addressuserName, issuerAssignedId must be a valid local part of an email addressSupports $filter. 512 character * limit. - * + * * @param issuerAssignedId the issuerAssignedId value to set. * @return the MicrosoftGraphObjectIdentity object itself. */ @@ -114,7 +116,7 @@ public MicrosoftGraphObjectIdentity withIssuerAssignedId(String issuerAssignedId * or federated. Here, federated represents a unique identifier for a user from an issuer, that can be in any format * chosen by the issuer. Additional validation is enforced on issuerAssignedId when the sign-in type is set to * emailAddress or userName. This property can also be set to any custom string. - * + * * @return the signInType value. */ public String signInType() { @@ -126,7 +128,7 @@ public String signInType() { * or federated. Here, federated represents a unique identifier for a user from an issuer, that can be in any format * chosen by the issuer. Additional validation is enforced on issuerAssignedId when the sign-in type is set to * emailAddress or userName. This property can also be set to any custom string. - * + * * @param signInType the signInType value to set. * @return the MicrosoftGraphObjectIdentity object itself. */ @@ -137,17 +139,16 @@ public MicrosoftGraphObjectIdentity withSignInType(String signInType) { /** * Get the additionalProperties property: objectIdentity. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: objectIdentity. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphObjectIdentity object itself. */ @@ -156,19 +157,64 @@ public MicrosoftGraphObjectIdentity withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("issuer", this.issuer); + jsonWriter.writeStringField("issuerAssignedId", this.issuerAssignedId); + jsonWriter.writeStringField("signInType", this.signInType); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphObjectIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphObjectIdentity 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 MicrosoftGraphObjectIdentity. + */ + public static MicrosoftGraphObjectIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphObjectIdentity deserializedMicrosoftGraphObjectIdentity = new MicrosoftGraphObjectIdentity(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issuer".equals(fieldName)) { + deserializedMicrosoftGraphObjectIdentity.issuer = reader.getString(); + } else if ("issuerAssignedId".equals(fieldName)) { + deserializedMicrosoftGraphObjectIdentity.issuerAssignedId = reader.getString(); + } else if ("signInType".equals(fieldName)) { + deserializedMicrosoftGraphObjectIdentity.signInType = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphObjectIdentity.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphObjectIdentity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOfferShiftRequest.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOfferShiftRequest.java index f2192f64fa704..4c72b4eef08cf 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOfferShiftRequest.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOfferShiftRequest.java @@ -5,48 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** offerShiftRequest. */ +/** + * offerShiftRequest. + */ @Fluent public class MicrosoftGraphOfferShiftRequest extends MicrosoftGraphScheduleChangeRequest { /* * The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "recipientActionDateTime") private OffsetDateTime recipientActionDateTime; /* * Custom message sent by recipient of the offer shift request. */ - @JsonProperty(value = "recipientActionMessage") private String recipientActionMessage; /* * User ID of the recipient of the offer shift request. */ - @JsonProperty(value = "recipientUserId") private String recipientUserId; /* * User ID of the sender of the offer shift request. */ - @JsonProperty(value = "senderShiftId") private String senderShiftId; /* * offerShiftRequest */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOfferShiftRequest class. */ + /** + * Creates an instance of MicrosoftGraphOfferShiftRequest class. + */ public MicrosoftGraphOfferShiftRequest() { } @@ -54,7 +56,7 @@ public MicrosoftGraphOfferShiftRequest() { * Get the recipientActionDateTime property: The Timestamp type represents date and time information using ISO 8601 * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @return the recipientActionDateTime value. */ public OffsetDateTime recipientActionDateTime() { @@ -65,7 +67,7 @@ public OffsetDateTime recipientActionDateTime() { * Set the recipientActionDateTime property: The Timestamp type represents date and time information using ISO 8601 * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @param recipientActionDateTime the recipientActionDateTime value to set. * @return the MicrosoftGraphOfferShiftRequest object itself. */ @@ -76,7 +78,7 @@ public MicrosoftGraphOfferShiftRequest withRecipientActionDateTime(OffsetDateTim /** * Get the recipientActionMessage property: Custom message sent by recipient of the offer shift request. - * + * * @return the recipientActionMessage value. */ public String recipientActionMessage() { @@ -85,7 +87,7 @@ public String recipientActionMessage() { /** * Set the recipientActionMessage property: Custom message sent by recipient of the offer shift request. - * + * * @param recipientActionMessage the recipientActionMessage value to set. * @return the MicrosoftGraphOfferShiftRequest object itself. */ @@ -96,7 +98,7 @@ public MicrosoftGraphOfferShiftRequest withRecipientActionMessage(String recipie /** * Get the recipientUserId property: User ID of the recipient of the offer shift request. - * + * * @return the recipientUserId value. */ public String recipientUserId() { @@ -105,7 +107,7 @@ public String recipientUserId() { /** * Set the recipientUserId property: User ID of the recipient of the offer shift request. - * + * * @param recipientUserId the recipientUserId value to set. * @return the MicrosoftGraphOfferShiftRequest object itself. */ @@ -116,7 +118,7 @@ public MicrosoftGraphOfferShiftRequest withRecipientUserId(String recipientUserI /** * Get the senderShiftId property: User ID of the sender of the offer shift request. - * + * * @return the senderShiftId value. */ public String senderShiftId() { @@ -125,7 +127,7 @@ public String senderShiftId() { /** * Set the senderShiftId property: User ID of the sender of the offer shift request. - * + * * @param senderShiftId the senderShiftId value to set. * @return the MicrosoftGraphOfferShiftRequest object itself. */ @@ -136,17 +138,16 @@ public MicrosoftGraphOfferShiftRequest withSenderShiftId(String senderShiftId) { /** * Get the additionalProperties property: offerShiftRequest. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: offerShiftRequest. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOfferShiftRequest object itself. */ @@ -155,92 +156,108 @@ public MicrosoftGraphOfferShiftRequest withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withAssignedTo(MicrosoftGraphScheduleChangeRequestActor assignedTo) { super.withAssignedTo(assignedTo); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withManagerActionDateTime(OffsetDateTime managerActionDateTime) { super.withManagerActionDateTime(managerActionDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withManagerActionMessage(String managerActionMessage) { super.withManagerActionMessage(managerActionMessage); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withManagerUserId(String managerUserId) { super.withManagerUserId(managerUserId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withSenderDateTime(OffsetDateTime senderDateTime) { super.withSenderDateTime(senderDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withSenderMessage(String senderMessage) { super.withSenderMessage(senderMessage); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withSenderUserId(String senderUserId) { super.withSenderUserId(senderUserId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withState(MicrosoftGraphScheduleChangeState state) { super.withState(state); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfferShiftRequest withId(String id) { super.withId(id); @@ -249,11 +266,123 @@ public MicrosoftGraphOfferShiftRequest withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeStringField("assignedTo", assignedTo() == null ? null : assignedTo().toString()); + jsonWriter.writeStringField("managerActionDateTime", + managerActionDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(managerActionDateTime())); + jsonWriter.writeStringField("managerActionMessage", managerActionMessage()); + jsonWriter.writeStringField("managerUserId", managerUserId()); + jsonWriter.writeStringField("senderDateTime", + senderDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(senderDateTime())); + jsonWriter.writeStringField("senderMessage", senderMessage()); + jsonWriter.writeStringField("senderUserId", senderUserId()); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + jsonWriter.writeStringField("recipientActionDateTime", + this.recipientActionDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recipientActionDateTime)); + jsonWriter.writeStringField("recipientActionMessage", this.recipientActionMessage); + jsonWriter.writeStringField("recipientUserId", this.recipientUserId); + jsonWriter.writeStringField("senderShiftId", this.senderShiftId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOfferShiftRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOfferShiftRequest 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 MicrosoftGraphOfferShiftRequest. + */ + public static MicrosoftGraphOfferShiftRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOfferShiftRequest deserializedMicrosoftGraphOfferShiftRequest + = new MicrosoftGraphOfferShiftRequest(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.withId(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest + .withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("assignedTo".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest + .withAssignedTo(MicrosoftGraphScheduleChangeRequestActor.fromString(reader.getString())); + } else if ("managerActionDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.withManagerActionDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("managerActionMessage".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.withManagerActionMessage(reader.getString()); + } else if ("managerUserId".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.withManagerUserId(reader.getString()); + } else if ("senderDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.withSenderDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("senderMessage".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.withSenderMessage(reader.getString()); + } else if ("senderUserId".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.withSenderUserId(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest + .withState(MicrosoftGraphScheduleChangeState.fromString(reader.getString())); + } else if ("recipientActionDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.recipientActionDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("recipientActionMessage".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.recipientActionMessage = reader.getString(); + } else if ("recipientUserId".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.recipientUserId = reader.getString(); + } else if ("senderShiftId".equals(fieldName)) { + deserializedMicrosoftGraphOfferShiftRequest.senderShiftId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOfferShiftRequest.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOfferShiftRequest; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOfficeGraphInsights.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOfficeGraphInsights.java index 8a3ba885af278..44281dd642191 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOfficeGraphInsights.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOfficeGraphInsights.java @@ -5,15 +5,17 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** officeGraphInsights. */ +/** + * officeGraphInsights. + */ @Fluent public final class MicrosoftGraphOfficeGraphInsights extends MicrosoftGraphEntity { /* @@ -21,7 +23,6 @@ public final class MicrosoftGraphOfficeGraphInsights extends MicrosoftGraphEntit * and reference attachments to OneDrive for Business and SharePoint files found in Outlook messages and meetings. * This also includes URLs and reference attachments to Teams conversations. Ordered by recency of share. */ - @JsonProperty(value = "shared") private List shared; /* @@ -30,22 +31,22 @@ public final class MicrosoftGraphOfficeGraphInsights extends MicrosoftGraphEntit * SharePoint. Trending insights help the user to discover potentially useful content that the user has access to, * but has never viewed before. */ - @JsonProperty(value = "trending") private List trending; /* * Calculated relationship identifying the latest documents viewed or modified by a user, including OneDrive for * Business and SharePoint documents, ranked by recency of use. */ - @JsonProperty(value = "used") private List used; /* * officeGraphInsights */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOfficeGraphInsights class. */ + /** + * Creates an instance of MicrosoftGraphOfficeGraphInsights class. + */ public MicrosoftGraphOfficeGraphInsights() { } @@ -54,7 +55,7 @@ public MicrosoftGraphOfficeGraphInsights() { * URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook * messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by * recency of share. - * + * * @return the shared value. */ public List shared() { @@ -66,7 +67,7 @@ public List shared() { * URLs, file attachments, and reference attachments to OneDrive for Business and SharePoint files found in Outlook * messages and meetings. This also includes URLs and reference attachments to Teams conversations. Ordered by * recency of share. - * + * * @param shared the shared value to set. * @return the MicrosoftGraphOfficeGraphInsights object itself. */ @@ -80,7 +81,7 @@ public MicrosoftGraphOfficeGraphInsights withShared(List trending() { @@ -92,7 +93,7 @@ public List trending() { * documents are calculated based on activity of the user's closest network of people and include files stored in * OneDrive for Business and SharePoint. Trending insights help the user to discover potentially useful content that * the user has access to, but has never viewed before. - * + * * @param trending the trending value to set. * @return the MicrosoftGraphOfficeGraphInsights object itself. */ @@ -104,7 +105,7 @@ public MicrosoftGraphOfficeGraphInsights withTrending(List used() { @@ -114,7 +115,7 @@ public List used() { /** * Set the used property: Calculated relationship identifying the latest documents viewed or modified by a user, * including OneDrive for Business and SharePoint documents, ranked by recency of use. - * + * * @param used the used value to set. * @return the MicrosoftGraphOfficeGraphInsights object itself. */ @@ -125,17 +126,16 @@ public MicrosoftGraphOfficeGraphInsights withUsed(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: officeGraphInsights. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOfficeGraphInsights object itself. */ @@ -144,15 +144,9 @@ public MicrosoftGraphOfficeGraphInsights withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOfficeGraphInsights withId(String id) { super.withId(id); @@ -161,7 +155,7 @@ public MicrosoftGraphOfficeGraphInsights withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -177,4 +171,67 @@ public void validate() { used().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("shared", this.shared, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("trending", this.trending, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("used", this.used, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOfficeGraphInsights from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOfficeGraphInsights 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 MicrosoftGraphOfficeGraphInsights. + */ + public static MicrosoftGraphOfficeGraphInsights fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOfficeGraphInsights deserializedMicrosoftGraphOfficeGraphInsights + = new MicrosoftGraphOfficeGraphInsights(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOfficeGraphInsights.withId(reader.getString()); + } else if ("shared".equals(fieldName)) { + List shared + = reader.readArray(reader1 -> MicrosoftGraphSharedInsight.fromJson(reader1)); + deserializedMicrosoftGraphOfficeGraphInsights.shared = shared; + } else if ("trending".equals(fieldName)) { + List trending + = reader.readArray(reader1 -> MicrosoftGraphTrending.fromJson(reader1)); + deserializedMicrosoftGraphOfficeGraphInsights.trending = trending; + } else if ("used".equals(fieldName)) { + List used + = reader.readArray(reader1 -> MicrosoftGraphUsedInsight.fromJson(reader1)); + deserializedMicrosoftGraphOfficeGraphInsights.used = used; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOfficeGraphInsights.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOfficeGraphInsights; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnPremisesExtensionAttributes.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnPremisesExtensionAttributes.java index 1b95bc1a695a4..acc46eb018ea6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnPremisesExtensionAttributes.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnPremisesExtensionAttributes.java @@ -5,118 +5,109 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** onPremisesExtensionAttributes. */ +/** + * onPremisesExtensionAttributes. + */ @Fluent -public final class MicrosoftGraphOnPremisesExtensionAttributes { +public final class MicrosoftGraphOnPremisesExtensionAttributes + implements JsonSerializable { /* * First customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute1") private String extensionAttribute1; /* * Tenth customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute10") private String extensionAttribute10; /* * Eleventh customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute11") private String extensionAttribute11; /* * Twelfth customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute12") private String extensionAttribute12; /* * Thirteenth customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute13") private String extensionAttribute13; /* * Fourteenth customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute14") private String extensionAttribute14; /* * Fifteenth customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute15") private String extensionAttribute15; /* * Second customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute2") private String extensionAttribute2; /* * Third customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute3") private String extensionAttribute3; /* * Fourth customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute4") private String extensionAttribute4; /* * Fifth customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute5") private String extensionAttribute5; /* * Sixth customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute6") private String extensionAttribute6; /* * Seventh customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute7") private String extensionAttribute7; /* * Eighth customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute8") private String extensionAttribute8; /* * Ninth customizable extension attribute. */ - @JsonProperty(value = "extensionAttribute9") private String extensionAttribute9; /* * onPremisesExtensionAttributes */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnPremisesExtensionAttributes class. */ + /** + * Creates an instance of MicrosoftGraphOnPremisesExtensionAttributes class. + */ public MicrosoftGraphOnPremisesExtensionAttributes() { } /** * Get the extensionAttribute1 property: First customizable extension attribute. - * + * * @return the extensionAttribute1 value. */ public String extensionAttribute1() { @@ -125,7 +116,7 @@ public String extensionAttribute1() { /** * Set the extensionAttribute1 property: First customizable extension attribute. - * + * * @param extensionAttribute1 the extensionAttribute1 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -136,7 +127,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute1(Strin /** * Get the extensionAttribute10 property: Tenth customizable extension attribute. - * + * * @return the extensionAttribute10 value. */ public String extensionAttribute10() { @@ -145,7 +136,7 @@ public String extensionAttribute10() { /** * Set the extensionAttribute10 property: Tenth customizable extension attribute. - * + * * @param extensionAttribute10 the extensionAttribute10 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -156,7 +147,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute10(Stri /** * Get the extensionAttribute11 property: Eleventh customizable extension attribute. - * + * * @return the extensionAttribute11 value. */ public String extensionAttribute11() { @@ -165,7 +156,7 @@ public String extensionAttribute11() { /** * Set the extensionAttribute11 property: Eleventh customizable extension attribute. - * + * * @param extensionAttribute11 the extensionAttribute11 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -176,7 +167,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute11(Stri /** * Get the extensionAttribute12 property: Twelfth customizable extension attribute. - * + * * @return the extensionAttribute12 value. */ public String extensionAttribute12() { @@ -185,7 +176,7 @@ public String extensionAttribute12() { /** * Set the extensionAttribute12 property: Twelfth customizable extension attribute. - * + * * @param extensionAttribute12 the extensionAttribute12 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -196,7 +187,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute12(Stri /** * Get the extensionAttribute13 property: Thirteenth customizable extension attribute. - * + * * @return the extensionAttribute13 value. */ public String extensionAttribute13() { @@ -205,7 +196,7 @@ public String extensionAttribute13() { /** * Set the extensionAttribute13 property: Thirteenth customizable extension attribute. - * + * * @param extensionAttribute13 the extensionAttribute13 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -216,7 +207,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute13(Stri /** * Get the extensionAttribute14 property: Fourteenth customizable extension attribute. - * + * * @return the extensionAttribute14 value. */ public String extensionAttribute14() { @@ -225,7 +216,7 @@ public String extensionAttribute14() { /** * Set the extensionAttribute14 property: Fourteenth customizable extension attribute. - * + * * @param extensionAttribute14 the extensionAttribute14 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -236,7 +227,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute14(Stri /** * Get the extensionAttribute15 property: Fifteenth customizable extension attribute. - * + * * @return the extensionAttribute15 value. */ public String extensionAttribute15() { @@ -245,7 +236,7 @@ public String extensionAttribute15() { /** * Set the extensionAttribute15 property: Fifteenth customizable extension attribute. - * + * * @param extensionAttribute15 the extensionAttribute15 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -256,7 +247,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute15(Stri /** * Get the extensionAttribute2 property: Second customizable extension attribute. - * + * * @return the extensionAttribute2 value. */ public String extensionAttribute2() { @@ -265,7 +256,7 @@ public String extensionAttribute2() { /** * Set the extensionAttribute2 property: Second customizable extension attribute. - * + * * @param extensionAttribute2 the extensionAttribute2 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -276,7 +267,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute2(Strin /** * Get the extensionAttribute3 property: Third customizable extension attribute. - * + * * @return the extensionAttribute3 value. */ public String extensionAttribute3() { @@ -285,7 +276,7 @@ public String extensionAttribute3() { /** * Set the extensionAttribute3 property: Third customizable extension attribute. - * + * * @param extensionAttribute3 the extensionAttribute3 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -296,7 +287,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute3(Strin /** * Get the extensionAttribute4 property: Fourth customizable extension attribute. - * + * * @return the extensionAttribute4 value. */ public String extensionAttribute4() { @@ -305,7 +296,7 @@ public String extensionAttribute4() { /** * Set the extensionAttribute4 property: Fourth customizable extension attribute. - * + * * @param extensionAttribute4 the extensionAttribute4 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -316,7 +307,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute4(Strin /** * Get the extensionAttribute5 property: Fifth customizable extension attribute. - * + * * @return the extensionAttribute5 value. */ public String extensionAttribute5() { @@ -325,7 +316,7 @@ public String extensionAttribute5() { /** * Set the extensionAttribute5 property: Fifth customizable extension attribute. - * + * * @param extensionAttribute5 the extensionAttribute5 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -336,7 +327,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute5(Strin /** * Get the extensionAttribute6 property: Sixth customizable extension attribute. - * + * * @return the extensionAttribute6 value. */ public String extensionAttribute6() { @@ -345,7 +336,7 @@ public String extensionAttribute6() { /** * Set the extensionAttribute6 property: Sixth customizable extension attribute. - * + * * @param extensionAttribute6 the extensionAttribute6 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -356,7 +347,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute6(Strin /** * Get the extensionAttribute7 property: Seventh customizable extension attribute. - * + * * @return the extensionAttribute7 value. */ public String extensionAttribute7() { @@ -365,7 +356,7 @@ public String extensionAttribute7() { /** * Set the extensionAttribute7 property: Seventh customizable extension attribute. - * + * * @param extensionAttribute7 the extensionAttribute7 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -376,7 +367,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute7(Strin /** * Get the extensionAttribute8 property: Eighth customizable extension attribute. - * + * * @return the extensionAttribute8 value. */ public String extensionAttribute8() { @@ -385,7 +376,7 @@ public String extensionAttribute8() { /** * Set the extensionAttribute8 property: Eighth customizable extension attribute. - * + * * @param extensionAttribute8 the extensionAttribute8 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -396,7 +387,7 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute8(Strin /** * Get the extensionAttribute9 property: Ninth customizable extension attribute. - * + * * @return the extensionAttribute9 value. */ public String extensionAttribute9() { @@ -405,7 +396,7 @@ public String extensionAttribute9() { /** * Set the extensionAttribute9 property: Ninth customizable extension attribute. - * + * * @param extensionAttribute9 the extensionAttribute9 value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ @@ -416,39 +407,120 @@ public MicrosoftGraphOnPremisesExtensionAttributes withExtensionAttribute9(Strin /** * Get the additionalProperties property: onPremisesExtensionAttributes. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onPremisesExtensionAttributes. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnPremisesExtensionAttributes object itself. */ - public MicrosoftGraphOnPremisesExtensionAttributes withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphOnPremisesExtensionAttributes + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("extensionAttribute1", this.extensionAttribute1); + jsonWriter.writeStringField("extensionAttribute10", this.extensionAttribute10); + jsonWriter.writeStringField("extensionAttribute11", this.extensionAttribute11); + jsonWriter.writeStringField("extensionAttribute12", this.extensionAttribute12); + jsonWriter.writeStringField("extensionAttribute13", this.extensionAttribute13); + jsonWriter.writeStringField("extensionAttribute14", this.extensionAttribute14); + jsonWriter.writeStringField("extensionAttribute15", this.extensionAttribute15); + jsonWriter.writeStringField("extensionAttribute2", this.extensionAttribute2); + jsonWriter.writeStringField("extensionAttribute3", this.extensionAttribute3); + jsonWriter.writeStringField("extensionAttribute4", this.extensionAttribute4); + jsonWriter.writeStringField("extensionAttribute5", this.extensionAttribute5); + jsonWriter.writeStringField("extensionAttribute6", this.extensionAttribute6); + jsonWriter.writeStringField("extensionAttribute7", this.extensionAttribute7); + jsonWriter.writeStringField("extensionAttribute8", this.extensionAttribute8); + jsonWriter.writeStringField("extensionAttribute9", this.extensionAttribute9); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnPremisesExtensionAttributes from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnPremisesExtensionAttributes 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 MicrosoftGraphOnPremisesExtensionAttributes. + */ + public static MicrosoftGraphOnPremisesExtensionAttributes fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnPremisesExtensionAttributes deserializedMicrosoftGraphOnPremisesExtensionAttributes + = new MicrosoftGraphOnPremisesExtensionAttributes(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("extensionAttribute1".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute1 = reader.getString(); + } else if ("extensionAttribute10".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute10 = reader.getString(); + } else if ("extensionAttribute11".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute11 = reader.getString(); + } else if ("extensionAttribute12".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute12 = reader.getString(); + } else if ("extensionAttribute13".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute13 = reader.getString(); + } else if ("extensionAttribute14".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute14 = reader.getString(); + } else if ("extensionAttribute15".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute15 = reader.getString(); + } else if ("extensionAttribute2".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute2 = reader.getString(); + } else if ("extensionAttribute3".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute3 = reader.getString(); + } else if ("extensionAttribute4".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute4 = reader.getString(); + } else if ("extensionAttribute5".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute5 = reader.getString(); + } else if ("extensionAttribute6".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute6 = reader.getString(); + } else if ("extensionAttribute7".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute7 = reader.getString(); + } else if ("extensionAttribute8".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute8 = reader.getString(); + } else if ("extensionAttribute9".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesExtensionAttributes.extensionAttribute9 = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnPremisesExtensionAttributes.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnPremisesExtensionAttributes; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnPremisesProvisioningError.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnPremisesProvisioningError.java index 38868a9c7a188..50383dec7272b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnPremisesProvisioningError.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnPremisesProvisioningError.java @@ -5,49 +5,53 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** onPremisesProvisioningError. */ +/** + * onPremisesProvisioningError. + */ @Fluent -public final class MicrosoftGraphOnPremisesProvisioningError { +public final class MicrosoftGraphOnPremisesProvisioningError + implements JsonSerializable { /* * Category of the provisioning error. Note: Currently, there is only one possible value. Possible value: * PropertyConflict - indicates a property value is not unique. Other objects contain the same value for the * property. */ - @JsonProperty(value = "category") private String category; /* * The date and time at which the error occurred. */ - @JsonProperty(value = "occurredDateTime") private OffsetDateTime occurredDateTime; /* * Name of the directory property causing the error. Current possible values: UserPrincipalName or ProxyAddress */ - @JsonProperty(value = "propertyCausingError") private String propertyCausingError; /* * Value of the property causing the error. */ - @JsonProperty(value = "value") private String value; /* * onPremisesProvisioningError */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnPremisesProvisioningError class. */ + /** + * Creates an instance of MicrosoftGraphOnPremisesProvisioningError class. + */ public MicrosoftGraphOnPremisesProvisioningError() { } @@ -55,7 +59,7 @@ public MicrosoftGraphOnPremisesProvisioningError() { * Get the category property: Category of the provisioning error. Note: Currently, there is only one possible value. * Possible value: PropertyConflict - indicates a property value is not unique. Other objects contain the same value * for the property. - * + * * @return the category value. */ public String category() { @@ -66,7 +70,7 @@ public String category() { * Set the category property: Category of the provisioning error. Note: Currently, there is only one possible value. * Possible value: PropertyConflict - indicates a property value is not unique. Other objects contain the same value * for the property. - * + * * @param category the category value to set. * @return the MicrosoftGraphOnPremisesProvisioningError object itself. */ @@ -77,7 +81,7 @@ public MicrosoftGraphOnPremisesProvisioningError withCategory(String category) { /** * Get the occurredDateTime property: The date and time at which the error occurred. - * + * * @return the occurredDateTime value. */ public OffsetDateTime occurredDateTime() { @@ -86,7 +90,7 @@ public OffsetDateTime occurredDateTime() { /** * Set the occurredDateTime property: The date and time at which the error occurred. - * + * * @param occurredDateTime the occurredDateTime value to set. * @return the MicrosoftGraphOnPremisesProvisioningError object itself. */ @@ -98,7 +102,7 @@ public MicrosoftGraphOnPremisesProvisioningError withOccurredDateTime(OffsetDate /** * Get the propertyCausingError property: Name of the directory property causing the error. Current possible values: * UserPrincipalName or ProxyAddress. - * + * * @return the propertyCausingError value. */ public String propertyCausingError() { @@ -108,7 +112,7 @@ public String propertyCausingError() { /** * Set the propertyCausingError property: Name of the directory property causing the error. Current possible values: * UserPrincipalName or ProxyAddress. - * + * * @param propertyCausingError the propertyCausingError value to set. * @return the MicrosoftGraphOnPremisesProvisioningError object itself. */ @@ -119,7 +123,7 @@ public MicrosoftGraphOnPremisesProvisioningError withPropertyCausingError(String /** * Get the value property: Value of the property causing the error. - * + * * @return the value value. */ public String value() { @@ -128,7 +132,7 @@ public String value() { /** * Set the value property: Value of the property causing the error. - * + * * @param value the value value to set. * @return the MicrosoftGraphOnPremisesProvisioningError object itself. */ @@ -139,39 +143,91 @@ public MicrosoftGraphOnPremisesProvisioningError withValue(String value) { /** * Get the additionalProperties property: onPremisesProvisioningError. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onPremisesProvisioningError. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnPremisesProvisioningError object itself. */ - public MicrosoftGraphOnPremisesProvisioningError withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphOnPremisesProvisioningError + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category); + jsonWriter.writeStringField("occurredDateTime", + this.occurredDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.occurredDateTime)); + jsonWriter.writeStringField("propertyCausingError", this.propertyCausingError); + jsonWriter.writeStringField("value", this.value); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnPremisesProvisioningError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnPremisesProvisioningError 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 MicrosoftGraphOnPremisesProvisioningError. + */ + public static MicrosoftGraphOnPremisesProvisioningError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnPremisesProvisioningError deserializedMicrosoftGraphOnPremisesProvisioningError + = new MicrosoftGraphOnPremisesProvisioningError(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesProvisioningError.category = reader.getString(); + } else if ("occurredDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesProvisioningError.occurredDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("propertyCausingError".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesProvisioningError.propertyCausingError = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedMicrosoftGraphOnPremisesProvisioningError.value = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnPremisesProvisioningError.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnPremisesProvisioningError; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenote.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenote.java index a6af1a8faffbc..845ae04a18d19 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenote.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenote.java @@ -5,68 +5,66 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** onenote. */ +/** + * onenote. + */ @Fluent public final class MicrosoftGraphOnenote extends MicrosoftGraphEntity { /* * The collection of OneNote notebooks that are owned by the user or group. Read-only. Nullable. */ - @JsonProperty(value = "notebooks") private List notebooks; /* * The status of OneNote operations. Getting an operations collection is not supported, but you can get the status * of long-running operations if the Operation-Location header is returned in the response. Read-only. Nullable. */ - @JsonProperty(value = "operations") private List operations; /* - * The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable. + * The pages in all OneNote notebooks that are owned by the user or group. Read-only. Nullable. */ - @JsonProperty(value = "pages") private List pages; /* - * The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you - * can get the binary content of a specific resource. Read-only. Nullable. + * The image and other file resources in OneNote pages. Getting a resources collection is not supported, but you can + * get the binary content of a specific resource. Read-only. Nullable. */ - @JsonProperty(value = "resources") private List resources; /* - * The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable. + * The section groups in all OneNote notebooks that are owned by the user or group. Read-only. Nullable. */ - @JsonProperty(value = "sectionGroups") private List sectionGroups; /* - * The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable. + * The sections in all OneNote notebooks that are owned by the user or group. Read-only. Nullable. */ - @JsonProperty(value = "sections") private List sections; /* * onenote */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenote class. */ + /** + * Creates an instance of MicrosoftGraphOnenote class. + */ public MicrosoftGraphOnenote() { } /** * Get the notebooks property: The collection of OneNote notebooks that are owned by the user or group. Read-only. * Nullable. - * + * * @return the notebooks value. */ public List notebooks() { @@ -76,7 +74,7 @@ public List notebooks() { /** * Set the notebooks property: The collection of OneNote notebooks that are owned by the user or group. Read-only. * Nullable. - * + * * @param notebooks the notebooks value to set. * @return the MicrosoftGraphOnenote object itself. */ @@ -89,7 +87,7 @@ public MicrosoftGraphOnenote withNotebooks(List notebook * Get the operations property: The status of OneNote operations. Getting an operations collection is not supported, * but you can get the status of long-running operations if the Operation-Location header is returned in the * response. Read-only. Nullable. - * + * * @return the operations value. */ public List operations() { @@ -100,7 +98,7 @@ public List operations() { * Set the operations property: The status of OneNote operations. Getting an operations collection is not supported, * but you can get the status of long-running operations if the Operation-Location header is returned in the * response. Read-only. Nullable. - * + * * @param operations the operations value to set. * @return the MicrosoftGraphOnenote object itself. */ @@ -112,7 +110,7 @@ public MicrosoftGraphOnenote withOperations(List /** * Get the pages property: The pages in all OneNote notebooks that are owned by the user or group. Read-only. * Nullable. - * + * * @return the pages value. */ public List pages() { @@ -122,7 +120,7 @@ public List pages() { /** * Set the pages property: The pages in all OneNote notebooks that are owned by the user or group. Read-only. * Nullable. - * + * * @param pages the pages value to set. * @return the MicrosoftGraphOnenote object itself. */ @@ -134,7 +132,7 @@ public MicrosoftGraphOnenote withPages(List pages) { /** * Get the resources property: The image and other file resources in OneNote pages. Getting a resources collection * is not supported, but you can get the binary content of a specific resource. Read-only. Nullable. - * + * * @return the resources value. */ public List resources() { @@ -144,7 +142,7 @@ public List resources() { /** * Set the resources property: The image and other file resources in OneNote pages. Getting a resources collection * is not supported, but you can get the binary content of a specific resource. Read-only. Nullable. - * + * * @param resources the resources value to set. * @return the MicrosoftGraphOnenote object itself. */ @@ -156,7 +154,7 @@ public MicrosoftGraphOnenote withResources(List r /** * Get the sectionGroups property: The section groups in all OneNote notebooks that are owned by the user or group. * Read-only. Nullable. - * + * * @return the sectionGroups value. */ public List sectionGroups() { @@ -166,7 +164,7 @@ public List sectionGroups() { /** * Set the sectionGroups property: The section groups in all OneNote notebooks that are owned by the user or group. * Read-only. Nullable. - * + * * @param sectionGroups the sectionGroups value to set. * @return the MicrosoftGraphOnenote object itself. */ @@ -178,7 +176,7 @@ public MicrosoftGraphOnenote withSectionGroups(List /** * Get the sections property: The sections in all OneNote notebooks that are owned by the user or group. Read-only. * Nullable. - * + * * @return the sections value. */ public List sections() { @@ -188,7 +186,7 @@ public List sections() { /** * Set the sections property: The sections in all OneNote notebooks that are owned by the user or group. Read-only. * Nullable. - * + * * @param sections the sections value to set. * @return the MicrosoftGraphOnenote object itself. */ @@ -199,17 +197,16 @@ public MicrosoftGraphOnenote withSections(List sec /** * Get the additionalProperties property: onenote. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenote. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenote object itself. */ @@ -218,15 +215,9 @@ public MicrosoftGraphOnenote withAdditionalProperties(Map additi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenote withId(String id) { super.withId(id); @@ -235,7 +226,7 @@ public MicrosoftGraphOnenote withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -260,4 +251,81 @@ public void validate() { sections().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("notebooks", this.notebooks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("pages", this.pages, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("resources", this.resources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sectionGroups", this.sectionGroups, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sections", this.sections, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenote from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenote 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 MicrosoftGraphOnenote. + */ + public static MicrosoftGraphOnenote fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenote deserializedMicrosoftGraphOnenote = new MicrosoftGraphOnenote(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOnenote.withId(reader.getString()); + } else if ("notebooks".equals(fieldName)) { + List notebooks + = reader.readArray(reader1 -> MicrosoftGraphNotebook.fromJson(reader1)); + deserializedMicrosoftGraphOnenote.notebooks = notebooks; + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> MicrosoftGraphOnenoteOperation.fromJson(reader1)); + deserializedMicrosoftGraphOnenote.operations = operations; + } else if ("pages".equals(fieldName)) { + List pages + = reader.readArray(reader1 -> MicrosoftGraphOnenotePage.fromJson(reader1)); + deserializedMicrosoftGraphOnenote.pages = pages; + } else if ("resources".equals(fieldName)) { + List resources + = reader.readArray(reader1 -> MicrosoftGraphOnenoteResource.fromJson(reader1)); + deserializedMicrosoftGraphOnenote.resources = resources; + } else if ("sectionGroups".equals(fieldName)) { + List sectionGroups + = reader.readArray(reader1 -> MicrosoftGraphSectionGroup.fromJson(reader1)); + deserializedMicrosoftGraphOnenote.sectionGroups = sectionGroups; + } else if ("sections".equals(fieldName)) { + List sections + = reader.readArray(reader1 -> MicrosoftGraphOnenoteSection.fromJson(reader1)); + deserializedMicrosoftGraphOnenote.sections = sections; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenote.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenote; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntityBaseModel.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntityBaseModel.java index 087d5f5e5f8c4..db13febaefecc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntityBaseModel.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntityBaseModel.java @@ -5,34 +5,37 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** onenoteEntityBaseModel. */ +/** + * onenoteEntityBaseModel. + */ @Fluent public class MicrosoftGraphOnenoteEntityBaseModel extends MicrosoftGraphEntity { /* * The endpoint where you can get details about the page. Read-only. */ - @JsonProperty(value = "self") private String self; /* * onenoteEntityBaseModel */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenoteEntityBaseModel class. */ + /** + * Creates an instance of MicrosoftGraphOnenoteEntityBaseModel class. + */ public MicrosoftGraphOnenoteEntityBaseModel() { } /** * Get the self property: The endpoint where you can get details about the page. Read-only. - * + * * @return the self value. */ public String self() { @@ -41,7 +44,7 @@ public String self() { /** * Set the self property: The endpoint where you can get details about the page. Read-only. - * + * * @param self the self value to set. * @return the MicrosoftGraphOnenoteEntityBaseModel object itself. */ @@ -52,17 +55,16 @@ public MicrosoftGraphOnenoteEntityBaseModel withSelf(String self) { /** * Get the additionalProperties property: onenoteEntityBaseModel. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenoteEntityBaseModel. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenoteEntityBaseModel object itself. */ @@ -71,15 +73,9 @@ public MicrosoftGraphOnenoteEntityBaseModel withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteEntityBaseModel withId(String id) { super.withId(id); @@ -88,11 +84,62 @@ public MicrosoftGraphOnenoteEntityBaseModel withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("self", this.self); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenoteEntityBaseModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenoteEntityBaseModel 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 MicrosoftGraphOnenoteEntityBaseModel. + */ + public static MicrosoftGraphOnenoteEntityBaseModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenoteEntityBaseModel deserializedMicrosoftGraphOnenoteEntityBaseModel + = new MicrosoftGraphOnenoteEntityBaseModel(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntityBaseModel.withId(reader.getString()); + } else if ("self".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntityBaseModel.self = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenoteEntityBaseModel.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenoteEntityBaseModel; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntityHierarchyModel.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntityHierarchyModel.java index 8372760a8bf93..e62fb009fc99c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntityHierarchyModel.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntityHierarchyModel.java @@ -5,33 +5,34 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** onenoteEntityHierarchyModel. */ +/** + * onenoteEntityHierarchyModel. + */ @Fluent public class MicrosoftGraphOnenoteEntityHierarchyModel extends MicrosoftGraphOnenoteEntitySchemaObjectModel { /* * identitySet */ - @JsonProperty(value = "createdBy") private MicrosoftGraphIdentitySet createdBy; /* * The name of the notebook. */ - @JsonProperty(value = "displayName") private String displayName; /* * identitySet */ - @JsonProperty(value = "lastModifiedBy") private MicrosoftGraphIdentitySet lastModifiedBy; /* @@ -39,21 +40,22 @@ public class MicrosoftGraphOnenoteEntityHierarchyModel extends MicrosoftGraphOne * ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. Read-only. */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * onenoteEntityHierarchyModel */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenoteEntityHierarchyModel class. */ + /** + * Creates an instance of MicrosoftGraphOnenoteEntityHierarchyModel class. + */ public MicrosoftGraphOnenoteEntityHierarchyModel() { } /** * Get the createdBy property: identitySet. - * + * * @return the createdBy value. */ public MicrosoftGraphIdentitySet createdBy() { @@ -62,7 +64,7 @@ public MicrosoftGraphIdentitySet createdBy() { /** * Set the createdBy property: identitySet. - * + * * @param createdBy the createdBy value to set. * @return the MicrosoftGraphOnenoteEntityHierarchyModel object itself. */ @@ -73,7 +75,7 @@ public MicrosoftGraphOnenoteEntityHierarchyModel withCreatedBy(MicrosoftGraphIde /** * Get the displayName property: The name of the notebook. - * + * * @return the displayName value. */ public String displayName() { @@ -82,7 +84,7 @@ public String displayName() { /** * Set the displayName property: The name of the notebook. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphOnenoteEntityHierarchyModel object itself. */ @@ -93,7 +95,7 @@ public MicrosoftGraphOnenoteEntityHierarchyModel withDisplayName(String displayN /** * Get the lastModifiedBy property: identitySet. - * + * * @return the lastModifiedBy value. */ public MicrosoftGraphIdentitySet lastModifiedBy() { @@ -102,7 +104,7 @@ public MicrosoftGraphIdentitySet lastModifiedBy() { /** * Set the lastModifiedBy property: identitySet. - * + * * @param lastModifiedBy the lastModifiedBy value to set. * @return the MicrosoftGraphOnenoteEntityHierarchyModel object itself. */ @@ -115,7 +117,7 @@ public MicrosoftGraphOnenoteEntityHierarchyModel withLastModifiedBy(MicrosoftGra * Get the lastModifiedDateTime property: The date and time when the notebook was last modified. The timestamp * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -126,7 +128,7 @@ public OffsetDateTime lastModifiedDateTime() { * Set the lastModifiedDateTime property: The date and time when the notebook was last modified. The timestamp * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphOnenoteEntityHierarchyModel object itself. */ @@ -137,49 +139,46 @@ public MicrosoftGraphOnenoteEntityHierarchyModel withLastModifiedDateTime(Offset /** * Get the additionalProperties property: onenoteEntityHierarchyModel. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenoteEntityHierarchyModel. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenoteEntityHierarchyModel object itself. */ - public MicrosoftGraphOnenoteEntityHierarchyModel withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphOnenoteEntityHierarchyModel + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteEntityHierarchyModel withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteEntityHierarchyModel withSelf(String self) { super.withSelf(self); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteEntityHierarchyModel withId(String id) { super.withId(id); @@ -188,7 +187,7 @@ public MicrosoftGraphOnenoteEntityHierarchyModel withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -201,4 +200,78 @@ public void validate() { lastModifiedBy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("self", self()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeJsonField("createdBy", this.createdBy); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeJsonField("lastModifiedBy", this.lastModifiedBy); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenoteEntityHierarchyModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenoteEntityHierarchyModel 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 MicrosoftGraphOnenoteEntityHierarchyModel. + */ + public static MicrosoftGraphOnenoteEntityHierarchyModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenoteEntityHierarchyModel deserializedMicrosoftGraphOnenoteEntityHierarchyModel + = new MicrosoftGraphOnenoteEntityHierarchyModel(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntityHierarchyModel.withId(reader.getString()); + } else if ("self".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntityHierarchyModel.withSelf(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntityHierarchyModel.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntityHierarchyModel.createdBy + = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntityHierarchyModel.displayName = reader.getString(); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntityHierarchyModel.lastModifiedBy + = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntityHierarchyModel.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenoteEntityHierarchyModel.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenoteEntityHierarchyModel; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntitySchemaObjectModel.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntitySchemaObjectModel.java index 081809cb98fa2..e386f535d9f61 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntitySchemaObjectModel.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteEntitySchemaObjectModel.java @@ -5,15 +5,19 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** onenoteEntitySchemaObjectModel. */ +/** + * onenoteEntitySchemaObjectModel. + */ @Fluent public class MicrosoftGraphOnenoteEntitySchemaObjectModel extends MicrosoftGraphOnenoteEntityBaseModel { /* @@ -21,15 +25,16 @@ public class MicrosoftGraphOnenoteEntitySchemaObjectModel extends MicrosoftGraph * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. Read-only. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * onenoteEntitySchemaObjectModel */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenoteEntitySchemaObjectModel class. */ + /** + * Creates an instance of MicrosoftGraphOnenoteEntitySchemaObjectModel class. + */ public MicrosoftGraphOnenoteEntitySchemaObjectModel() { } @@ -37,7 +42,7 @@ public MicrosoftGraphOnenoteEntitySchemaObjectModel() { * Get the createdDateTime property: The date and time when the page was created. The timestamp represents date and * time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would * look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -48,7 +53,7 @@ public OffsetDateTime createdDateTime() { * Set the createdDateTime property: The date and time when the page was created. The timestamp represents date and * time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would * look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphOnenoteEntitySchemaObjectModel object itself. */ @@ -59,42 +64,37 @@ public MicrosoftGraphOnenoteEntitySchemaObjectModel withCreatedDateTime(OffsetDa /** * Get the additionalProperties property: onenoteEntitySchemaObjectModel. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenoteEntitySchemaObjectModel. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenoteEntitySchemaObjectModel object itself. */ - public MicrosoftGraphOnenoteEntitySchemaObjectModel withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphOnenoteEntitySchemaObjectModel + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteEntitySchemaObjectModel withSelf(String self) { super.withSelf(self); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteEntitySchemaObjectModel withId(String id) { super.withId(id); @@ -103,11 +103,67 @@ public MicrosoftGraphOnenoteEntitySchemaObjectModel withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("self", self()); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenoteEntitySchemaObjectModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenoteEntitySchemaObjectModel 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 MicrosoftGraphOnenoteEntitySchemaObjectModel. + */ + public static MicrosoftGraphOnenoteEntitySchemaObjectModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenoteEntitySchemaObjectModel deserializedMicrosoftGraphOnenoteEntitySchemaObjectModel + = new MicrosoftGraphOnenoteEntitySchemaObjectModel(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntitySchemaObjectModel.withId(reader.getString()); + } else if ("self".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntitySchemaObjectModel.withSelf(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteEntitySchemaObjectModel.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenoteEntitySchemaObjectModel.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenoteEntitySchemaObjectModel; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteOperation.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteOperation.java index 2692bd1cc6c33..8c0e625ac1175 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteOperation.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteOperation.java @@ -5,53 +5,55 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** onenoteOperation. */ +/** + * onenoteOperation. + */ @Fluent public final class MicrosoftGraphOnenoteOperation extends MicrosoftGraphOperation { /* * onenoteOperationError */ - @JsonProperty(value = "error") private MicrosoftGraphOnenoteOperationError error; /* * The operation percent complete if the operation is still in running status */ - @JsonProperty(value = "percentComplete") private String percentComplete; /* * The resource id. */ - @JsonProperty(value = "resourceId") private String resourceId; /* * The resource URI for the object. For example, the resource URI for a copied page or section. */ - @JsonProperty(value = "resourceLocation") private String resourceLocation; /* * onenoteOperation */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenoteOperation class. */ + /** + * Creates an instance of MicrosoftGraphOnenoteOperation class. + */ public MicrosoftGraphOnenoteOperation() { } /** * Get the error property: onenoteOperationError. - * + * * @return the error value. */ public MicrosoftGraphOnenoteOperationError error() { @@ -60,7 +62,7 @@ public MicrosoftGraphOnenoteOperationError error() { /** * Set the error property: onenoteOperationError. - * + * * @param error the error value to set. * @return the MicrosoftGraphOnenoteOperation object itself. */ @@ -71,7 +73,7 @@ public MicrosoftGraphOnenoteOperation withError(MicrosoftGraphOnenoteOperationEr /** * Get the percentComplete property: The operation percent complete if the operation is still in running status. - * + * * @return the percentComplete value. */ public String percentComplete() { @@ -80,7 +82,7 @@ public String percentComplete() { /** * Set the percentComplete property: The operation percent complete if the operation is still in running status. - * + * * @param percentComplete the percentComplete value to set. * @return the MicrosoftGraphOnenoteOperation object itself. */ @@ -91,7 +93,7 @@ public MicrosoftGraphOnenoteOperation withPercentComplete(String percentComplete /** * Get the resourceId property: The resource id. - * + * * @return the resourceId value. */ public String resourceId() { @@ -100,7 +102,7 @@ public String resourceId() { /** * Set the resourceId property: The resource id. - * + * * @param resourceId the resourceId value to set. * @return the MicrosoftGraphOnenoteOperation object itself. */ @@ -112,7 +114,7 @@ public MicrosoftGraphOnenoteOperation withResourceId(String resourceId) { /** * Get the resourceLocation property: The resource URI for the object. For example, the resource URI for a copied * page or section. - * + * * @return the resourceLocation value. */ public String resourceLocation() { @@ -122,7 +124,7 @@ public String resourceLocation() { /** * Set the resourceLocation property: The resource URI for the object. For example, the resource URI for a copied * page or section. - * + * * @param resourceLocation the resourceLocation value to set. * @return the MicrosoftGraphOnenoteOperation object itself. */ @@ -133,17 +135,16 @@ public MicrosoftGraphOnenoteOperation withResourceLocation(String resourceLocati /** * Get the additionalProperties property: onenoteOperation. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenoteOperation. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenoteOperation object itself. */ @@ -152,36 +153,36 @@ public MicrosoftGraphOnenoteOperation withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteOperation withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteOperation withLastActionDateTime(OffsetDateTime lastActionDateTime) { super.withLastActionDateTime(lastActionDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteOperation withStatus(MicrosoftGraphOperationStatus status) { super.withStatus(status); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteOperation withId(String id) { super.withId(id); @@ -190,7 +191,7 @@ public MicrosoftGraphOnenoteOperation withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -200,4 +201,79 @@ public void validate() { error().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeStringField("lastActionDateTime", + lastActionDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastActionDateTime())); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeStringField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("resourceLocation", this.resourceLocation); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenoteOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenoteOperation 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 MicrosoftGraphOnenoteOperation. + */ + public static MicrosoftGraphOnenoteOperation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenoteOperation deserializedMicrosoftGraphOnenoteOperation + = new MicrosoftGraphOnenoteOperation(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteOperation.withId(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteOperation.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastActionDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteOperation.withLastActionDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("status".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteOperation + .withStatus(MicrosoftGraphOperationStatus.fromString(reader.getString())); + } else if ("error".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteOperation.error + = MicrosoftGraphOnenoteOperationError.fromJson(reader); + } else if ("percentComplete".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteOperation.percentComplete = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteOperation.resourceId = reader.getString(); + } else if ("resourceLocation".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteOperation.resourceLocation = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenoteOperation.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenoteOperation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteOperationError.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteOperationError.java index 95911555d455f..99297f5fd5684 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteOperationError.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteOperationError.java @@ -5,40 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** onenoteOperationError. */ +/** + * onenoteOperationError. + */ @Fluent -public final class MicrosoftGraphOnenoteOperationError { +public final class MicrosoftGraphOnenoteOperationError + implements JsonSerializable { /* * The error code. */ - @JsonProperty(value = "code") private String code; /* * The error message. */ - @JsonProperty(value = "message") private String message; /* * onenoteOperationError */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenoteOperationError class. */ + /** + * Creates an instance of MicrosoftGraphOnenoteOperationError class. + */ public MicrosoftGraphOnenoteOperationError() { } /** * Get the code property: The error code. - * + * * @return the code value. */ public String code() { @@ -47,7 +51,7 @@ public String code() { /** * Set the code property: The error code. - * + * * @param code the code value to set. * @return the MicrosoftGraphOnenoteOperationError object itself. */ @@ -58,7 +62,7 @@ public MicrosoftGraphOnenoteOperationError withCode(String code) { /** * Get the message property: The error message. - * + * * @return the message value. */ public String message() { @@ -67,7 +71,7 @@ public String message() { /** * Set the message property: The error message. - * + * * @param message the message value to set. * @return the MicrosoftGraphOnenoteOperationError object itself. */ @@ -78,17 +82,16 @@ public MicrosoftGraphOnenoteOperationError withMessage(String message) { /** * Get the additionalProperties property: onenoteOperationError. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenoteOperationError. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenoteOperationError object itself. */ @@ -97,19 +100,62 @@ public MicrosoftGraphOnenoteOperationError withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenoteOperationError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenoteOperationError 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 MicrosoftGraphOnenoteOperationError. + */ + public static MicrosoftGraphOnenoteOperationError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenoteOperationError deserializedMicrosoftGraphOnenoteOperationError + = new MicrosoftGraphOnenoteOperationError(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteOperationError.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteOperationError.message = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenoteOperationError.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenoteOperationError; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePage.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePage.java index dd46934fb5b73..d461fcf97967e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePage.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePage.java @@ -7,16 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.Base64Url; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -/** onenotePage. */ +/** + * onenotePage. + */ @Fluent public final class MicrosoftGraphOnenotePage extends MicrosoftGraphOnenoteEntitySchemaObjectModel { private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; @@ -24,19 +28,16 @@ public final class MicrosoftGraphOnenotePage extends MicrosoftGraphOnenoteEntity /* * The page's HTML content. */ - @JsonProperty(value = "content") private Base64Url content; /* - * The URL for the page's HTML content. Read-only. + * The URL for the page's HTML content. Read-only. */ - @JsonProperty(value = "contentUrl") private String contentUrl; /* * The unique identifier of the application that created the page. Read-only. */ - @JsonProperty(value = "createdByAppId") private String createdByAppId; /* @@ -44,63 +45,57 @@ public final class MicrosoftGraphOnenotePage extends MicrosoftGraphOnenoteEntity * 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. Read-only. */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * The indentation level of the page. Read-only. */ - @JsonProperty(value = "level") private Integer level; /* * pageLinks */ - @JsonProperty(value = "links") private MicrosoftGraphPageLinks links; /* * The order of the page within its parent section. Read-only. */ - @JsonProperty(value = "order") private Integer order; /* * The title of the page. */ - @JsonProperty(value = "title") private String title; /* * The userTags property. */ - @JsonProperty(value = "userTags") private List userTags; /* * notebook */ - @JsonProperty(value = "parentNotebook") private MicrosoftGraphNotebook parentNotebook; /* * onenoteSection */ - @JsonProperty(value = "parentSection") private MicrosoftGraphOnenoteSection parentSection; /* * onenotePage */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenotePage class. */ + /** + * Creates an instance of MicrosoftGraphOnenotePage class. + */ public MicrosoftGraphOnenotePage() { } /** * Get the content property: The page's HTML content. - * + * * @return the content value. */ public byte[] content() { @@ -112,7 +107,7 @@ public byte[] content() { /** * Set the content property: The page's HTML content. - * + * * @param content the content value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -127,7 +122,7 @@ public MicrosoftGraphOnenotePage withContent(byte[] content) { /** * Get the contentUrl property: The URL for the page's HTML content. Read-only. - * + * * @return the contentUrl value. */ public String contentUrl() { @@ -136,7 +131,7 @@ public String contentUrl() { /** * Set the contentUrl property: The URL for the page's HTML content. Read-only. - * + * * @param contentUrl the contentUrl value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -147,7 +142,7 @@ public MicrosoftGraphOnenotePage withContentUrl(String contentUrl) { /** * Get the createdByAppId property: The unique identifier of the application that created the page. Read-only. - * + * * @return the createdByAppId value. */ public String createdByAppId() { @@ -156,7 +151,7 @@ public String createdByAppId() { /** * Set the createdByAppId property: The unique identifier of the application that created the page. Read-only. - * + * * @param createdByAppId the createdByAppId value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -169,7 +164,7 @@ public MicrosoftGraphOnenotePage withCreatedByAppId(String createdByAppId) { * Get the lastModifiedDateTime property: The date and time when the page was last modified. The timestamp * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -180,7 +175,7 @@ public OffsetDateTime lastModifiedDateTime() { * Set the lastModifiedDateTime property: The date and time when the page was last modified. The timestamp * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -191,7 +186,7 @@ public MicrosoftGraphOnenotePage withLastModifiedDateTime(OffsetDateTime lastMod /** * Get the level property: The indentation level of the page. Read-only. - * + * * @return the level value. */ public Integer level() { @@ -200,7 +195,7 @@ public Integer level() { /** * Set the level property: The indentation level of the page. Read-only. - * + * * @param level the level value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -211,7 +206,7 @@ public MicrosoftGraphOnenotePage withLevel(Integer level) { /** * Get the links property: pageLinks. - * + * * @return the links value. */ public MicrosoftGraphPageLinks links() { @@ -220,7 +215,7 @@ public MicrosoftGraphPageLinks links() { /** * Set the links property: pageLinks. - * + * * @param links the links value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -231,7 +226,7 @@ public MicrosoftGraphOnenotePage withLinks(MicrosoftGraphPageLinks links) { /** * Get the order property: The order of the page within its parent section. Read-only. - * + * * @return the order value. */ public Integer order() { @@ -240,7 +235,7 @@ public Integer order() { /** * Set the order property: The order of the page within its parent section. Read-only. - * + * * @param order the order value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -251,7 +246,7 @@ public MicrosoftGraphOnenotePage withOrder(Integer order) { /** * Get the title property: The title of the page. - * + * * @return the title value. */ public String title() { @@ -260,7 +255,7 @@ public String title() { /** * Set the title property: The title of the page. - * + * * @param title the title value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -271,7 +266,7 @@ public MicrosoftGraphOnenotePage withTitle(String title) { /** * Get the userTags property: The userTags property. - * + * * @return the userTags value. */ public List userTags() { @@ -280,7 +275,7 @@ public List userTags() { /** * Set the userTags property: The userTags property. - * + * * @param userTags the userTags value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -291,7 +286,7 @@ public MicrosoftGraphOnenotePage withUserTags(List userTags) { /** * Get the parentNotebook property: notebook. - * + * * @return the parentNotebook value. */ public MicrosoftGraphNotebook parentNotebook() { @@ -300,7 +295,7 @@ public MicrosoftGraphNotebook parentNotebook() { /** * Set the parentNotebook property: notebook. - * + * * @param parentNotebook the parentNotebook value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -311,7 +306,7 @@ public MicrosoftGraphOnenotePage withParentNotebook(MicrosoftGraphNotebook paren /** * Get the parentSection property: onenoteSection. - * + * * @return the parentSection value. */ public MicrosoftGraphOnenoteSection parentSection() { @@ -320,7 +315,7 @@ public MicrosoftGraphOnenoteSection parentSection() { /** * Set the parentSection property: onenoteSection. - * + * * @param parentSection the parentSection value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -331,17 +326,16 @@ public MicrosoftGraphOnenotePage withParentSection(MicrosoftGraphOnenoteSection /** * Get the additionalProperties property: onenotePage. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenotePage. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenotePage object itself. */ @@ -350,29 +344,27 @@ public MicrosoftGraphOnenotePage withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenotePage withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenotePage withSelf(String self) { super.withSelf(self); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenotePage withId(String id) { super.withId(id); @@ -381,7 +373,7 @@ public MicrosoftGraphOnenotePage withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -397,4 +389,98 @@ public void validate() { parentSection().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("self", self()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeStringField("content", Objects.toString(this.content, null)); + jsonWriter.writeStringField("contentUrl", this.contentUrl); + jsonWriter.writeStringField("createdByAppId", this.createdByAppId); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + jsonWriter.writeNumberField("level", this.level); + jsonWriter.writeJsonField("links", this.links); + jsonWriter.writeNumberField("order", this.order); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeArrayField("userTags", this.userTags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("parentNotebook", this.parentNotebook); + jsonWriter.writeJsonField("parentSection", this.parentSection); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenotePage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenotePage 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 MicrosoftGraphOnenotePage. + */ + public static MicrosoftGraphOnenotePage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenotePage deserializedMicrosoftGraphOnenotePage = new MicrosoftGraphOnenotePage(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.withId(reader.getString()); + } else if ("self".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.withSelf(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("content".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.content + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("contentUrl".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.contentUrl = reader.getString(); + } else if ("createdByAppId".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.createdByAppId = reader.getString(); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("level".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.level = reader.getNullable(JsonReader::getInt); + } else if ("links".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.links = MicrosoftGraphPageLinks.fromJson(reader); + } else if ("order".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.order = reader.getNullable(JsonReader::getInt); + } else if ("title".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.title = reader.getString(); + } else if ("userTags".equals(fieldName)) { + List userTags = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphOnenotePage.userTags = userTags; + } else if ("parentNotebook".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.parentNotebook = MicrosoftGraphNotebook.fromJson(reader); + } else if ("parentSection".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePage.parentSection = MicrosoftGraphOnenoteSection.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenotePage.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenotePage; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePagePreview.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePagePreview.java index e38d51a404db8..c7c228fe2b79d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePagePreview.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePagePreview.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** onenotePagePreview. */ +/** + * onenotePagePreview. + */ @Fluent -public final class MicrosoftGraphOnenotePagePreview { +public final class MicrosoftGraphOnenotePagePreview implements JsonSerializable { /* * onenotePagePreviewLinks */ - @JsonProperty(value = "links") private MicrosoftGraphOnenotePagePreviewLinks links; /* * The previewText property. */ - @JsonProperty(value = "previewText") private String previewText; /* * onenotePagePreview */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenotePagePreview class. */ + /** + * Creates an instance of MicrosoftGraphOnenotePagePreview class. + */ public MicrosoftGraphOnenotePagePreview() { } /** * Get the links property: onenotePagePreviewLinks. - * + * * @return the links value. */ public MicrosoftGraphOnenotePagePreviewLinks links() { @@ -47,7 +50,7 @@ public MicrosoftGraphOnenotePagePreviewLinks links() { /** * Set the links property: onenotePagePreviewLinks. - * + * * @param links the links value to set. * @return the MicrosoftGraphOnenotePagePreview object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphOnenotePagePreview withLinks(MicrosoftGraphOnenotePagePrevi /** * Get the previewText property: The previewText property. - * + * * @return the previewText value. */ public String previewText() { @@ -67,7 +70,7 @@ public String previewText() { /** * Set the previewText property: The previewText property. - * + * * @param previewText the previewText value to set. * @return the MicrosoftGraphOnenotePagePreview object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphOnenotePagePreview withPreviewText(String previewText) { /** * Get the additionalProperties property: onenotePagePreview. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenotePagePreview. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenotePagePreview object itself. */ @@ -97,17 +99,9 @@ public MicrosoftGraphOnenotePagePreview withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -115,4 +109,56 @@ public void validate() { links().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("links", this.links); + jsonWriter.writeStringField("previewText", this.previewText); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenotePagePreview from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenotePagePreview 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 MicrosoftGraphOnenotePagePreview. + */ + public static MicrosoftGraphOnenotePagePreview fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenotePagePreview deserializedMicrosoftGraphOnenotePagePreview + = new MicrosoftGraphOnenotePagePreview(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("links".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePagePreview.links + = MicrosoftGraphOnenotePagePreviewLinks.fromJson(reader); + } else if ("previewText".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePagePreview.previewText = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenotePagePreview.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenotePagePreview; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePagePreviewLinks.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePagePreviewLinks.java index 2196505c6a13a..243790b980b69 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePagePreviewLinks.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePagePreviewLinks.java @@ -5,34 +5,39 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** onenotePagePreviewLinks. */ +/** + * onenotePagePreviewLinks. + */ @Fluent -public final class MicrosoftGraphOnenotePagePreviewLinks { +public final class MicrosoftGraphOnenotePagePreviewLinks + implements JsonSerializable { /* * externalLink */ - @JsonProperty(value = "previewImageUrl") private MicrosoftGraphExternalLink previewImageUrl; /* * onenotePagePreviewLinks */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenotePagePreviewLinks class. */ + /** + * Creates an instance of MicrosoftGraphOnenotePagePreviewLinks class. + */ public MicrosoftGraphOnenotePagePreviewLinks() { } /** * Get the previewImageUrl property: externalLink. - * + * * @return the previewImageUrl value. */ public MicrosoftGraphExternalLink previewImageUrl() { @@ -41,7 +46,7 @@ public MicrosoftGraphExternalLink previewImageUrl() { /** * Set the previewImageUrl property: externalLink. - * + * * @param previewImageUrl the previewImageUrl value to set. * @return the MicrosoftGraphOnenotePagePreviewLinks object itself. */ @@ -52,17 +57,16 @@ public MicrosoftGraphOnenotePagePreviewLinks withPreviewImageUrl(MicrosoftGraphE /** * Get the additionalProperties property: onenotePagePreviewLinks. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenotePagePreviewLinks. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenotePagePreviewLinks object itself. */ @@ -71,17 +75,9 @@ public MicrosoftGraphOnenotePagePreviewLinks withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -89,4 +85,53 @@ public void validate() { previewImageUrl().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("previewImageUrl", this.previewImageUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenotePagePreviewLinks from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenotePagePreviewLinks 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 MicrosoftGraphOnenotePagePreviewLinks. + */ + public static MicrosoftGraphOnenotePagePreviewLinks fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenotePagePreviewLinks deserializedMicrosoftGraphOnenotePagePreviewLinks + = new MicrosoftGraphOnenotePagePreviewLinks(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("previewImageUrl".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePagePreviewLinks.previewImageUrl + = MicrosoftGraphExternalLink.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenotePagePreviewLinks.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenotePagePreviewLinks; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchActionType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchActionType.java index eed63344c4a63..f43a0841e48c7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchActionType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchActionType.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** onenotePatchActionType. */ +/** + * onenotePatchActionType. + */ public final class MicrosoftGraphOnenotePatchActionType extends ExpandableStringEnum { - /** Static value Replace for MicrosoftGraphOnenotePatchActionType. */ + /** + * Static value Replace for MicrosoftGraphOnenotePatchActionType. + */ public static final MicrosoftGraphOnenotePatchActionType REPLACE = fromString("Replace"); - /** Static value Append for MicrosoftGraphOnenotePatchActionType. */ + /** + * Static value Append for MicrosoftGraphOnenotePatchActionType. + */ public static final MicrosoftGraphOnenotePatchActionType APPEND = fromString("Append"); - /** Static value Delete for MicrosoftGraphOnenotePatchActionType. */ + /** + * Static value Delete for MicrosoftGraphOnenotePatchActionType. + */ public static final MicrosoftGraphOnenotePatchActionType DELETE = fromString("Delete"); - /** Static value Insert for MicrosoftGraphOnenotePatchActionType. */ + /** + * Static value Insert for MicrosoftGraphOnenotePatchActionType. + */ public static final MicrosoftGraphOnenotePatchActionType INSERT = fromString("Insert"); - /** Static value Prepend for MicrosoftGraphOnenotePatchActionType. */ + /** + * Static value Prepend for MicrosoftGraphOnenotePatchActionType. + */ public static final MicrosoftGraphOnenotePatchActionType PREPEND = fromString("Prepend"); /** * Creates a new instance of MicrosoftGraphOnenotePatchActionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public MicrosoftGraphOnenotePatchActionType() { /** * Creates or finds a MicrosoftGraphOnenotePatchActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphOnenotePatchActionType. */ - @JsonCreator public static MicrosoftGraphOnenotePatchActionType fromString(String name) { return fromString(name, MicrosoftGraphOnenotePatchActionType.class); } /** * Gets known MicrosoftGraphOnenotePatchActionType values. - * + * * @return known MicrosoftGraphOnenotePatchActionType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchContentCommand.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchContentCommand.java index 9baf08b9c5481..be7211c96abf4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchContentCommand.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchContentCommand.java @@ -5,54 +5,55 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** onenotePatchContentCommand. */ +/** + * onenotePatchContentCommand. + */ @Fluent -public final class MicrosoftGraphOnenotePatchContentCommand { +public final class MicrosoftGraphOnenotePatchContentCommand + implements JsonSerializable { /* * onenotePatchActionType */ - @JsonProperty(value = "action") private MicrosoftGraphOnenotePatchActionType action; /* * A string of well-formed HTML to add to the page, and any image or file binary data. If the content contains * binary data, the request must be sent using the multipart/form-data content type with a 'Commands' part. */ - @JsonProperty(value = "content") private String content; /* * onenotePatchInsertPosition */ - @JsonProperty(value = "position") private MicrosoftGraphOnenotePatchInsertPosition position; /* - * The element to update. Must be the # or the generated of the element, or the body or title - * keyword. + * The element to update. Must be the # or the generated of the element, or the body or title keyword. */ - @JsonProperty(value = "target") private String target; /* * onenotePatchContentCommand */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenotePatchContentCommand class. */ + /** + * Creates an instance of MicrosoftGraphOnenotePatchContentCommand class. + */ public MicrosoftGraphOnenotePatchContentCommand() { } /** * Get the action property: onenotePatchActionType. - * + * * @return the action value. */ public MicrosoftGraphOnenotePatchActionType action() { @@ -61,7 +62,7 @@ public MicrosoftGraphOnenotePatchActionType action() { /** * Set the action property: onenotePatchActionType. - * + * * @param action the action value to set. * @return the MicrosoftGraphOnenotePatchContentCommand object itself. */ @@ -74,7 +75,7 @@ public MicrosoftGraphOnenotePatchContentCommand withAction(MicrosoftGraphOnenote * Get the content property: A string of well-formed HTML to add to the page, and any image or file binary data. If * the content contains binary data, the request must be sent using the multipart/form-data content type with a * 'Commands' part. - * + * * @return the content value. */ public String content() { @@ -85,7 +86,7 @@ public String content() { * Set the content property: A string of well-formed HTML to add to the page, and any image or file binary data. If * the content contains binary data, the request must be sent using the multipart/form-data content type with a * 'Commands' part. - * + * * @param content the content value to set. * @return the MicrosoftGraphOnenotePatchContentCommand object itself. */ @@ -96,7 +97,7 @@ public MicrosoftGraphOnenotePatchContentCommand withContent(String content) { /** * Get the position property: onenotePatchInsertPosition. - * + * * @return the position value. */ public MicrosoftGraphOnenotePatchInsertPosition position() { @@ -105,7 +106,7 @@ public MicrosoftGraphOnenotePatchInsertPosition position() { /** * Set the position property: onenotePatchInsertPosition. - * + * * @param position the position value to set. * @return the MicrosoftGraphOnenotePatchContentCommand object itself. */ @@ -117,7 +118,7 @@ public MicrosoftGraphOnenotePatchContentCommand withPosition(MicrosoftGraphOneno /** * Get the target property: The element to update. Must be the #<data-id> or the generated <id> of the * element, or the body or title keyword. - * + * * @return the target value. */ public String target() { @@ -127,7 +128,7 @@ public String target() { /** * Set the target property: The element to update. Must be the #<data-id> or the generated <id> of the * element, or the body or title keyword. - * + * * @param target the target value to set. * @return the MicrosoftGraphOnenotePatchContentCommand object itself. */ @@ -138,17 +139,16 @@ public MicrosoftGraphOnenotePatchContentCommand withTarget(String target) { /** * Get the additionalProperties property: onenotePatchContentCommand. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenotePatchContentCommand. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenotePatchContentCommand object itself. */ @@ -157,19 +157,70 @@ public MicrosoftGraphOnenotePatchContentCommand withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("position", this.position == null ? null : this.position.toString()); + jsonWriter.writeStringField("target", this.target); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenotePatchContentCommand from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenotePatchContentCommand 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 MicrosoftGraphOnenotePatchContentCommand. + */ + public static MicrosoftGraphOnenotePatchContentCommand fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenotePatchContentCommand deserializedMicrosoftGraphOnenotePatchContentCommand + = new MicrosoftGraphOnenotePatchContentCommand(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePatchContentCommand.action + = MicrosoftGraphOnenotePatchActionType.fromString(reader.getString()); + } else if ("content".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePatchContentCommand.content = reader.getString(); + } else if ("position".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePatchContentCommand.position + = MicrosoftGraphOnenotePatchInsertPosition.fromString(reader.getString()); + } else if ("target".equals(fieldName)) { + deserializedMicrosoftGraphOnenotePatchContentCommand.target = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenotePatchContentCommand.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenotePatchContentCommand; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchInsertPosition.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchInsertPosition.java index 303760a746bd8..6269a10dbe00a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchInsertPosition.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenotePatchInsertPosition.java @@ -5,21 +5,26 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** onenotePatchInsertPosition. */ +/** + * onenotePatchInsertPosition. + */ public final class MicrosoftGraphOnenotePatchInsertPosition extends ExpandableStringEnum { - /** Static value After for MicrosoftGraphOnenotePatchInsertPosition. */ + /** + * Static value After for MicrosoftGraphOnenotePatchInsertPosition. + */ public static final MicrosoftGraphOnenotePatchInsertPosition AFTER = fromString("After"); - /** Static value Before for MicrosoftGraphOnenotePatchInsertPosition. */ + /** + * Static value Before for MicrosoftGraphOnenotePatchInsertPosition. + */ public static final MicrosoftGraphOnenotePatchInsertPosition BEFORE = fromString("Before"); /** * Creates a new instance of MicrosoftGraphOnenotePatchInsertPosition value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +33,17 @@ public MicrosoftGraphOnenotePatchInsertPosition() { /** * Creates or finds a MicrosoftGraphOnenotePatchInsertPosition from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphOnenotePatchInsertPosition. */ - @JsonCreator public static MicrosoftGraphOnenotePatchInsertPosition fromString(String name) { return fromString(name, MicrosoftGraphOnenotePatchInsertPosition.class); } /** * Gets known MicrosoftGraphOnenotePatchInsertPosition values. - * + * * @return known MicrosoftGraphOnenotePatchInsertPosition values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteResource.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteResource.java index d764ab5ccddd3..643c387587815 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteResource.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteResource.java @@ -7,14 +7,17 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.Base64Url; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; -/** onenoteResource. */ +/** + * onenoteResource. + */ @Fluent public final class MicrosoftGraphOnenoteResource extends MicrosoftGraphOnenoteEntityBaseModel { private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; @@ -22,27 +25,27 @@ public final class MicrosoftGraphOnenoteResource extends MicrosoftGraphOnenoteEn /* * The content stream */ - @JsonProperty(value = "content") private Base64Url content; /* * The URL for downloading the content */ - @JsonProperty(value = "contentUrl") private String contentUrl; /* * onenoteResource */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenoteResource class. */ + /** + * Creates an instance of MicrosoftGraphOnenoteResource class. + */ public MicrosoftGraphOnenoteResource() { } /** * Get the content property: The content stream. - * + * * @return the content value. */ public byte[] content() { @@ -54,7 +57,7 @@ public byte[] content() { /** * Set the content property: The content stream. - * + * * @param content the content value to set. * @return the MicrosoftGraphOnenoteResource object itself. */ @@ -69,7 +72,7 @@ public MicrosoftGraphOnenoteResource withContent(byte[] content) { /** * Get the contentUrl property: The URL for downloading the content. - * + * * @return the contentUrl value. */ public String contentUrl() { @@ -78,7 +81,7 @@ public String contentUrl() { /** * Set the contentUrl property: The URL for downloading the content. - * + * * @param contentUrl the contentUrl value to set. * @return the MicrosoftGraphOnenoteResource object itself. */ @@ -89,17 +92,16 @@ public MicrosoftGraphOnenoteResource withContentUrl(String contentUrl) { /** * Get the additionalProperties property: onenoteResource. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenoteResource. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenoteResource object itself. */ @@ -108,22 +110,18 @@ public MicrosoftGraphOnenoteResource withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteResource withSelf(String self) { super.withSelf(self); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteResource withId(String id) { super.withId(id); @@ -132,11 +130,69 @@ public MicrosoftGraphOnenoteResource withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("self", self()); + jsonWriter.writeStringField("content", Objects.toString(this.content, null)); + jsonWriter.writeStringField("contentUrl", this.contentUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenoteResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenoteResource 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 MicrosoftGraphOnenoteResource. + */ + public static MicrosoftGraphOnenoteResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenoteResource deserializedMicrosoftGraphOnenoteResource + = new MicrosoftGraphOnenoteResource(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteResource.withId(reader.getString()); + } else if ("self".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteResource.withSelf(reader.getString()); + } else if ("content".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteResource.content + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("contentUrl".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteResource.contentUrl = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenoteResource.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenoteResource; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteSection.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteSection.java index d6a6e291912c8..6043d46cf8403 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteSection.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteSection.java @@ -5,66 +5,66 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** onenoteSection. */ +/** + * onenoteSection. + */ @Fluent public final class MicrosoftGraphOnenoteSection extends MicrosoftGraphOnenoteEntityHierarchyModel { /* * Indicates whether this is the user's default section. Read-only. */ - @JsonProperty(value = "isDefault") private Boolean isDefault; /* * sectionLinks */ - @JsonProperty(value = "links") private MicrosoftGraphSectionLinks links; /* * The pages endpoint where you can get details for all the pages in the section. Read-only. */ - @JsonProperty(value = "pagesUrl") private String pagesUrl; /* - * The collection of pages in the section. Read-only. Nullable. + * The collection of pages in the section. Read-only. Nullable. */ - @JsonProperty(value = "pages") private List pages; /* * notebook */ - @JsonProperty(value = "parentNotebook") private MicrosoftGraphNotebook parentNotebook; /* * sectionGroup */ - @JsonProperty(value = "parentSectionGroup") private MicrosoftGraphSectionGroup parentSectionGroup; /* * onenoteSection */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnenoteSection class. */ + /** + * Creates an instance of MicrosoftGraphOnenoteSection class. + */ public MicrosoftGraphOnenoteSection() { } /** * Get the isDefault property: Indicates whether this is the user's default section. Read-only. - * + * * @return the isDefault value. */ public Boolean isDefault() { @@ -73,7 +73,7 @@ public Boolean isDefault() { /** * Set the isDefault property: Indicates whether this is the user's default section. Read-only. - * + * * @param isDefault the isDefault value to set. * @return the MicrosoftGraphOnenoteSection object itself. */ @@ -84,7 +84,7 @@ public MicrosoftGraphOnenoteSection withIsDefault(Boolean isDefault) { /** * Get the links property: sectionLinks. - * + * * @return the links value. */ public MicrosoftGraphSectionLinks links() { @@ -93,7 +93,7 @@ public MicrosoftGraphSectionLinks links() { /** * Set the links property: sectionLinks. - * + * * @param links the links value to set. * @return the MicrosoftGraphOnenoteSection object itself. */ @@ -105,7 +105,7 @@ public MicrosoftGraphOnenoteSection withLinks(MicrosoftGraphSectionLinks links) /** * Get the pagesUrl property: The pages endpoint where you can get details for all the pages in the section. * Read-only. - * + * * @return the pagesUrl value. */ public String pagesUrl() { @@ -115,7 +115,7 @@ public String pagesUrl() { /** * Set the pagesUrl property: The pages endpoint where you can get details for all the pages in the section. * Read-only. - * + * * @param pagesUrl the pagesUrl value to set. * @return the MicrosoftGraphOnenoteSection object itself. */ @@ -126,7 +126,7 @@ public MicrosoftGraphOnenoteSection withPagesUrl(String pagesUrl) { /** * Get the pages property: The collection of pages in the section. Read-only. Nullable. - * + * * @return the pages value. */ public List pages() { @@ -135,7 +135,7 @@ public List pages() { /** * Set the pages property: The collection of pages in the section. Read-only. Nullable. - * + * * @param pages the pages value to set. * @return the MicrosoftGraphOnenoteSection object itself. */ @@ -146,7 +146,7 @@ public MicrosoftGraphOnenoteSection withPages(List pa /** * Get the parentNotebook property: notebook. - * + * * @return the parentNotebook value. */ public MicrosoftGraphNotebook parentNotebook() { @@ -155,7 +155,7 @@ public MicrosoftGraphNotebook parentNotebook() { /** * Set the parentNotebook property: notebook. - * + * * @param parentNotebook the parentNotebook value to set. * @return the MicrosoftGraphOnenoteSection object itself. */ @@ -166,7 +166,7 @@ public MicrosoftGraphOnenoteSection withParentNotebook(MicrosoftGraphNotebook pa /** * Get the parentSectionGroup property: sectionGroup. - * + * * @return the parentSectionGroup value. */ public MicrosoftGraphSectionGroup parentSectionGroup() { @@ -175,7 +175,7 @@ public MicrosoftGraphSectionGroup parentSectionGroup() { /** * Set the parentSectionGroup property: sectionGroup. - * + * * @param parentSectionGroup the parentSectionGroup value to set. * @return the MicrosoftGraphOnenoteSection object itself. */ @@ -186,17 +186,16 @@ public MicrosoftGraphOnenoteSection withParentSectionGroup(MicrosoftGraphSection /** * Get the additionalProperties property: onenoteSection. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onenoteSection. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnenoteSection object itself. */ @@ -205,57 +204,63 @@ public MicrosoftGraphOnenoteSection withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteSection withCreatedBy(MicrosoftGraphIdentitySet createdBy) { super.withCreatedBy(createdBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteSection withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteSection withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteSection withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteSection withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteSection withSelf(String self) { super.withSelf(self); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnenoteSection withId(String id) { super.withId(id); @@ -264,7 +269,7 @@ public MicrosoftGraphOnenoteSection withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -283,4 +288,97 @@ public void validate() { parentSectionGroup().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("self", self()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeJsonField("createdBy", createdBy()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeBooleanField("isDefault", this.isDefault); + jsonWriter.writeJsonField("links", this.links); + jsonWriter.writeStringField("pagesUrl", this.pagesUrl); + jsonWriter.writeArrayField("pages", this.pages, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("parentNotebook", this.parentNotebook); + jsonWriter.writeJsonField("parentSectionGroup", this.parentSectionGroup); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnenoteSection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnenoteSection 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 MicrosoftGraphOnenoteSection. + */ + public static MicrosoftGraphOnenoteSection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnenoteSection deserializedMicrosoftGraphOnenoteSection = new MicrosoftGraphOnenoteSection(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.withId(reader.getString()); + } else if ("self".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.withSelf(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.withCreatedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.withDisplayName(reader.getString()); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection + .withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("isDefault".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.isDefault = reader.getNullable(JsonReader::getBoolean); + } else if ("links".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.links = MicrosoftGraphSectionLinks.fromJson(reader); + } else if ("pagesUrl".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.pagesUrl = reader.getString(); + } else if ("pages".equals(fieldName)) { + List pages + = reader.readArray(reader1 -> MicrosoftGraphOnenotePage.fromJson(reader1)); + deserializedMicrosoftGraphOnenoteSection.pages = pages; + } else if ("parentNotebook".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.parentNotebook = MicrosoftGraphNotebook.fromJson(reader); + } else if ("parentSectionGroup".equals(fieldName)) { + deserializedMicrosoftGraphOnenoteSection.parentSectionGroup + = MicrosoftGraphSectionGroup.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnenoteSection.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnenoteSection; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteSourceService.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteSourceService.java index bfd28a9aca903..6a20fb05bafec 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteSourceService.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteSourceService.java @@ -5,27 +5,36 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** onenoteSourceService. */ +/** + * onenoteSourceService. + */ public final class MicrosoftGraphOnenoteSourceService extends ExpandableStringEnum { - /** Static value Unknown for MicrosoftGraphOnenoteSourceService. */ + /** + * Static value Unknown for MicrosoftGraphOnenoteSourceService. + */ public static final MicrosoftGraphOnenoteSourceService UNKNOWN = fromString("Unknown"); - /** Static value OneDrive for MicrosoftGraphOnenoteSourceService. */ + /** + * Static value OneDrive for MicrosoftGraphOnenoteSourceService. + */ public static final MicrosoftGraphOnenoteSourceService ONE_DRIVE = fromString("OneDrive"); - /** Static value OneDriveForBusiness for MicrosoftGraphOnenoteSourceService. */ + /** + * Static value OneDriveForBusiness for MicrosoftGraphOnenoteSourceService. + */ public static final MicrosoftGraphOnenoteSourceService ONE_DRIVE_FOR_BUSINESS = fromString("OneDriveForBusiness"); - /** Static value OnPremOneDriveForBusiness for MicrosoftGraphOnenoteSourceService. */ - public static final MicrosoftGraphOnenoteSourceService ON_PREM_ONE_DRIVE_FOR_BUSINESS = - fromString("OnPremOneDriveForBusiness"); + /** + * Static value OnPremOneDriveForBusiness for MicrosoftGraphOnenoteSourceService. + */ + public static final MicrosoftGraphOnenoteSourceService ON_PREM_ONE_DRIVE_FOR_BUSINESS + = fromString("OnPremOneDriveForBusiness"); /** * Creates a new instance of MicrosoftGraphOnenoteSourceService value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +43,17 @@ public MicrosoftGraphOnenoteSourceService() { /** * Creates or finds a MicrosoftGraphOnenoteSourceService from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphOnenoteSourceService. */ - @JsonCreator public static MicrosoftGraphOnenoteSourceService fromString(String name) { return fromString(name, MicrosoftGraphOnenoteSourceService.class); } /** * Gets known MicrosoftGraphOnenoteSourceService values. - * + * * @return known MicrosoftGraphOnenoteSourceService values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteUserRole.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteUserRole.java index eb725b0629203..3f373267964e9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteUserRole.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnenoteUserRole.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** onenoteUserRole. */ +/** + * onenoteUserRole. + */ public final class MicrosoftGraphOnenoteUserRole extends ExpandableStringEnum { - /** Static value None for MicrosoftGraphOnenoteUserRole. */ + /** + * Static value None for MicrosoftGraphOnenoteUserRole. + */ public static final MicrosoftGraphOnenoteUserRole NONE = fromString("None"); - /** Static value Owner for MicrosoftGraphOnenoteUserRole. */ + /** + * Static value Owner for MicrosoftGraphOnenoteUserRole. + */ public static final MicrosoftGraphOnenoteUserRole OWNER = fromString("Owner"); - /** Static value Contributor for MicrosoftGraphOnenoteUserRole. */ + /** + * Static value Contributor for MicrosoftGraphOnenoteUserRole. + */ public static final MicrosoftGraphOnenoteUserRole CONTRIBUTOR = fromString("Contributor"); - /** Static value Reader for MicrosoftGraphOnenoteUserRole. */ + /** + * Static value Reader for MicrosoftGraphOnenoteUserRole. + */ public static final MicrosoftGraphOnenoteUserRole READER = fromString("Reader"); /** * Creates a new instance of MicrosoftGraphOnenoteUserRole value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public MicrosoftGraphOnenoteUserRole() { /** * Creates or finds a MicrosoftGraphOnenoteUserRole from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphOnenoteUserRole. */ - @JsonCreator public static MicrosoftGraphOnenoteUserRole fromString(String name) { return fromString(name, MicrosoftGraphOnenoteUserRole.class); } /** * Gets known MicrosoftGraphOnenoteUserRole values. - * + * * @return known MicrosoftGraphOnenoteUserRole values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeeting.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeeting.java index f819a2a451dd8..6c1c4936da058 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeeting.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeeting.java @@ -5,113 +5,105 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** onlineMeeting. */ +/** + * onlineMeeting. + */ @Fluent public final class MicrosoftGraphOnlineMeeting extends MicrosoftGraphEntity { /* * onlineMeetingPresenters */ - @JsonProperty(value = "allowedPresenters") private MicrosoftGraphOnlineMeetingPresenters allowedPresenters; /* * audioConferencing */ - @JsonProperty(value = "audioConferencing") private MicrosoftGraphAudioConferencing audioConferencing; /* * chatInfo */ - @JsonProperty(value = "chatInfo") private MicrosoftGraphChatInfo chatInfo; /* * The meeting creation time in UTC. Read-only. */ - @JsonProperty(value = "creationDateTime") private OffsetDateTime creationDateTime; /* * The meeting end time in UTC. */ - @JsonProperty(value = "endDateTime") private OffsetDateTime endDateTime; /* * The externalId property. */ - @JsonProperty(value = "externalId") private String externalId; /* * Whether or not to announce when callers join or leave. */ - @JsonProperty(value = "isEntryExitAnnounced") private Boolean isEntryExitAnnounced; /* * itemBody */ - @JsonProperty(value = "joinInformation") private MicrosoftGraphItemBody joinInformation; /* * The join URL of the online meeting. Read-only. */ - @JsonProperty(value = "joinWebUrl") private String joinWebUrl; /* * lobbyBypassSettings */ - @JsonProperty(value = "lobbyBypassSettings") private MicrosoftGraphLobbyBypassSettings lobbyBypassSettings; /* * meetingParticipants */ - @JsonProperty(value = "participants") private MicrosoftGraphMeetingParticipants participants; /* * The meeting start time in UTC. */ - @JsonProperty(value = "startDateTime") private OffsetDateTime startDateTime; /* * The subject of the online meeting. */ - @JsonProperty(value = "subject") private String subject; /* * The video teleconferencing ID. Read-only. */ - @JsonProperty(value = "videoTeleconferenceId") private String videoTeleconferenceId; /* * onlineMeeting */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnlineMeeting class. */ + /** + * Creates an instance of MicrosoftGraphOnlineMeeting class. + */ public MicrosoftGraphOnlineMeeting() { } /** * Get the allowedPresenters property: onlineMeetingPresenters. - * + * * @return the allowedPresenters value. */ public MicrosoftGraphOnlineMeetingPresenters allowedPresenters() { @@ -120,7 +112,7 @@ public MicrosoftGraphOnlineMeetingPresenters allowedPresenters() { /** * Set the allowedPresenters property: onlineMeetingPresenters. - * + * * @param allowedPresenters the allowedPresenters value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -131,7 +123,7 @@ public MicrosoftGraphOnlineMeeting withAllowedPresenters(MicrosoftGraphOnlineMee /** * Get the audioConferencing property: audioConferencing. - * + * * @return the audioConferencing value. */ public MicrosoftGraphAudioConferencing audioConferencing() { @@ -140,7 +132,7 @@ public MicrosoftGraphAudioConferencing audioConferencing() { /** * Set the audioConferencing property: audioConferencing. - * + * * @param audioConferencing the audioConferencing value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -151,7 +143,7 @@ public MicrosoftGraphOnlineMeeting withAudioConferencing(MicrosoftGraphAudioConf /** * Get the chatInfo property: chatInfo. - * + * * @return the chatInfo value. */ public MicrosoftGraphChatInfo chatInfo() { @@ -160,7 +152,7 @@ public MicrosoftGraphChatInfo chatInfo() { /** * Set the chatInfo property: chatInfo. - * + * * @param chatInfo the chatInfo value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -171,7 +163,7 @@ public MicrosoftGraphOnlineMeeting withChatInfo(MicrosoftGraphChatInfo chatInfo) /** * Get the creationDateTime property: The meeting creation time in UTC. Read-only. - * + * * @return the creationDateTime value. */ public OffsetDateTime creationDateTime() { @@ -180,7 +172,7 @@ public OffsetDateTime creationDateTime() { /** * Set the creationDateTime property: The meeting creation time in UTC. Read-only. - * + * * @param creationDateTime the creationDateTime value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -191,7 +183,7 @@ public MicrosoftGraphOnlineMeeting withCreationDateTime(OffsetDateTime creationD /** * Get the endDateTime property: The meeting end time in UTC. - * + * * @return the endDateTime value. */ public OffsetDateTime endDateTime() { @@ -200,7 +192,7 @@ public OffsetDateTime endDateTime() { /** * Set the endDateTime property: The meeting end time in UTC. - * + * * @param endDateTime the endDateTime value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -211,7 +203,7 @@ public MicrosoftGraphOnlineMeeting withEndDateTime(OffsetDateTime endDateTime) { /** * Get the externalId property: The externalId property. - * + * * @return the externalId value. */ public String externalId() { @@ -220,7 +212,7 @@ public String externalId() { /** * Set the externalId property: The externalId property. - * + * * @param externalId the externalId value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -231,7 +223,7 @@ public MicrosoftGraphOnlineMeeting withExternalId(String externalId) { /** * Get the isEntryExitAnnounced property: Whether or not to announce when callers join or leave. - * + * * @return the isEntryExitAnnounced value. */ public Boolean isEntryExitAnnounced() { @@ -240,7 +232,7 @@ public Boolean isEntryExitAnnounced() { /** * Set the isEntryExitAnnounced property: Whether or not to announce when callers join or leave. - * + * * @param isEntryExitAnnounced the isEntryExitAnnounced value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -251,7 +243,7 @@ public MicrosoftGraphOnlineMeeting withIsEntryExitAnnounced(Boolean isEntryExitA /** * Get the joinInformation property: itemBody. - * + * * @return the joinInformation value. */ public MicrosoftGraphItemBody joinInformation() { @@ -260,7 +252,7 @@ public MicrosoftGraphItemBody joinInformation() { /** * Set the joinInformation property: itemBody. - * + * * @param joinInformation the joinInformation value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -271,7 +263,7 @@ public MicrosoftGraphOnlineMeeting withJoinInformation(MicrosoftGraphItemBody jo /** * Get the joinWebUrl property: The join URL of the online meeting. Read-only. - * + * * @return the joinWebUrl value. */ public String joinWebUrl() { @@ -280,7 +272,7 @@ public String joinWebUrl() { /** * Set the joinWebUrl property: The join URL of the online meeting. Read-only. - * + * * @param joinWebUrl the joinWebUrl value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -291,7 +283,7 @@ public MicrosoftGraphOnlineMeeting withJoinWebUrl(String joinWebUrl) { /** * Get the lobbyBypassSettings property: lobbyBypassSettings. - * + * * @return the lobbyBypassSettings value. */ public MicrosoftGraphLobbyBypassSettings lobbyBypassSettings() { @@ -300,7 +292,7 @@ public MicrosoftGraphLobbyBypassSettings lobbyBypassSettings() { /** * Set the lobbyBypassSettings property: lobbyBypassSettings. - * + * * @param lobbyBypassSettings the lobbyBypassSettings value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -311,7 +303,7 @@ public MicrosoftGraphOnlineMeeting withLobbyBypassSettings(MicrosoftGraphLobbyBy /** * Get the participants property: meetingParticipants. - * + * * @return the participants value. */ public MicrosoftGraphMeetingParticipants participants() { @@ -320,7 +312,7 @@ public MicrosoftGraphMeetingParticipants participants() { /** * Set the participants property: meetingParticipants. - * + * * @param participants the participants value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -331,7 +323,7 @@ public MicrosoftGraphOnlineMeeting withParticipants(MicrosoftGraphMeetingPartici /** * Get the startDateTime property: The meeting start time in UTC. - * + * * @return the startDateTime value. */ public OffsetDateTime startDateTime() { @@ -340,7 +332,7 @@ public OffsetDateTime startDateTime() { /** * Set the startDateTime property: The meeting start time in UTC. - * + * * @param startDateTime the startDateTime value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -351,7 +343,7 @@ public MicrosoftGraphOnlineMeeting withStartDateTime(OffsetDateTime startDateTim /** * Get the subject property: The subject of the online meeting. - * + * * @return the subject value. */ public String subject() { @@ -360,7 +352,7 @@ public String subject() { /** * Set the subject property: The subject of the online meeting. - * + * * @param subject the subject value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -371,7 +363,7 @@ public MicrosoftGraphOnlineMeeting withSubject(String subject) { /** * Get the videoTeleconferenceId property: The video teleconferencing ID. Read-only. - * + * * @return the videoTeleconferenceId value. */ public String videoTeleconferenceId() { @@ -380,7 +372,7 @@ public String videoTeleconferenceId() { /** * Set the videoTeleconferenceId property: The video teleconferencing ID. Read-only. - * + * * @param videoTeleconferenceId the videoTeleconferenceId value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -391,17 +383,16 @@ public MicrosoftGraphOnlineMeeting withVideoTeleconferenceId(String videoTelecon /** * Get the additionalProperties property: onlineMeeting. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onlineMeeting. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnlineMeeting object itself. */ @@ -410,15 +401,9 @@ public MicrosoftGraphOnlineMeeting withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOnlineMeeting withId(String id) { super.withId(id); @@ -427,7 +412,7 @@ public MicrosoftGraphOnlineMeeting withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -449,4 +434,107 @@ public void validate() { participants().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("allowedPresenters", + this.allowedPresenters == null ? null : this.allowedPresenters.toString()); + jsonWriter.writeJsonField("audioConferencing", this.audioConferencing); + jsonWriter.writeJsonField("chatInfo", this.chatInfo); + jsonWriter.writeStringField("creationDateTime", + this.creationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.creationDateTime)); + jsonWriter.writeStringField("endDateTime", + this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime)); + jsonWriter.writeStringField("externalId", this.externalId); + jsonWriter.writeBooleanField("isEntryExitAnnounced", this.isEntryExitAnnounced); + jsonWriter.writeJsonField("joinInformation", this.joinInformation); + jsonWriter.writeStringField("joinWebUrl", this.joinWebUrl); + jsonWriter.writeJsonField("lobbyBypassSettings", this.lobbyBypassSettings); + jsonWriter.writeJsonField("participants", this.participants); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + jsonWriter.writeStringField("subject", this.subject); + jsonWriter.writeStringField("videoTeleconferenceId", this.videoTeleconferenceId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnlineMeeting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnlineMeeting 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 MicrosoftGraphOnlineMeeting. + */ + public static MicrosoftGraphOnlineMeeting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnlineMeeting deserializedMicrosoftGraphOnlineMeeting = new MicrosoftGraphOnlineMeeting(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.withId(reader.getString()); + } else if ("allowedPresenters".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.allowedPresenters + = MicrosoftGraphOnlineMeetingPresenters.fromString(reader.getString()); + } else if ("audioConferencing".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.audioConferencing + = MicrosoftGraphAudioConferencing.fromJson(reader); + } else if ("chatInfo".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.chatInfo = MicrosoftGraphChatInfo.fromJson(reader); + } else if ("creationDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.creationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("externalId".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.externalId = reader.getString(); + } else if ("isEntryExitAnnounced".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.isEntryExitAnnounced + = reader.getNullable(JsonReader::getBoolean); + } else if ("joinInformation".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.joinInformation = MicrosoftGraphItemBody.fromJson(reader); + } else if ("joinWebUrl".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.joinWebUrl = reader.getString(); + } else if ("lobbyBypassSettings".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.lobbyBypassSettings + = MicrosoftGraphLobbyBypassSettings.fromJson(reader); + } else if ("participants".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.participants + = MicrosoftGraphMeetingParticipants.fromJson(reader); + } else if ("startDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("subject".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.subject = reader.getString(); + } else if ("videoTeleconferenceId".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeeting.videoTeleconferenceId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnlineMeeting.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnlineMeeting; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingInfo.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingInfo.java index df48ac774b048..c240dc3678c13 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingInfo.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingInfo.java @@ -5,66 +5,65 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** onlineMeetingInfo. */ +/** + * onlineMeetingInfo. + */ @Fluent -public final class MicrosoftGraphOnlineMeetingInfo { +public final class MicrosoftGraphOnlineMeetingInfo implements JsonSerializable { /* * The ID of the conference. */ - @JsonProperty(value = "conferenceId") private String conferenceId; /* * The external link that launches the online meeting. This is a URL that clients will launch into a browser and * will redirect the user to join the meeting. */ - @JsonProperty(value = "joinUrl") private String joinUrl; /* * All of the phone numbers associated with this conference. */ - @JsonProperty(value = "phones") private List phones; /* * The pre-formatted quickdial for this call. */ - @JsonProperty(value = "quickDial") private String quickDial; /* * The toll free numbers that can be used to join the conference. */ - @JsonProperty(value = "tollFreeNumbers") private List tollFreeNumbers; /* * The toll number that can be used to join the conference. */ - @JsonProperty(value = "tollNumber") private String tollNumber; /* * onlineMeetingInfo */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOnlineMeetingInfo class. */ + /** + * Creates an instance of MicrosoftGraphOnlineMeetingInfo class. + */ public MicrosoftGraphOnlineMeetingInfo() { } /** * Get the conferenceId property: The ID of the conference. - * + * * @return the conferenceId value. */ public String conferenceId() { @@ -73,7 +72,7 @@ public String conferenceId() { /** * Set the conferenceId property: The ID of the conference. - * + * * @param conferenceId the conferenceId value to set. * @return the MicrosoftGraphOnlineMeetingInfo object itself. */ @@ -85,7 +84,7 @@ public MicrosoftGraphOnlineMeetingInfo withConferenceId(String conferenceId) { /** * Get the joinUrl property: The external link that launches the online meeting. This is a URL that clients will * launch into a browser and will redirect the user to join the meeting. - * + * * @return the joinUrl value. */ public String joinUrl() { @@ -95,7 +94,7 @@ public String joinUrl() { /** * Set the joinUrl property: The external link that launches the online meeting. This is a URL that clients will * launch into a browser and will redirect the user to join the meeting. - * + * * @param joinUrl the joinUrl value to set. * @return the MicrosoftGraphOnlineMeetingInfo object itself. */ @@ -106,7 +105,7 @@ public MicrosoftGraphOnlineMeetingInfo withJoinUrl(String joinUrl) { /** * Get the phones property: All of the phone numbers associated with this conference. - * + * * @return the phones value. */ public List phones() { @@ -115,7 +114,7 @@ public List phones() { /** * Set the phones property: All of the phone numbers associated with this conference. - * + * * @param phones the phones value to set. * @return the MicrosoftGraphOnlineMeetingInfo object itself. */ @@ -126,7 +125,7 @@ public MicrosoftGraphOnlineMeetingInfo withPhones(List phon /** * Get the quickDial property: The pre-formatted quickdial for this call. - * + * * @return the quickDial value. */ public String quickDial() { @@ -135,7 +134,7 @@ public String quickDial() { /** * Set the quickDial property: The pre-formatted quickdial for this call. - * + * * @param quickDial the quickDial value to set. * @return the MicrosoftGraphOnlineMeetingInfo object itself. */ @@ -146,7 +145,7 @@ public MicrosoftGraphOnlineMeetingInfo withQuickDial(String quickDial) { /** * Get the tollFreeNumbers property: The toll free numbers that can be used to join the conference. - * + * * @return the tollFreeNumbers value. */ public List tollFreeNumbers() { @@ -155,7 +154,7 @@ public List tollFreeNumbers() { /** * Set the tollFreeNumbers property: The toll free numbers that can be used to join the conference. - * + * * @param tollFreeNumbers the tollFreeNumbers value to set. * @return the MicrosoftGraphOnlineMeetingInfo object itself. */ @@ -166,7 +165,7 @@ public MicrosoftGraphOnlineMeetingInfo withTollFreeNumbers(List tollFree /** * Get the tollNumber property: The toll number that can be used to join the conference. - * + * * @return the tollNumber value. */ public String tollNumber() { @@ -175,7 +174,7 @@ public String tollNumber() { /** * Set the tollNumber property: The toll number that can be used to join the conference. - * + * * @param tollNumber the tollNumber value to set. * @return the MicrosoftGraphOnlineMeetingInfo object itself. */ @@ -186,17 +185,16 @@ public MicrosoftGraphOnlineMeetingInfo withTollNumber(String tollNumber) { /** * Get the additionalProperties property: onlineMeetingInfo. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: onlineMeetingInfo. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOnlineMeetingInfo object itself. */ @@ -205,17 +203,9 @@ public MicrosoftGraphOnlineMeetingInfo withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -223,4 +213,71 @@ public void validate() { phones().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("conferenceId", this.conferenceId); + jsonWriter.writeStringField("joinUrl", this.joinUrl); + jsonWriter.writeArrayField("phones", this.phones, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("quickDial", this.quickDial); + jsonWriter.writeArrayField("tollFreeNumbers", this.tollFreeNumbers, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("tollNumber", this.tollNumber); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOnlineMeetingInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOnlineMeetingInfo 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 MicrosoftGraphOnlineMeetingInfo. + */ + public static MicrosoftGraphOnlineMeetingInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOnlineMeetingInfo deserializedMicrosoftGraphOnlineMeetingInfo + = new MicrosoftGraphOnlineMeetingInfo(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("conferenceId".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeetingInfo.conferenceId = reader.getString(); + } else if ("joinUrl".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeetingInfo.joinUrl = reader.getString(); + } else if ("phones".equals(fieldName)) { + List phones + = reader.readArray(reader1 -> MicrosoftGraphPhone.fromJson(reader1)); + deserializedMicrosoftGraphOnlineMeetingInfo.phones = phones; + } else if ("quickDial".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeetingInfo.quickDial = reader.getString(); + } else if ("tollFreeNumbers".equals(fieldName)) { + List tollFreeNumbers = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphOnlineMeetingInfo.tollFreeNumbers = tollFreeNumbers; + } else if ("tollNumber".equals(fieldName)) { + deserializedMicrosoftGraphOnlineMeetingInfo.tollNumber = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOnlineMeetingInfo.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOnlineMeetingInfo; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingPresenters.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingPresenters.java index 1679e006d1dc7..214a14a08fb23 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingPresenters.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingPresenters.java @@ -5,30 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** onlineMeetingPresenters. */ +/** + * onlineMeetingPresenters. + */ public final class MicrosoftGraphOnlineMeetingPresenters extends ExpandableStringEnum { - /** Static value everyone for MicrosoftGraphOnlineMeetingPresenters. */ + /** + * Static value everyone for MicrosoftGraphOnlineMeetingPresenters. + */ public static final MicrosoftGraphOnlineMeetingPresenters EVERYONE = fromString("everyone"); - /** Static value organization for MicrosoftGraphOnlineMeetingPresenters. */ + /** + * Static value organization for MicrosoftGraphOnlineMeetingPresenters. + */ public static final MicrosoftGraphOnlineMeetingPresenters ORGANIZATION = fromString("organization"); - /** Static value roleIsPresenter for MicrosoftGraphOnlineMeetingPresenters. */ + /** + * Static value roleIsPresenter for MicrosoftGraphOnlineMeetingPresenters. + */ public static final MicrosoftGraphOnlineMeetingPresenters ROLE_IS_PRESENTER = fromString("roleIsPresenter"); - /** Static value organizer for MicrosoftGraphOnlineMeetingPresenters. */ + /** + * Static value organizer for MicrosoftGraphOnlineMeetingPresenters. + */ public static final MicrosoftGraphOnlineMeetingPresenters ORGANIZER = fromString("organizer"); - /** Static value unknownFutureValue for MicrosoftGraphOnlineMeetingPresenters. */ + /** + * Static value unknownFutureValue for MicrosoftGraphOnlineMeetingPresenters. + */ public static final MicrosoftGraphOnlineMeetingPresenters UNKNOWN_FUTURE_VALUE = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphOnlineMeetingPresenters value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -37,18 +48,17 @@ public MicrosoftGraphOnlineMeetingPresenters() { /** * Creates or finds a MicrosoftGraphOnlineMeetingPresenters from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphOnlineMeetingPresenters. */ - @JsonCreator public static MicrosoftGraphOnlineMeetingPresenters fromString(String name) { return fromString(name, MicrosoftGraphOnlineMeetingPresenters.class); } /** * Gets known MicrosoftGraphOnlineMeetingPresenters values. - * + * * @return known MicrosoftGraphOnlineMeetingPresenters values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingProviderType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingProviderType.java index e2c69b723cf86..6cee5fbbd5172 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingProviderType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingProviderType.java @@ -5,27 +5,36 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** onlineMeetingProviderType. */ +/** + * onlineMeetingProviderType. + */ public final class MicrosoftGraphOnlineMeetingProviderType extends ExpandableStringEnum { - /** Static value unknown for MicrosoftGraphOnlineMeetingProviderType. */ + /** + * Static value unknown for MicrosoftGraphOnlineMeetingProviderType. + */ public static final MicrosoftGraphOnlineMeetingProviderType UNKNOWN = fromString("unknown"); - /** Static value skypeForBusiness for MicrosoftGraphOnlineMeetingProviderType. */ + /** + * Static value skypeForBusiness for MicrosoftGraphOnlineMeetingProviderType. + */ public static final MicrosoftGraphOnlineMeetingProviderType SKYPE_FOR_BUSINESS = fromString("skypeForBusiness"); - /** Static value skypeForConsumer for MicrosoftGraphOnlineMeetingProviderType. */ + /** + * Static value skypeForConsumer for MicrosoftGraphOnlineMeetingProviderType. + */ public static final MicrosoftGraphOnlineMeetingProviderType SKYPE_FOR_CONSUMER = fromString("skypeForConsumer"); - /** Static value teamsForBusiness for MicrosoftGraphOnlineMeetingProviderType. */ + /** + * Static value teamsForBusiness for MicrosoftGraphOnlineMeetingProviderType. + */ public static final MicrosoftGraphOnlineMeetingProviderType TEAMS_FOR_BUSINESS = fromString("teamsForBusiness"); /** * Creates a new instance of MicrosoftGraphOnlineMeetingProviderType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -34,18 +43,17 @@ public MicrosoftGraphOnlineMeetingProviderType() { /** * Creates or finds a MicrosoftGraphOnlineMeetingProviderType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphOnlineMeetingProviderType. */ - @JsonCreator public static MicrosoftGraphOnlineMeetingProviderType fromString(String name) { return fromString(name, MicrosoftGraphOnlineMeetingProviderType.class); } /** * Gets known MicrosoftGraphOnlineMeetingProviderType values. - * + * * @return known MicrosoftGraphOnlineMeetingProviderType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingRole.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingRole.java index 61b360ad48319..24d57e1b0e82f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingRole.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOnlineMeetingRole.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** onlineMeetingRole. */ +/** + * onlineMeetingRole. + */ public final class MicrosoftGraphOnlineMeetingRole extends ExpandableStringEnum { - /** Static value attendee for MicrosoftGraphOnlineMeetingRole. */ + /** + * Static value attendee for MicrosoftGraphOnlineMeetingRole. + */ public static final MicrosoftGraphOnlineMeetingRole ATTENDEE = fromString("attendee"); - /** Static value presenter for MicrosoftGraphOnlineMeetingRole. */ + /** + * Static value presenter for MicrosoftGraphOnlineMeetingRole. + */ public static final MicrosoftGraphOnlineMeetingRole PRESENTER = fromString("presenter"); - /** Static value unknownFutureValue for MicrosoftGraphOnlineMeetingRole. */ + /** + * Static value unknownFutureValue for MicrosoftGraphOnlineMeetingRole. + */ public static final MicrosoftGraphOnlineMeetingRole UNKNOWN_FUTURE_VALUE = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphOnlineMeetingRole value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public MicrosoftGraphOnlineMeetingRole() { /** * Creates or finds a MicrosoftGraphOnlineMeetingRole from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphOnlineMeetingRole. */ - @JsonCreator public static MicrosoftGraphOnlineMeetingRole fromString(String name) { return fromString(name, MicrosoftGraphOnlineMeetingRole.class); } /** * Gets known MicrosoftGraphOnlineMeetingRole values. - * + * * @return known MicrosoftGraphOnlineMeetingRole values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShift.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShift.java index 8f8bc78b58486..5483be7fb67a6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShift.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShift.java @@ -5,47 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** openShift. */ +/** + * openShift. + */ @Fluent public final class MicrosoftGraphOpenShift extends MicrosoftGraphChangeTrackedEntity { /* * openShiftItem */ - @JsonProperty(value = "draftOpenShift") private MicrosoftGraphOpenShiftItem draftOpenShift; /* * ID for the scheduling group that the open shift belongs to. */ - @JsonProperty(value = "schedulingGroupId") private String schedulingGroupId; /* * openShiftItem */ - @JsonProperty(value = "sharedOpenShift") private MicrosoftGraphOpenShiftItem sharedOpenShift; /* * openShift */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOpenShift class. */ + /** + * Creates an instance of MicrosoftGraphOpenShift class. + */ public MicrosoftGraphOpenShift() { } /** * Get the draftOpenShift property: openShiftItem. - * + * * @return the draftOpenShift value. */ public MicrosoftGraphOpenShiftItem draftOpenShift() { @@ -54,7 +57,7 @@ public MicrosoftGraphOpenShiftItem draftOpenShift() { /** * Set the draftOpenShift property: openShiftItem. - * + * * @param draftOpenShift the draftOpenShift value to set. * @return the MicrosoftGraphOpenShift object itself. */ @@ -65,7 +68,7 @@ public MicrosoftGraphOpenShift withDraftOpenShift(MicrosoftGraphOpenShiftItem dr /** * Get the schedulingGroupId property: ID for the scheduling group that the open shift belongs to. - * + * * @return the schedulingGroupId value. */ public String schedulingGroupId() { @@ -74,7 +77,7 @@ public String schedulingGroupId() { /** * Set the schedulingGroupId property: ID for the scheduling group that the open shift belongs to. - * + * * @param schedulingGroupId the schedulingGroupId value to set. * @return the MicrosoftGraphOpenShift object itself. */ @@ -85,7 +88,7 @@ public MicrosoftGraphOpenShift withSchedulingGroupId(String schedulingGroupId) { /** * Get the sharedOpenShift property: openShiftItem. - * + * * @return the sharedOpenShift value. */ public MicrosoftGraphOpenShiftItem sharedOpenShift() { @@ -94,7 +97,7 @@ public MicrosoftGraphOpenShiftItem sharedOpenShift() { /** * Set the sharedOpenShift property: openShiftItem. - * + * * @param sharedOpenShift the sharedOpenShift value to set. * @return the MicrosoftGraphOpenShift object itself. */ @@ -105,17 +108,16 @@ public MicrosoftGraphOpenShift withSharedOpenShift(MicrosoftGraphOpenShiftItem s /** * Get the additionalProperties property: openShift. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: openShift. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOpenShift object itself. */ @@ -124,36 +126,36 @@ public MicrosoftGraphOpenShift withAdditionalProperties(Map addi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShift withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShift withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShift withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShift withId(String id) { super.withId(id); @@ -162,7 +164,7 @@ public MicrosoftGraphOpenShift withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -175,4 +177,75 @@ public void validate() { sharedOpenShift().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeJsonField("draftOpenShift", this.draftOpenShift); + jsonWriter.writeStringField("schedulingGroupId", this.schedulingGroupId); + jsonWriter.writeJsonField("sharedOpenShift", this.sharedOpenShift); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOpenShift from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOpenShift 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 MicrosoftGraphOpenShift. + */ + public static MicrosoftGraphOpenShift fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOpenShift deserializedMicrosoftGraphOpenShift = new MicrosoftGraphOpenShift(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOpenShift.withId(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOpenShift.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphOpenShift.withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOpenShift.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("draftOpenShift".equals(fieldName)) { + deserializedMicrosoftGraphOpenShift.draftOpenShift = MicrosoftGraphOpenShiftItem.fromJson(reader); + } else if ("schedulingGroupId".equals(fieldName)) { + deserializedMicrosoftGraphOpenShift.schedulingGroupId = reader.getString(); + } else if ("sharedOpenShift".equals(fieldName)) { + deserializedMicrosoftGraphOpenShift.sharedOpenShift = MicrosoftGraphOpenShiftItem.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOpenShift.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOpenShift; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShiftChangeRequest.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShiftChangeRequest.java index e304e6d102ab0..3808ff47921b7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShiftChangeRequest.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShiftChangeRequest.java @@ -5,35 +5,40 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** openShiftChangeRequest. */ +/** + * openShiftChangeRequest. + */ @Fluent public final class MicrosoftGraphOpenShiftChangeRequest extends MicrosoftGraphScheduleChangeRequest { /* * ID for the open shift. */ - @JsonProperty(value = "openShiftId") private String openShiftId; /* * openShiftChangeRequest */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOpenShiftChangeRequest class. */ + /** + * Creates an instance of MicrosoftGraphOpenShiftChangeRequest class. + */ public MicrosoftGraphOpenShiftChangeRequest() { } /** * Get the openShiftId property: ID for the open shift. - * + * * @return the openShiftId value. */ public String openShiftId() { @@ -42,7 +47,7 @@ public String openShiftId() { /** * Set the openShiftId property: ID for the open shift. - * + * * @param openShiftId the openShiftId value to set. * @return the MicrosoftGraphOpenShiftChangeRequest object itself. */ @@ -53,17 +58,16 @@ public MicrosoftGraphOpenShiftChangeRequest withOpenShiftId(String openShiftId) /** * Get the additionalProperties property: openShiftChangeRequest. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: openShiftChangeRequest. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOpenShiftChangeRequest object itself. */ @@ -72,92 +76,108 @@ public MicrosoftGraphOpenShiftChangeRequest withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withAssignedTo(MicrosoftGraphScheduleChangeRequestActor assignedTo) { super.withAssignedTo(assignedTo); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withManagerActionDateTime(OffsetDateTime managerActionDateTime) { super.withManagerActionDateTime(managerActionDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withManagerActionMessage(String managerActionMessage) { super.withManagerActionMessage(managerActionMessage); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withManagerUserId(String managerUserId) { super.withManagerUserId(managerUserId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withSenderDateTime(OffsetDateTime senderDateTime) { super.withSenderDateTime(senderDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withSenderMessage(String senderMessage) { super.withSenderMessage(senderMessage); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withSenderUserId(String senderUserId) { super.withSenderUserId(senderUserId); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withState(MicrosoftGraphScheduleChangeState state) { super.withState(state); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftChangeRequest withId(String id) { super.withId(id); @@ -166,11 +186,110 @@ public MicrosoftGraphOpenShiftChangeRequest withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeStringField("assignedTo", assignedTo() == null ? null : assignedTo().toString()); + jsonWriter.writeStringField("managerActionDateTime", + managerActionDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(managerActionDateTime())); + jsonWriter.writeStringField("managerActionMessage", managerActionMessage()); + jsonWriter.writeStringField("managerUserId", managerUserId()); + jsonWriter.writeStringField("senderDateTime", + senderDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(senderDateTime())); + jsonWriter.writeStringField("senderMessage", senderMessage()); + jsonWriter.writeStringField("senderUserId", senderUserId()); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + jsonWriter.writeStringField("openShiftId", this.openShiftId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOpenShiftChangeRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOpenShiftChangeRequest 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 MicrosoftGraphOpenShiftChangeRequest. + */ + public static MicrosoftGraphOpenShiftChangeRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOpenShiftChangeRequest deserializedMicrosoftGraphOpenShiftChangeRequest + = new MicrosoftGraphOpenShiftChangeRequest(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest.withId(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest + .withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("assignedTo".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest + .withAssignedTo(MicrosoftGraphScheduleChangeRequestActor.fromString(reader.getString())); + } else if ("managerActionDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest.withManagerActionDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("managerActionMessage".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest.withManagerActionMessage(reader.getString()); + } else if ("managerUserId".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest.withManagerUserId(reader.getString()); + } else if ("senderDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest.withSenderDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("senderMessage".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest.withSenderMessage(reader.getString()); + } else if ("senderUserId".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest.withSenderUserId(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest + .withState(MicrosoftGraphScheduleChangeState.fromString(reader.getString())); + } else if ("openShiftId".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftChangeRequest.openShiftId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOpenShiftChangeRequest.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOpenShiftChangeRequest; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShiftItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShiftItem.java index a112a60c4480c..4bcf122860a27 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShiftItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOpenShiftItem.java @@ -5,36 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** openShiftItem. */ +/** + * openShiftItem. + */ @Fluent public final class MicrosoftGraphOpenShiftItem extends MicrosoftGraphShiftItem { /* * Count of the number of slots for the given open shift. */ - @JsonProperty(value = "openSlotCount") private Integer openSlotCount; /* * openShiftItem */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOpenShiftItem class. */ + /** + * Creates an instance of MicrosoftGraphOpenShiftItem class. + */ public MicrosoftGraphOpenShiftItem() { } /** * Get the openSlotCount property: Count of the number of slots for the given open shift. - * + * * @return the openSlotCount value. */ public Integer openSlotCount() { @@ -43,7 +48,7 @@ public Integer openSlotCount() { /** * Set the openSlotCount property: Count of the number of slots for the given open shift. - * + * * @param openSlotCount the openSlotCount value to set. * @return the MicrosoftGraphOpenShiftItem object itself. */ @@ -54,17 +59,16 @@ public MicrosoftGraphOpenShiftItem withOpenSlotCount(Integer openSlotCount) { /** * Get the additionalProperties property: openShiftItem. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: openShiftItem. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOpenShiftItem object itself. */ @@ -73,50 +77,54 @@ public MicrosoftGraphOpenShiftItem withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftItem withActivities(List activities) { super.withActivities(activities); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftItem withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftItem withNotes(String notes) { super.withNotes(notes); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftItem withEndDateTime(OffsetDateTime endDateTime) { super.withEndDateTime(endDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftItem withStartDateTime(OffsetDateTime startDateTime) { super.withStartDateTime(startDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOpenShiftItem withTheme(MicrosoftGraphScheduleEntityTheme theme) { super.withTheme(theme); @@ -125,11 +133,83 @@ public MicrosoftGraphOpenShiftItem withTheme(MicrosoftGraphScheduleEntityTheme t /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endDateTime", + endDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endDateTime())); + jsonWriter.writeStringField("startDateTime", + startDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startDateTime())); + jsonWriter.writeStringField("theme", theme() == null ? null : theme().toString()); + jsonWriter.writeArrayField("activities", activities(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("notes", notes()); + jsonWriter.writeNumberField("openSlotCount", this.openSlotCount); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOpenShiftItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOpenShiftItem 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 MicrosoftGraphOpenShiftItem. + */ + public static MicrosoftGraphOpenShiftItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOpenShiftItem deserializedMicrosoftGraphOpenShiftItem = new MicrosoftGraphOpenShiftItem(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftItem.withEndDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("startDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftItem.withStartDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("theme".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftItem + .withTheme(MicrosoftGraphScheduleEntityTheme.fromString(reader.getString())); + } else if ("activities".equals(fieldName)) { + List activities + = reader.readArray(reader1 -> MicrosoftGraphShiftActivity.fromJson(reader1)); + deserializedMicrosoftGraphOpenShiftItem.withActivities(activities); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftItem.withDisplayName(reader.getString()); + } else if ("notes".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftItem.withNotes(reader.getString()); + } else if ("openSlotCount".equals(fieldName)) { + deserializedMicrosoftGraphOpenShiftItem.openSlotCount = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOpenShiftItem.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOpenShiftItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperation.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperation.java index 288b00ea47643..deb93f86822ae 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperation.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperation.java @@ -5,47 +5,50 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** operation. */ +/** + * operation. + */ @Fluent public class MicrosoftGraphOperation extends MicrosoftGraphEntity { /* * The start time of the operation. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * The time of the last action of the operation. */ - @JsonProperty(value = "lastActionDateTime") private OffsetDateTime lastActionDateTime; /* * operationStatus */ - @JsonProperty(value = "status") private MicrosoftGraphOperationStatus status; /* * operation */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOperation class. */ + /** + * Creates an instance of MicrosoftGraphOperation class. + */ public MicrosoftGraphOperation() { } /** * Get the createdDateTime property: The start time of the operation. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -54,7 +57,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: The start time of the operation. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphOperation object itself. */ @@ -65,7 +68,7 @@ public MicrosoftGraphOperation withCreatedDateTime(OffsetDateTime createdDateTim /** * Get the lastActionDateTime property: The time of the last action of the operation. - * + * * @return the lastActionDateTime value. */ public OffsetDateTime lastActionDateTime() { @@ -74,7 +77,7 @@ public OffsetDateTime lastActionDateTime() { /** * Set the lastActionDateTime property: The time of the last action of the operation. - * + * * @param lastActionDateTime the lastActionDateTime value to set. * @return the MicrosoftGraphOperation object itself. */ @@ -85,7 +88,7 @@ public MicrosoftGraphOperation withLastActionDateTime(OffsetDateTime lastActionD /** * Get the status property: operationStatus. - * + * * @return the status value. */ public MicrosoftGraphOperationStatus status() { @@ -94,7 +97,7 @@ public MicrosoftGraphOperationStatus status() { /** * Set the status property: operationStatus. - * + * * @param status the status value to set. * @return the MicrosoftGraphOperation object itself. */ @@ -105,17 +108,16 @@ public MicrosoftGraphOperation withStatus(MicrosoftGraphOperationStatus status) /** * Get the additionalProperties property: operation. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: operation. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOperation object itself. */ @@ -124,15 +126,9 @@ public MicrosoftGraphOperation withAdditionalProperties(Map addi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOperation withId(String id) { super.withId(id); @@ -141,11 +137,74 @@ public MicrosoftGraphOperation withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastActionDateTime", + this.lastActionDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastActionDateTime)); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOperation 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 MicrosoftGraphOperation. + */ + public static MicrosoftGraphOperation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOperation deserializedMicrosoftGraphOperation = new MicrosoftGraphOperation(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOperation.withId(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOperation.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastActionDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOperation.lastActionDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedMicrosoftGraphOperation.status + = MicrosoftGraphOperationStatus.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOperation.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOperation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperationError.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperationError.java index ed65d7aaa4f3b..90744ed56d0c6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperationError.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperationError.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** operationError. */ +/** + * operationError. + */ @Fluent -public final class MicrosoftGraphOperationError { +public final class MicrosoftGraphOperationError implements JsonSerializable { /* * Operation error code. */ - @JsonProperty(value = "code") private String code; /* * Operation error message. */ - @JsonProperty(value = "message") private String message; /* * operationError */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOperationError class. */ + /** + * Creates an instance of MicrosoftGraphOperationError class. + */ public MicrosoftGraphOperationError() { } /** * Get the code property: Operation error code. - * + * * @return the code value. */ public String code() { @@ -47,7 +50,7 @@ public String code() { /** * Set the code property: Operation error code. - * + * * @param code the code value to set. * @return the MicrosoftGraphOperationError object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphOperationError withCode(String code) { /** * Get the message property: Operation error message. - * + * * @return the message value. */ public String message() { @@ -67,7 +70,7 @@ public String message() { /** * Set the message property: Operation error message. - * + * * @param message the message value to set. * @return the MicrosoftGraphOperationError object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphOperationError withMessage(String message) { /** * Get the additionalProperties property: operationError. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: operationError. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOperationError object itself. */ @@ -97,19 +99,61 @@ public MicrosoftGraphOperationError withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOperationError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOperationError 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 MicrosoftGraphOperationError. + */ + public static MicrosoftGraphOperationError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOperationError deserializedMicrosoftGraphOperationError = new MicrosoftGraphOperationError(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedMicrosoftGraphOperationError.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedMicrosoftGraphOperationError.message = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOperationError.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOperationError; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperationStatus.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperationStatus.java index 38e5d0e85a4fa..e9a348cac205c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperationStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOperationStatus.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** operationStatus. */ +/** + * operationStatus. + */ public final class MicrosoftGraphOperationStatus extends ExpandableStringEnum { - /** Static value NotStarted for MicrosoftGraphOperationStatus. */ + /** + * Static value NotStarted for MicrosoftGraphOperationStatus. + */ public static final MicrosoftGraphOperationStatus NOT_STARTED = fromString("NotStarted"); - /** Static value Running for MicrosoftGraphOperationStatus. */ + /** + * Static value Running for MicrosoftGraphOperationStatus. + */ public static final MicrosoftGraphOperationStatus RUNNING = fromString("Running"); - /** Static value Completed for MicrosoftGraphOperationStatus. */ + /** + * Static value Completed for MicrosoftGraphOperationStatus. + */ public static final MicrosoftGraphOperationStatus COMPLETED = fromString("Completed"); - /** Static value Failed for MicrosoftGraphOperationStatus. */ + /** + * Static value Failed for MicrosoftGraphOperationStatus. + */ public static final MicrosoftGraphOperationStatus FAILED = fromString("Failed"); /** * Creates a new instance of MicrosoftGraphOperationStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public MicrosoftGraphOperationStatus() { /** * Creates or finds a MicrosoftGraphOperationStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphOperationStatus. */ - @JsonCreator public static MicrosoftGraphOperationStatus fromString(String name) { return fromString(name, MicrosoftGraphOperationStatus.class); } /** * Gets known MicrosoftGraphOperationStatus values. - * + * * @return known MicrosoftGraphOperationStatus values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOptionalClaim.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOptionalClaim.java index c0844993045d8..0310df505a43d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOptionalClaim.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOptionalClaim.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** optionalClaim. */ +/** + * optionalClaim. + */ @Fluent -public final class MicrosoftGraphOptionalClaim { +public final class MicrosoftGraphOptionalClaim implements JsonSerializable { /* * Additional properties of the claim. If a property exists in this collection, it modifies the behavior of the * optional claim specified in the name property. */ - @JsonProperty(value = "additionalProperties") private List additionalPropertiesProperty; /* * If the value is true, the claim specified by the client is necessary to ensure a smooth authorization experience * for the specific task requested by the end user. The default value is false. */ - @JsonProperty(value = "essential") private Boolean essential; /* * The name of the optional claim. */ - @JsonProperty(value = "name") private String name; /* @@ -41,22 +41,23 @@ public final class MicrosoftGraphOptionalClaim { * properties. If the source value is null, the claim is a predefined optional claim. If the source value is user, * the value in the name property is the extension property from the user object. */ - @JsonProperty(value = "source") private String source; /* * optionalClaim */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOptionalClaim class. */ + /** + * Creates an instance of MicrosoftGraphOptionalClaim class. + */ public MicrosoftGraphOptionalClaim() { } /** * Get the additionalPropertiesProperty property: Additional properties of the claim. If a property exists in this * collection, it modifies the behavior of the optional claim specified in the name property. - * + * * @return the additionalPropertiesProperty value. */ public List additionalPropertiesProperty() { @@ -66,7 +67,7 @@ public List additionalPropertiesProperty() { /** * Set the additionalPropertiesProperty property: Additional properties of the claim. If a property exists in this * collection, it modifies the behavior of the optional claim specified in the name property. - * + * * @param additionalPropertiesProperty the additionalPropertiesProperty value to set. * @return the MicrosoftGraphOptionalClaim object itself. */ @@ -78,7 +79,7 @@ public MicrosoftGraphOptionalClaim withAdditionalPropertiesProperty(List /** * Get the essential property: If the value is true, the claim specified by the client is necessary to ensure a * smooth authorization experience for the specific task requested by the end user. The default value is false. - * + * * @return the essential value. */ public Boolean essential() { @@ -88,7 +89,7 @@ public Boolean essential() { /** * Set the essential property: If the value is true, the claim specified by the client is necessary to ensure a * smooth authorization experience for the specific task requested by the end user. The default value is false. - * + * * @param essential the essential value to set. * @return the MicrosoftGraphOptionalClaim object itself. */ @@ -99,7 +100,7 @@ public MicrosoftGraphOptionalClaim withEssential(Boolean essential) { /** * Get the name property: The name of the optional claim. - * + * * @return the name value. */ public String name() { @@ -108,7 +109,7 @@ public String name() { /** * Set the name property: The name of the optional claim. - * + * * @param name the name value to set. * @return the MicrosoftGraphOptionalClaim object itself. */ @@ -121,7 +122,7 @@ public MicrosoftGraphOptionalClaim withName(String name) { * Get the source property: The source (directory object) of the claim. There are predefined claims and user-defined * claims from extension properties. If the source value is null, the claim is a predefined optional claim. If the * source value is user, the value in the name property is the extension property from the user object. - * + * * @return the source value. */ public String source() { @@ -132,7 +133,7 @@ public String source() { * Set the source property: The source (directory object) of the claim. There are predefined claims and user-defined * claims from extension properties. If the source value is null, the claim is a predefined optional claim. If the * source value is user, the value in the name property is the extension property from the user object. - * + * * @param source the source value to set. * @return the MicrosoftGraphOptionalClaim object itself. */ @@ -143,17 +144,16 @@ public MicrosoftGraphOptionalClaim withSource(String source) { /** * Get the additionalProperties property: optionalClaim. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: optionalClaim. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOptionalClaim object itself. */ @@ -162,19 +162,69 @@ public MicrosoftGraphOptionalClaim withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("additionalProperties", this.additionalPropertiesProperty, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("essential", this.essential); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("source", this.source); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOptionalClaim from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOptionalClaim 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 MicrosoftGraphOptionalClaim. + */ + public static MicrosoftGraphOptionalClaim fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOptionalClaim deserializedMicrosoftGraphOptionalClaim = new MicrosoftGraphOptionalClaim(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("additionalProperties".equals(fieldName)) { + List additionalPropertiesProperty = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphOptionalClaim.additionalPropertiesProperty = additionalPropertiesProperty; + } else if ("essential".equals(fieldName)) { + deserializedMicrosoftGraphOptionalClaim.essential = reader.getNullable(JsonReader::getBoolean); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphOptionalClaim.name = reader.getString(); + } else if ("source".equals(fieldName)) { + deserializedMicrosoftGraphOptionalClaim.source = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOptionalClaim.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOptionalClaim; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOptionalClaims.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOptionalClaims.java index d4c5bd0411b15..14267072a5e73 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOptionalClaims.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOptionalClaims.java @@ -5,47 +5,49 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** optionalClaims. */ +/** + * optionalClaims. + */ @Fluent -public final class MicrosoftGraphOptionalClaims { +public final class MicrosoftGraphOptionalClaims implements JsonSerializable { /* * The optional claims returned in the JWT access token. */ - @JsonProperty(value = "accessToken") private List accessToken; /* * The optional claims returned in the JWT ID token. */ - @JsonProperty(value = "idToken") private List idToken; /* * The optional claims returned in the SAML token. */ - @JsonProperty(value = "saml2Token") private List saml2Token; /* * optionalClaims */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOptionalClaims class. */ + /** + * Creates an instance of MicrosoftGraphOptionalClaims class. + */ public MicrosoftGraphOptionalClaims() { } /** * Get the accessToken property: The optional claims returned in the JWT access token. - * + * * @return the accessToken value. */ public List accessToken() { @@ -54,7 +56,7 @@ public List accessToken() { /** * Set the accessToken property: The optional claims returned in the JWT access token. - * + * * @param accessToken the accessToken value to set. * @return the MicrosoftGraphOptionalClaims object itself. */ @@ -65,7 +67,7 @@ public MicrosoftGraphOptionalClaims withAccessToken(List idToken() { @@ -74,7 +76,7 @@ public List idToken() { /** * Set the idToken property: The optional claims returned in the JWT ID token. - * + * * @param idToken the idToken value to set. * @return the MicrosoftGraphOptionalClaims object itself. */ @@ -85,7 +87,7 @@ public MicrosoftGraphOptionalClaims withIdToken(List saml2Token() { @@ -94,7 +96,7 @@ public List saml2Token() { /** * Set the saml2Token property: The optional claims returned in the SAML token. - * + * * @param saml2Token the saml2Token value to set. * @return the MicrosoftGraphOptionalClaims object itself. */ @@ -105,17 +107,16 @@ public MicrosoftGraphOptionalClaims withSaml2Token(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: optionalClaims. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOptionalClaims object itself. */ @@ -124,17 +125,9 @@ public MicrosoftGraphOptionalClaims withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -148,4 +141,63 @@ public void validate() { saml2Token().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("accessToken", this.accessToken, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("idToken", this.idToken, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("saml2Token", this.saml2Token, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOptionalClaims from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOptionalClaims 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 MicrosoftGraphOptionalClaims. + */ + public static MicrosoftGraphOptionalClaims fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOptionalClaims deserializedMicrosoftGraphOptionalClaims = new MicrosoftGraphOptionalClaims(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accessToken".equals(fieldName)) { + List accessToken + = reader.readArray(reader1 -> MicrosoftGraphOptionalClaim.fromJson(reader1)); + deserializedMicrosoftGraphOptionalClaims.accessToken = accessToken; + } else if ("idToken".equals(fieldName)) { + List idToken + = reader.readArray(reader1 -> MicrosoftGraphOptionalClaim.fromJson(reader1)); + deserializedMicrosoftGraphOptionalClaims.idToken = idToken; + } else if ("saml2Token".equals(fieldName)) { + List saml2Token + = reader.readArray(reader1 -> MicrosoftGraphOptionalClaim.fromJson(reader1)); + deserializedMicrosoftGraphOptionalClaims.saml2Token = saml2Token; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOptionalClaims.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOptionalClaims; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOrgContactInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOrgContactInner.java index 2a8c2e2d547ab..3bf48644c7dff 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOrgContactInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOrgContactInner.java @@ -5,19 +5,21 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * orgContact - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -25,127 +27,109 @@ public final class MicrosoftGraphOrgContactInner extends MicrosoftGraphDirectory /* * The addresses property. */ - @JsonProperty(value = "addresses") private List addresses; /* * The companyName property. */ - @JsonProperty(value = "companyName") private String companyName; /* * The department property. */ - @JsonProperty(value = "department") private String department; /* * The displayName property. */ - @JsonProperty(value = "displayName") private String displayName; /* * The givenName property. */ - @JsonProperty(value = "givenName") private String givenName; /* * The jobTitle property. */ - @JsonProperty(value = "jobTitle") private String jobTitle; /* * The mail property. */ - @JsonProperty(value = "mail") private String mail; /* * The mailNickname property. */ - @JsonProperty(value = "mailNickname") private String mailNickname; /* * The onPremisesLastSyncDateTime property. */ - @JsonProperty(value = "onPremisesLastSyncDateTime") private OffsetDateTime onPremisesLastSyncDateTime; /* * The onPremisesProvisioningErrors property. */ - @JsonProperty(value = "onPremisesProvisioningErrors") private List onPremisesProvisioningErrors; /* * The onPremisesSyncEnabled property. */ - @JsonProperty(value = "onPremisesSyncEnabled") private Boolean onPremisesSyncEnabled; /* * The phones property. */ - @JsonProperty(value = "phones") private List phones; /* * The proxyAddresses property. */ - @JsonProperty(value = "proxyAddresses") private List proxyAddresses; /* * The surname property. */ - @JsonProperty(value = "surname") private String surname; /* * The directReports property. */ - @JsonProperty(value = "directReports") private List directReports; /* - * directoryObject - * * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonProperty(value = "manager") private MicrosoftGraphDirectoryObjectInner manager; /* * The memberOf property. */ - @JsonProperty(value = "memberOf") private List memberOf; /* * The transitiveMemberOf property. */ - @JsonProperty(value = "transitiveMemberOf") private List transitiveMemberOf; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOrgContactInner class. */ + /** + * Creates an instance of MicrosoftGraphOrgContactInner class. + */ public MicrosoftGraphOrgContactInner() { } /** * Get the addresses property: The addresses property. - * + * * @return the addresses value. */ public List addresses() { @@ -154,7 +138,7 @@ public List addresses() { /** * Set the addresses property: The addresses property. - * + * * @param addresses the addresses value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ @@ -165,7 +149,7 @@ public MicrosoftGraphOrgContactInner withAddresses(List onPremisesProvisioningErrors() { @@ -334,19 +318,19 @@ public List onPremisesProvisioningErr /** * Set the onPremisesProvisioningErrors property: The onPremisesProvisioningErrors property. - * + * * @param onPremisesProvisioningErrors the onPremisesProvisioningErrors value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ - public MicrosoftGraphOrgContactInner withOnPremisesProvisioningErrors( - List onPremisesProvisioningErrors) { + public MicrosoftGraphOrgContactInner + withOnPremisesProvisioningErrors(List onPremisesProvisioningErrors) { this.onPremisesProvisioningErrors = onPremisesProvisioningErrors; return this; } /** * Get the onPremisesSyncEnabled property: The onPremisesSyncEnabled property. - * + * * @return the onPremisesSyncEnabled value. */ public Boolean onPremisesSyncEnabled() { @@ -355,7 +339,7 @@ public Boolean onPremisesSyncEnabled() { /** * Set the onPremisesSyncEnabled property: The onPremisesSyncEnabled property. - * + * * @param onPremisesSyncEnabled the onPremisesSyncEnabled value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ @@ -366,7 +350,7 @@ public MicrosoftGraphOrgContactInner withOnPremisesSyncEnabled(Boolean onPremise /** * Get the phones property: The phones property. - * + * * @return the phones value. */ public List phones() { @@ -375,7 +359,7 @@ public List phones() { /** * Set the phones property: The phones property. - * + * * @param phones the phones value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ @@ -386,7 +370,7 @@ public MicrosoftGraphOrgContactInner withPhones(List phones /** * Get the proxyAddresses property: The proxyAddresses property. - * + * * @return the proxyAddresses value. */ public List proxyAddresses() { @@ -395,7 +379,7 @@ public List proxyAddresses() { /** * Set the proxyAddresses property: The proxyAddresses property. - * + * * @param proxyAddresses the proxyAddresses value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ @@ -406,7 +390,7 @@ public MicrosoftGraphOrgContactInner withProxyAddresses(List proxyAddres /** * Get the surname property: The surname property. - * + * * @return the surname value. */ public String surname() { @@ -415,7 +399,7 @@ public String surname() { /** * Set the surname property: The surname property. - * + * * @param surname the surname value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ @@ -426,7 +410,7 @@ public MicrosoftGraphOrgContactInner withSurname(String surname) { /** * Get the directReports property: The directReports property. - * + * * @return the directReports value. */ public List directReports() { @@ -435,7 +419,7 @@ public List directReports() { /** * Set the directReports property: The directReports property. - * + * * @param directReports the directReports value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ @@ -445,11 +429,9 @@ public MicrosoftGraphOrgContactInner withDirectReports(ListRepresents an Azure Active Directory object. The directoryObject type is the base type for many other - * directory entity types. - * + * Get the manager property: Represents an Azure Active Directory object. The directoryObject type is the base type + * for many other directory entity types. + * * @return the manager value. */ public MicrosoftGraphDirectoryObjectInner manager() { @@ -457,11 +439,9 @@ public MicrosoftGraphDirectoryObjectInner manager() { } /** - * Set the manager property: directoryObject - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other - * directory entity types. - * + * Set the manager property: Represents an Azure Active Directory object. The directoryObject type is the base type + * for many other directory entity types. + * * @param manager the manager value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ @@ -472,7 +452,7 @@ public MicrosoftGraphOrgContactInner withManager(MicrosoftGraphDirectoryObjectIn /** * Get the memberOf property: The memberOf property. - * + * * @return the memberOf value. */ public List memberOf() { @@ -481,7 +461,7 @@ public List memberOf() { /** * Set the memberOf property: The memberOf property. - * + * * @param memberOf the memberOf value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ @@ -492,7 +472,7 @@ public MicrosoftGraphOrgContactInner withMemberOf(List transitiveMemberOf() { @@ -501,12 +481,12 @@ public List transitiveMemberOf() { /** * Set the transitiveMemberOf property: The transitiveMemberOf property. - * + * * @param transitiveMemberOf the transitiveMemberOf value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ - public MicrosoftGraphOrgContactInner withTransitiveMemberOf( - List transitiveMemberOf) { + public MicrosoftGraphOrgContactInner + withTransitiveMemberOf(List transitiveMemberOf) { this.transitiveMemberOf = transitiveMemberOf; return this; } @@ -514,10 +494,9 @@ public MicrosoftGraphOrgContactInner withTransitiveMemberOf( /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -525,7 +504,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOrgContactInner object itself. */ @@ -534,22 +513,18 @@ public MicrosoftGraphOrgContactInner withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOrgContactInner withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOrgContactInner withId(String id) { super.withId(id); @@ -558,7 +533,7 @@ public MicrosoftGraphOrgContactInner withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -586,4 +561,134 @@ public void validate() { transitiveMemberOf().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeArrayField("addresses", this.addresses, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("companyName", this.companyName); + jsonWriter.writeStringField("department", this.department); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("givenName", this.givenName); + jsonWriter.writeStringField("jobTitle", this.jobTitle); + jsonWriter.writeStringField("mail", this.mail); + jsonWriter.writeStringField("mailNickname", this.mailNickname); + jsonWriter.writeStringField("onPremisesLastSyncDateTime", + this.onPremisesLastSyncDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.onPremisesLastSyncDateTime)); + jsonWriter.writeArrayField("onPremisesProvisioningErrors", this.onPremisesProvisioningErrors, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("onPremisesSyncEnabled", this.onPremisesSyncEnabled); + jsonWriter.writeArrayField("phones", this.phones, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("proxyAddresses", this.proxyAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("surname", this.surname); + jsonWriter.writeArrayField("directReports", this.directReports, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("manager", this.manager); + jsonWriter.writeArrayField("memberOf", this.memberOf, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("transitiveMemberOf", this.transitiveMemberOf, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOrgContactInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOrgContactInner 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 MicrosoftGraphOrgContactInner. + */ + public static MicrosoftGraphOrgContactInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOrgContactInner deserializedMicrosoftGraphOrgContactInner + = new MicrosoftGraphOrgContactInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("addresses".equals(fieldName)) { + List addresses + = reader.readArray(reader1 -> MicrosoftGraphPhysicalOfficeAddress.fromJson(reader1)); + deserializedMicrosoftGraphOrgContactInner.addresses = addresses; + } else if ("companyName".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.companyName = reader.getString(); + } else if ("department".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.department = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.displayName = reader.getString(); + } else if ("givenName".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.givenName = reader.getString(); + } else if ("jobTitle".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.jobTitle = reader.getString(); + } else if ("mail".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.mail = reader.getString(); + } else if ("mailNickname".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.mailNickname = reader.getString(); + } else if ("onPremisesLastSyncDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.onPremisesLastSyncDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("onPremisesProvisioningErrors".equals(fieldName)) { + List onPremisesProvisioningErrors + = reader.readArray(reader1 -> MicrosoftGraphOnPremisesProvisioningError.fromJson(reader1)); + deserializedMicrosoftGraphOrgContactInner.onPremisesProvisioningErrors + = onPremisesProvisioningErrors; + } else if ("onPremisesSyncEnabled".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.onPremisesSyncEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("phones".equals(fieldName)) { + List phones + = reader.readArray(reader1 -> MicrosoftGraphPhone.fromJson(reader1)); + deserializedMicrosoftGraphOrgContactInner.phones = phones; + } else if ("proxyAddresses".equals(fieldName)) { + List proxyAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphOrgContactInner.proxyAddresses = proxyAddresses; + } else if ("surname".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.surname = reader.getString(); + } else if ("directReports".equals(fieldName)) { + List directReports + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphOrgContactInner.directReports = directReports; + } else if ("manager".equals(fieldName)) { + deserializedMicrosoftGraphOrgContactInner.manager + = MicrosoftGraphDirectoryObjectInner.fromJson(reader); + } else if ("memberOf".equals(fieldName)) { + List memberOf + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphOrgContactInner.memberOf = memberOf; + } else if ("transitiveMemberOf".equals(fieldName)) { + List transitiveMemberOf + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphOrgContactInner.transitiveMemberOf = transitiveMemberOf; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOrgContactInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOrgContactInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOrganization.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOrganization.java index 4dac18f598c64..cd33542d440f4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOrganization.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOrganization.java @@ -5,73 +5,67 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * organization - * - *

The organization resource represents an instance of global settings and resources which operate and are - * provisioned at the tenant-level. + * + * The organization resource represents an instance of global settings and resources which operate and are provisioned + * at the tenant-level. */ @Fluent public final class MicrosoftGraphOrganization extends MicrosoftGraphDirectoryObjectInner { /* * The collection of service plans associated with the tenant. Not nullable. */ - @JsonProperty(value = "assignedPlans") private List assignedPlans; /* - * Telephone number for the organization. NOTE: Although this is a string collection, only one number can be set - * for this property. + * Telephone number for the organization. NOTE: Although this is a string collection, only one number can be set for + * this property. */ - @JsonProperty(value = "businessPhones") private List businessPhones; /* * City name of the address for the organization. */ - @JsonProperty(value = "city") private String city; /* * Country/region name of the address for the organization. */ - @JsonProperty(value = "country") private String country; /* * Country/region abbreviation for the organization. */ - @JsonProperty(value = "countryLetterCode") private String countryLetterCode; /* * Timestamp of when the organization was created. The value cannot be modified and is automatically populated when - * the organization is created. The Timestamp type represents date and time information using ISO 8601 format and - * is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. + * the organization is created. The Timestamp type represents date and time information using ISO 8601 format and is + * always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. * Read-only. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * The display name for the tenant. */ - @JsonProperty(value = "displayName") private String displayName; /* * Not nullable. */ - @JsonProperty(value = "marketingNotificationEmails") private List marketingNotificationEmails; /* @@ -79,7 +73,6 @@ public final class MicrosoftGraphOrganization extends MicrosoftGraphDirectoryObj * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. */ - @JsonProperty(value = "onPremisesLastSyncDateTime") private OffsetDateTime onPremisesLastSyncDateTime; /* @@ -87,107 +80,94 @@ public final class MicrosoftGraphOrganization extends MicrosoftGraphDirectoryObj * on-premises directory but is no longer synced; null if this object has never been synced from an on-premises * directory (default). */ - @JsonProperty(value = "onPremisesSyncEnabled") private Boolean onPremisesSyncEnabled; /* * Postal code of the address for the organization. */ - @JsonProperty(value = "postalCode") private String postalCode; /* * The preferred language for the organization. Should follow ISO 639-1 Code; for example 'en'. */ - @JsonProperty(value = "preferredLanguage") private String preferredLanguage; /* * privacyProfile */ - @JsonProperty(value = "privacyProfile") private MicrosoftGraphPrivacyProfile privacyProfile; /* * Not nullable. */ - @JsonProperty(value = "provisionedPlans") private List provisionedPlans; /* * The securityComplianceNotificationMails property. */ - @JsonProperty(value = "securityComplianceNotificationMails") private List securityComplianceNotificationMails; /* * The securityComplianceNotificationPhones property. */ - @JsonProperty(value = "securityComplianceNotificationPhones") private List securityComplianceNotificationPhones; /* * State name of the address for the organization. */ - @JsonProperty(value = "state") private String state; /* * Street name of the address for organization. */ - @JsonProperty(value = "street") private String street; /* * Not nullable. */ - @JsonProperty(value = "technicalNotificationMails") private List technicalNotificationMails; /* * The tenantType property. */ - @JsonProperty(value = "tenantType") private String tenantType; /* * The collection of domains associated with this tenant. Not nullable. */ - @JsonProperty(value = "verifiedDomains") private List verifiedDomains; /* * mdmAuthority */ - @JsonProperty(value = "mobileDeviceManagementAuthority") private MicrosoftGraphMdmAuthority mobileDeviceManagementAuthority; /* * Navigation property to manage certificate-based authentication configuration. Only a single instance of * certificateBasedAuthConfiguration can be created in the collection. */ - @JsonProperty(value = "certificateBasedAuthConfiguration") private List certificateBasedAuthConfiguration; /* * The collection of open extensions defined for the organization. Read-only. Nullable. */ - @JsonProperty(value = "extensions") private List extensions; /* * The organization resource represents an instance of global settings and resources which operate and are * provisioned at the tenant-level. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOrganization class. */ + /** + * Creates an instance of MicrosoftGraphOrganization class. + */ public MicrosoftGraphOrganization() { } /** * Get the assignedPlans property: The collection of service plans associated with the tenant. Not nullable. - * + * * @return the assignedPlans value. */ public List assignedPlans() { @@ -196,7 +176,7 @@ public List assignedPlans() { /** * Set the assignedPlans property: The collection of service plans associated with the tenant. Not nullable. - * + * * @param assignedPlans the assignedPlans value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -208,7 +188,7 @@ public MicrosoftGraphOrganization withAssignedPlans(List businessPhones() { @@ -218,7 +198,7 @@ public List businessPhones() { /** * Set the businessPhones property: Telephone number for the organization. NOTE: Although this is a string * collection, only one number can be set for this property. - * + * * @param businessPhones the businessPhones value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -229,7 +209,7 @@ public MicrosoftGraphOrganization withBusinessPhones(List businessPhones /** * Get the city property: City name of the address for the organization. - * + * * @return the city value. */ public String city() { @@ -238,7 +218,7 @@ public String city() { /** * Set the city property: City name of the address for the organization. - * + * * @param city the city value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -249,7 +229,7 @@ public MicrosoftGraphOrganization withCity(String city) { /** * Get the country property: Country/region name of the address for the organization. - * + * * @return the country value. */ public String country() { @@ -258,7 +238,7 @@ public String country() { /** * Set the country property: Country/region name of the address for the organization. - * + * * @param country the country value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -269,7 +249,7 @@ public MicrosoftGraphOrganization withCountry(String country) { /** * Get the countryLetterCode property: Country/region abbreviation for the organization. - * + * * @return the countryLetterCode value. */ public String countryLetterCode() { @@ -278,7 +258,7 @@ public String countryLetterCode() { /** * Set the countryLetterCode property: Country/region abbreviation for the organization. - * + * * @param countryLetterCode the countryLetterCode value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -292,7 +272,7 @@ public MicrosoftGraphOrganization withCountryLetterCode(String countryLetterCode * and is automatically populated when the organization is created. The Timestamp type represents date and time * information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look * like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -304,7 +284,7 @@ public OffsetDateTime createdDateTime() { * and is automatically populated when the organization is created. The Timestamp type represents date and time * information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look * like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -315,7 +295,7 @@ public MicrosoftGraphOrganization withCreatedDateTime(OffsetDateTime createdDate /** * Get the displayName property: The display name for the tenant. - * + * * @return the displayName value. */ public String displayName() { @@ -324,7 +304,7 @@ public String displayName() { /** * Set the displayName property: The display name for the tenant. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -335,7 +315,7 @@ public MicrosoftGraphOrganization withDisplayName(String displayName) { /** * Get the marketingNotificationEmails property: Not nullable. - * + * * @return the marketingNotificationEmails value. */ public List marketingNotificationEmails() { @@ -344,7 +324,7 @@ public List marketingNotificationEmails() { /** * Set the marketingNotificationEmails property: Not nullable. - * + * * @param marketingNotificationEmails the marketingNotificationEmails value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -357,7 +337,7 @@ public MicrosoftGraphOrganization withMarketingNotificationEmails(List m * Get the onPremisesLastSyncDateTime property: The time and date at which the tenant was last synced with the * on-premise directory. The Timestamp type represents date and time information using ISO 8601 format and is always * in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @return the onPremisesLastSyncDateTime value. */ public OffsetDateTime onPremisesLastSyncDateTime() { @@ -368,7 +348,7 @@ public OffsetDateTime onPremisesLastSyncDateTime() { * Set the onPremisesLastSyncDateTime property: The time and date at which the tenant was last synced with the * on-premise directory. The Timestamp type represents date and time information using ISO 8601 format and is always * in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @param onPremisesLastSyncDateTime the onPremisesLastSyncDateTime value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -381,7 +361,7 @@ public MicrosoftGraphOrganization withOnPremisesLastSyncDateTime(OffsetDateTime * Get the onPremisesSyncEnabled property: true if this object is synced from an on-premises directory; false if * this object was originally synced from an on-premises directory but is no longer synced; null if this object has * never been synced from an on-premises directory (default). - * + * * @return the onPremisesSyncEnabled value. */ public Boolean onPremisesSyncEnabled() { @@ -392,7 +372,7 @@ public Boolean onPremisesSyncEnabled() { * Set the onPremisesSyncEnabled property: true if this object is synced from an on-premises directory; false if * this object was originally synced from an on-premises directory but is no longer synced; null if this object has * never been synced from an on-premises directory (default). - * + * * @param onPremisesSyncEnabled the onPremisesSyncEnabled value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -403,7 +383,7 @@ public MicrosoftGraphOrganization withOnPremisesSyncEnabled(Boolean onPremisesSy /** * Get the postalCode property: Postal code of the address for the organization. - * + * * @return the postalCode value. */ public String postalCode() { @@ -412,7 +392,7 @@ public String postalCode() { /** * Set the postalCode property: Postal code of the address for the organization. - * + * * @param postalCode the postalCode value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -424,7 +404,7 @@ public MicrosoftGraphOrganization withPostalCode(String postalCode) { /** * Get the preferredLanguage property: The preferred language for the organization. Should follow ISO 639-1 Code; * for example 'en'. - * + * * @return the preferredLanguage value. */ public String preferredLanguage() { @@ -434,7 +414,7 @@ public String preferredLanguage() { /** * Set the preferredLanguage property: The preferred language for the organization. Should follow ISO 639-1 Code; * for example 'en'. - * + * * @param preferredLanguage the preferredLanguage value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -445,7 +425,7 @@ public MicrosoftGraphOrganization withPreferredLanguage(String preferredLanguage /** * Get the privacyProfile property: privacyProfile. - * + * * @return the privacyProfile value. */ public MicrosoftGraphPrivacyProfile privacyProfile() { @@ -454,7 +434,7 @@ public MicrosoftGraphPrivacyProfile privacyProfile() { /** * Set the privacyProfile property: privacyProfile. - * + * * @param privacyProfile the privacyProfile value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -465,7 +445,7 @@ public MicrosoftGraphOrganization withPrivacyProfile(MicrosoftGraphPrivacyProfil /** * Get the provisionedPlans property: Not nullable. - * + * * @return the provisionedPlans value. */ public List provisionedPlans() { @@ -474,7 +454,7 @@ public List provisionedPlans() { /** * Set the provisionedPlans property: Not nullable. - * + * * @param provisionedPlans the provisionedPlans value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -485,7 +465,7 @@ public MicrosoftGraphOrganization withProvisionedPlans(List securityComplianceNotificationMails() { @@ -494,19 +474,19 @@ public List securityComplianceNotificationMails() { /** * Set the securityComplianceNotificationMails property: The securityComplianceNotificationMails property. - * + * * @param securityComplianceNotificationMails the securityComplianceNotificationMails value to set. * @return the MicrosoftGraphOrganization object itself. */ - public MicrosoftGraphOrganization withSecurityComplianceNotificationMails( - List securityComplianceNotificationMails) { + public MicrosoftGraphOrganization + withSecurityComplianceNotificationMails(List securityComplianceNotificationMails) { this.securityComplianceNotificationMails = securityComplianceNotificationMails; return this; } /** * Get the securityComplianceNotificationPhones property: The securityComplianceNotificationPhones property. - * + * * @return the securityComplianceNotificationPhones value. */ public List securityComplianceNotificationPhones() { @@ -515,19 +495,19 @@ public List securityComplianceNotificationPhones() { /** * Set the securityComplianceNotificationPhones property: The securityComplianceNotificationPhones property. - * + * * @param securityComplianceNotificationPhones the securityComplianceNotificationPhones value to set. * @return the MicrosoftGraphOrganization object itself. */ - public MicrosoftGraphOrganization withSecurityComplianceNotificationPhones( - List securityComplianceNotificationPhones) { + public MicrosoftGraphOrganization + withSecurityComplianceNotificationPhones(List securityComplianceNotificationPhones) { this.securityComplianceNotificationPhones = securityComplianceNotificationPhones; return this; } /** * Get the state property: State name of the address for the organization. - * + * * @return the state value. */ public String state() { @@ -536,7 +516,7 @@ public String state() { /** * Set the state property: State name of the address for the organization. - * + * * @param state the state value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -547,7 +527,7 @@ public MicrosoftGraphOrganization withState(String state) { /** * Get the street property: Street name of the address for organization. - * + * * @return the street value. */ public String street() { @@ -556,7 +536,7 @@ public String street() { /** * Set the street property: Street name of the address for organization. - * + * * @param street the street value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -567,7 +547,7 @@ public MicrosoftGraphOrganization withStreet(String street) { /** * Get the technicalNotificationMails property: Not nullable. - * + * * @return the technicalNotificationMails value. */ public List technicalNotificationMails() { @@ -576,7 +556,7 @@ public List technicalNotificationMails() { /** * Set the technicalNotificationMails property: Not nullable. - * + * * @param technicalNotificationMails the technicalNotificationMails value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -587,7 +567,7 @@ public MicrosoftGraphOrganization withTechnicalNotificationMails(List te /** * Get the tenantType property: The tenantType property. - * + * * @return the tenantType value. */ public String tenantType() { @@ -596,7 +576,7 @@ public String tenantType() { /** * Set the tenantType property: The tenantType property. - * + * * @param tenantType the tenantType value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -607,7 +587,7 @@ public MicrosoftGraphOrganization withTenantType(String tenantType) { /** * Get the verifiedDomains property: The collection of domains associated with this tenant. Not nullable. - * + * * @return the verifiedDomains value. */ public List verifiedDomains() { @@ -616,7 +596,7 @@ public List verifiedDomains() { /** * Set the verifiedDomains property: The collection of domains associated with this tenant. Not nullable. - * + * * @param verifiedDomains the verifiedDomains value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -627,7 +607,7 @@ public MicrosoftGraphOrganization withVerifiedDomains(List certificateBasedAuthConfiguration() { @@ -661,7 +641,7 @@ public List certificateBasedAut * Set the certificateBasedAuthConfiguration property: Navigation property to manage certificate-based * authentication configuration. Only a single instance of certificateBasedAuthConfiguration can be created in the * collection. - * + * * @param certificateBasedAuthConfiguration the certificateBasedAuthConfiguration value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -673,7 +653,7 @@ public MicrosoftGraphOrganization withCertificateBasedAuthConfiguration( /** * Get the extensions property: The collection of open extensions defined for the organization. Read-only. Nullable. - * + * * @return the extensions value. */ public List extensions() { @@ -682,7 +662,7 @@ public List extensions() { /** * Set the extensions property: The collection of open extensions defined for the organization. Read-only. Nullable. - * + * * @param extensions the extensions value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -694,10 +674,9 @@ public MicrosoftGraphOrganization withExtensions(List e /** * Get the additionalProperties property: The organization resource represents an instance of global settings and * resources which operate and are provisioned at the tenant-level. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -705,7 +684,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: The organization resource represents an instance of global settings and * resources which operate and are provisioned at the tenant-level. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOrganization object itself. */ @@ -714,22 +693,18 @@ public MicrosoftGraphOrganization withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOrganization withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOrganization withId(String id) { super.withId(id); @@ -738,7 +713,7 @@ public MicrosoftGraphOrganization withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -763,4 +738,165 @@ public void validate() { extensions().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeArrayField("assignedPlans", this.assignedPlans, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("businessPhones", this.businessPhones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("city", this.city); + jsonWriter.writeStringField("country", this.country); + jsonWriter.writeStringField("countryLetterCode", this.countryLetterCode); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeArrayField("marketingNotificationEmails", this.marketingNotificationEmails, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("onPremisesLastSyncDateTime", + this.onPremisesLastSyncDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.onPremisesLastSyncDateTime)); + jsonWriter.writeBooleanField("onPremisesSyncEnabled", this.onPremisesSyncEnabled); + jsonWriter.writeStringField("postalCode", this.postalCode); + jsonWriter.writeStringField("preferredLanguage", this.preferredLanguage); + jsonWriter.writeJsonField("privacyProfile", this.privacyProfile); + jsonWriter.writeArrayField("provisionedPlans", this.provisionedPlans, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("securityComplianceNotificationMails", this.securityComplianceNotificationMails, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("securityComplianceNotificationPhones", this.securityComplianceNotificationPhones, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("state", this.state); + jsonWriter.writeStringField("street", this.street); + jsonWriter.writeArrayField("technicalNotificationMails", this.technicalNotificationMails, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("tenantType", this.tenantType); + jsonWriter.writeArrayField("verifiedDomains", this.verifiedDomains, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("mobileDeviceManagementAuthority", + this.mobileDeviceManagementAuthority == null ? null : this.mobileDeviceManagementAuthority.toString()); + jsonWriter.writeArrayField("certificateBasedAuthConfiguration", this.certificateBasedAuthConfiguration, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOrganization from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOrganization 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 MicrosoftGraphOrganization. + */ + public static MicrosoftGraphOrganization fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOrganization deserializedMicrosoftGraphOrganization = new MicrosoftGraphOrganization(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("assignedPlans".equals(fieldName)) { + List assignedPlans + = reader.readArray(reader1 -> MicrosoftGraphAssignedPlan.fromJson(reader1)); + deserializedMicrosoftGraphOrganization.assignedPlans = assignedPlans; + } else if ("businessPhones".equals(fieldName)) { + List businessPhones = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphOrganization.businessPhones = businessPhones; + } else if ("city".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.city = reader.getString(); + } else if ("country".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.country = reader.getString(); + } else if ("countryLetterCode".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.countryLetterCode = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.displayName = reader.getString(); + } else if ("marketingNotificationEmails".equals(fieldName)) { + List marketingNotificationEmails = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphOrganization.marketingNotificationEmails = marketingNotificationEmails; + } else if ("onPremisesLastSyncDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.onPremisesLastSyncDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("onPremisesSyncEnabled".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.onPremisesSyncEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("postalCode".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.postalCode = reader.getString(); + } else if ("preferredLanguage".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.preferredLanguage = reader.getString(); + } else if ("privacyProfile".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.privacyProfile + = MicrosoftGraphPrivacyProfile.fromJson(reader); + } else if ("provisionedPlans".equals(fieldName)) { + List provisionedPlans + = reader.readArray(reader1 -> MicrosoftGraphProvisionedPlan.fromJson(reader1)); + deserializedMicrosoftGraphOrganization.provisionedPlans = provisionedPlans; + } else if ("securityComplianceNotificationMails".equals(fieldName)) { + List securityComplianceNotificationMails = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphOrganization.securityComplianceNotificationMails + = securityComplianceNotificationMails; + } else if ("securityComplianceNotificationPhones".equals(fieldName)) { + List securityComplianceNotificationPhones + = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphOrganization.securityComplianceNotificationPhones + = securityComplianceNotificationPhones; + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.state = reader.getString(); + } else if ("street".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.street = reader.getString(); + } else if ("technicalNotificationMails".equals(fieldName)) { + List technicalNotificationMails = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphOrganization.technicalNotificationMails = technicalNotificationMails; + } else if ("tenantType".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.tenantType = reader.getString(); + } else if ("verifiedDomains".equals(fieldName)) { + List verifiedDomains + = reader.readArray(reader1 -> MicrosoftGraphVerifiedDomain.fromJson(reader1)); + deserializedMicrosoftGraphOrganization.verifiedDomains = verifiedDomains; + } else if ("mobileDeviceManagementAuthority".equals(fieldName)) { + deserializedMicrosoftGraphOrganization.mobileDeviceManagementAuthority + = MicrosoftGraphMdmAuthority.fromString(reader.getString()); + } else if ("certificateBasedAuthConfiguration".equals(fieldName)) { + List certificateBasedAuthConfiguration = reader + .readArray(reader1 -> MicrosoftGraphCertificateBasedAuthConfiguration.fromJson(reader1)); + deserializedMicrosoftGraphOrganization.certificateBasedAuthConfiguration + = certificateBasedAuthConfiguration; + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> MicrosoftGraphExtension.fromJson(reader1)); + deserializedMicrosoftGraphOrganization.extensions = extensions; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOrganization.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOrganization; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookCategory.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookCategory.java index 948ef04d65a93..7155a75fbec51 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookCategory.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookCategory.java @@ -5,41 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** outlookCategory. */ +/** + * outlookCategory. + */ @Fluent public final class MicrosoftGraphOutlookCategory extends MicrosoftGraphEntity { /* * categoryColor */ - @JsonProperty(value = "color") private MicrosoftGraphCategoryColor color; /* * A unique name that identifies a category in the user's mailbox. After a category is created, the name cannot be * changed. Read-only. */ - @JsonProperty(value = "displayName") private String displayName; /* * outlookCategory */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOutlookCategory class. */ + /** + * Creates an instance of MicrosoftGraphOutlookCategory class. + */ public MicrosoftGraphOutlookCategory() { } /** * Get the color property: categoryColor. - * + * * @return the color value. */ public MicrosoftGraphCategoryColor color() { @@ -48,7 +50,7 @@ public MicrosoftGraphCategoryColor color() { /** * Set the color property: categoryColor. - * + * * @param color the color value to set. * @return the MicrosoftGraphOutlookCategory object itself. */ @@ -60,7 +62,7 @@ public MicrosoftGraphOutlookCategory withColor(MicrosoftGraphCategoryColor color /** * Get the displayName property: A unique name that identifies a category in the user's mailbox. After a category is * created, the name cannot be changed. Read-only. - * + * * @return the displayName value. */ public String displayName() { @@ -70,7 +72,7 @@ public String displayName() { /** * Set the displayName property: A unique name that identifies a category in the user's mailbox. After a category is * created, the name cannot be changed. Read-only. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphOutlookCategory object itself. */ @@ -81,17 +83,16 @@ public MicrosoftGraphOutlookCategory withDisplayName(String displayName) { /** * Get the additionalProperties property: outlookCategory. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: outlookCategory. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOutlookCategory object itself. */ @@ -100,15 +101,9 @@ public MicrosoftGraphOutlookCategory withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOutlookCategory withId(String id) { super.withId(id); @@ -117,11 +112,66 @@ public MicrosoftGraphOutlookCategory withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("color", this.color == null ? null : this.color.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOutlookCategory from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOutlookCategory 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 MicrosoftGraphOutlookCategory. + */ + public static MicrosoftGraphOutlookCategory fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOutlookCategory deserializedMicrosoftGraphOutlookCategory + = new MicrosoftGraphOutlookCategory(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOutlookCategory.withId(reader.getString()); + } else if ("color".equals(fieldName)) { + deserializedMicrosoftGraphOutlookCategory.color + = MicrosoftGraphCategoryColor.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphOutlookCategory.displayName = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOutlookCategory.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOutlookCategory; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookGeoCoordinates.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookGeoCoordinates.java index d80f3724f1f92..2eff3377b145b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookGeoCoordinates.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookGeoCoordinates.java @@ -5,60 +5,61 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** outlookGeoCoordinates. */ +/** + * outlookGeoCoordinates. + */ @Fluent -public final class MicrosoftGraphOutlookGeoCoordinates { +public final class MicrosoftGraphOutlookGeoCoordinates + implements JsonSerializable { /* * The accuracy of the latitude and longitude. As an example, the accuracy can be measured in meters, such as the * latitude and longitude are accurate to within 50 meters. */ - @JsonProperty(value = "accuracy") private Double accuracy; /* * The altitude of the location. */ - @JsonProperty(value = "altitude") private Double altitude; /* * The accuracy of the altitude. */ - @JsonProperty(value = "altitudeAccuracy") private Double altitudeAccuracy; /* * The latitude of the location. */ - @JsonProperty(value = "latitude") private Double latitude; /* * The longitude of the location. */ - @JsonProperty(value = "longitude") private Double longitude; /* * outlookGeoCoordinates */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOutlookGeoCoordinates class. */ + /** + * Creates an instance of MicrosoftGraphOutlookGeoCoordinates class. + */ public MicrosoftGraphOutlookGeoCoordinates() { } /** * Get the accuracy property: The accuracy of the latitude and longitude. As an example, the accuracy can be * measured in meters, such as the latitude and longitude are accurate to within 50 meters. - * + * * @return the accuracy value. */ public Double accuracy() { @@ -68,7 +69,7 @@ public Double accuracy() { /** * Set the accuracy property: The accuracy of the latitude and longitude. As an example, the accuracy can be * measured in meters, such as the latitude and longitude are accurate to within 50 meters. - * + * * @param accuracy the accuracy value to set. * @return the MicrosoftGraphOutlookGeoCoordinates object itself. */ @@ -79,7 +80,7 @@ public MicrosoftGraphOutlookGeoCoordinates withAccuracy(Double accuracy) { /** * Get the altitude property: The altitude of the location. - * + * * @return the altitude value. */ public Double altitude() { @@ -88,7 +89,7 @@ public Double altitude() { /** * Set the altitude property: The altitude of the location. - * + * * @param altitude the altitude value to set. * @return the MicrosoftGraphOutlookGeoCoordinates object itself. */ @@ -99,7 +100,7 @@ public MicrosoftGraphOutlookGeoCoordinates withAltitude(Double altitude) { /** * Get the altitudeAccuracy property: The accuracy of the altitude. - * + * * @return the altitudeAccuracy value. */ public Double altitudeAccuracy() { @@ -108,7 +109,7 @@ public Double altitudeAccuracy() { /** * Set the altitudeAccuracy property: The accuracy of the altitude. - * + * * @param altitudeAccuracy the altitudeAccuracy value to set. * @return the MicrosoftGraphOutlookGeoCoordinates object itself. */ @@ -119,7 +120,7 @@ public MicrosoftGraphOutlookGeoCoordinates withAltitudeAccuracy(Double altitudeA /** * Get the latitude property: The latitude of the location. - * + * * @return the latitude value. */ public Double latitude() { @@ -128,7 +129,7 @@ public Double latitude() { /** * Set the latitude property: The latitude of the location. - * + * * @param latitude the latitude value to set. * @return the MicrosoftGraphOutlookGeoCoordinates object itself. */ @@ -139,7 +140,7 @@ public MicrosoftGraphOutlookGeoCoordinates withLatitude(Double latitude) { /** * Get the longitude property: The longitude of the location. - * + * * @return the longitude value. */ public Double longitude() { @@ -148,7 +149,7 @@ public Double longitude() { /** * Set the longitude property: The longitude of the location. - * + * * @param longitude the longitude value to set. * @return the MicrosoftGraphOutlookGeoCoordinates object itself. */ @@ -159,17 +160,16 @@ public MicrosoftGraphOutlookGeoCoordinates withLongitude(Double longitude) { /** * Get the additionalProperties property: outlookGeoCoordinates. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: outlookGeoCoordinates. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOutlookGeoCoordinates object itself. */ @@ -178,19 +178,76 @@ public MicrosoftGraphOutlookGeoCoordinates withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("accuracy", this.accuracy); + jsonWriter.writeNumberField("altitude", this.altitude); + jsonWriter.writeNumberField("altitudeAccuracy", this.altitudeAccuracy); + jsonWriter.writeNumberField("latitude", this.latitude); + jsonWriter.writeNumberField("longitude", this.longitude); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOutlookGeoCoordinates from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOutlookGeoCoordinates 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 MicrosoftGraphOutlookGeoCoordinates. + */ + public static MicrosoftGraphOutlookGeoCoordinates fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOutlookGeoCoordinates deserializedMicrosoftGraphOutlookGeoCoordinates + = new MicrosoftGraphOutlookGeoCoordinates(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accuracy".equals(fieldName)) { + deserializedMicrosoftGraphOutlookGeoCoordinates.accuracy + = reader.getNullable(JsonReader::getDouble); + } else if ("altitude".equals(fieldName)) { + deserializedMicrosoftGraphOutlookGeoCoordinates.altitude + = reader.getNullable(JsonReader::getDouble); + } else if ("altitudeAccuracy".equals(fieldName)) { + deserializedMicrosoftGraphOutlookGeoCoordinates.altitudeAccuracy + = reader.getNullable(JsonReader::getDouble); + } else if ("latitude".equals(fieldName)) { + deserializedMicrosoftGraphOutlookGeoCoordinates.latitude + = reader.getNullable(JsonReader::getDouble); + } else if ("longitude".equals(fieldName)) { + deserializedMicrosoftGraphOutlookGeoCoordinates.longitude + = reader.getNullable(JsonReader::getDouble); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOutlookGeoCoordinates.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOutlookGeoCoordinates; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookItem.java index 8ae7c982915a9..b935b0a483231 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookItem.java @@ -5,57 +5,59 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** outlookItem. */ +/** + * outlookItem. + */ @Fluent public class MicrosoftGraphOutlookItem extends MicrosoftGraphEntity { /* * The categories associated with the item */ - @JsonProperty(value = "categories") private List categories; /* * Identifies the version of the item. Every time the item is changed, changeKey changes as well. This allows * Exchange to apply changes to the correct version of the object. Read-only. */ - @JsonProperty(value = "changeKey") private String changeKey; /* * The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * outlookItem */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOutlookItem class. */ + /** + * Creates an instance of MicrosoftGraphOutlookItem class. + */ public MicrosoftGraphOutlookItem() { } /** * Get the categories property: The categories associated with the item. - * + * * @return the categories value. */ public List categories() { @@ -64,7 +66,7 @@ public List categories() { /** * Set the categories property: The categories associated with the item. - * + * * @param categories the categories value to set. * @return the MicrosoftGraphOutlookItem object itself. */ @@ -76,7 +78,7 @@ public MicrosoftGraphOutlookItem withCategories(List categories) { /** * Get the changeKey property: Identifies the version of the item. Every time the item is changed, changeKey changes * as well. This allows Exchange to apply changes to the correct version of the object. Read-only. - * + * * @return the changeKey value. */ public String changeKey() { @@ -86,7 +88,7 @@ public String changeKey() { /** * Set the changeKey property: Identifies the version of the item. Every time the item is changed, changeKey changes * as well. This allows Exchange to apply changes to the correct version of the object. Read-only. - * + * * @param changeKey the changeKey value to set. * @return the MicrosoftGraphOutlookItem object itself. */ @@ -98,7 +100,7 @@ public MicrosoftGraphOutlookItem withChangeKey(String changeKey) { /** * Get the createdDateTime property: The Timestamp type represents date and time information using ISO 8601 format * and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -108,7 +110,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: The Timestamp type represents date and time information using ISO 8601 format * and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphOutlookItem object itself. */ @@ -121,7 +123,7 @@ public MicrosoftGraphOutlookItem withCreatedDateTime(OffsetDateTime createdDateT * Get the lastModifiedDateTime property: The Timestamp type represents date and time information using ISO 8601 * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -132,7 +134,7 @@ public OffsetDateTime lastModifiedDateTime() { * Set the lastModifiedDateTime property: The Timestamp type represents date and time information using ISO 8601 * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphOutlookItem object itself. */ @@ -143,17 +145,16 @@ public MicrosoftGraphOutlookItem withLastModifiedDateTime(OffsetDateTime lastMod /** * Get the additionalProperties property: outlookItem. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: outlookItem. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOutlookItem object itself. */ @@ -162,15 +163,9 @@ public MicrosoftGraphOutlookItem withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOutlookItem withId(String id) { super.withId(id); @@ -179,11 +174,77 @@ public MicrosoftGraphOutlookItem withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("categories", this.categories, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("changeKey", this.changeKey); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOutlookItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOutlookItem 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 MicrosoftGraphOutlookItem. + */ + public static MicrosoftGraphOutlookItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOutlookItem deserializedMicrosoftGraphOutlookItem = new MicrosoftGraphOutlookItem(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOutlookItem.withId(reader.getString()); + } else if ("categories".equals(fieldName)) { + List categories = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphOutlookItem.categories = categories; + } else if ("changeKey".equals(fieldName)) { + deserializedMicrosoftGraphOutlookItem.changeKey = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOutlookItem.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphOutlookItem.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOutlookItem.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOutlookItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookUser.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookUser.java index b24b0fc85bc86..a11da18259f3f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookUser.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphOutlookUser.java @@ -5,35 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** outlookUser. */ +/** + * outlookUser. + */ @Fluent public final class MicrosoftGraphOutlookUser extends MicrosoftGraphEntity { /* * A list of categories defined for the user. */ - @JsonProperty(value = "masterCategories") private List masterCategories; /* * outlookUser */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphOutlookUser class. */ + /** + * Creates an instance of MicrosoftGraphOutlookUser class. + */ public MicrosoftGraphOutlookUser() { } /** * Get the masterCategories property: A list of categories defined for the user. - * + * * @return the masterCategories value. */ public List masterCategories() { @@ -42,7 +45,7 @@ public List masterCategories() { /** * Set the masterCategories property: A list of categories defined for the user. - * + * * @param masterCategories the masterCategories value to set. * @return the MicrosoftGraphOutlookUser object itself. */ @@ -53,17 +56,16 @@ public MicrosoftGraphOutlookUser withMasterCategories(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: outlookUser. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphOutlookUser object itself. */ @@ -72,15 +74,9 @@ public MicrosoftGraphOutlookUser withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphOutlookUser withId(String id) { super.withId(id); @@ -89,7 +85,7 @@ public MicrosoftGraphOutlookUser withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -99,4 +95,57 @@ public void validate() { masterCategories().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("masterCategories", this.masterCategories, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphOutlookUser from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphOutlookUser 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 MicrosoftGraphOutlookUser. + */ + public static MicrosoftGraphOutlookUser fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphOutlookUser deserializedMicrosoftGraphOutlookUser = new MicrosoftGraphOutlookUser(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphOutlookUser.withId(reader.getString()); + } else if ("masterCategories".equals(fieldName)) { + List masterCategories + = reader.readArray(reader1 -> MicrosoftGraphOutlookCategory.fromJson(reader1)); + deserializedMicrosoftGraphOutlookUser.masterCategories = masterCategories; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphOutlookUser.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphOutlookUser; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPackage.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPackage.java index 7388589024f88..722364a986264 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPackage.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPackage.java @@ -5,36 +5,40 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** package. */ +/** + * package. + */ @Fluent -public final class MicrosoftGraphPackage { +public final class MicrosoftGraphPackage implements JsonSerializable { /* * A string indicating the type of package. While oneNote is the only currently defined value, you should expect * other package types to be returned and handle them accordingly. */ - @JsonProperty(value = "type") private String type; /* * package */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPackage class. */ + /** + * Creates an instance of MicrosoftGraphPackage class. + */ public MicrosoftGraphPackage() { } /** * Get the type property: A string indicating the type of package. While oneNote is the only currently defined * value, you should expect other package types to be returned and handle them accordingly. - * + * * @return the type value. */ public String type() { @@ -44,7 +48,7 @@ public String type() { /** * Set the type property: A string indicating the type of package. While oneNote is the only currently defined * value, you should expect other package types to be returned and handle them accordingly. - * + * * @param type the type value to set. * @return the MicrosoftGraphPackage object itself. */ @@ -55,17 +59,16 @@ public MicrosoftGraphPackage withType(String type) { /** * Get the additionalProperties property: package. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: package. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPackage object itself. */ @@ -74,19 +77,58 @@ public MicrosoftGraphPackage withAdditionalProperties(Map additi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPackage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPackage 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 MicrosoftGraphPackage. + */ + public static MicrosoftGraphPackage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPackage deserializedMicrosoftGraphPackage = new MicrosoftGraphPackage(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedMicrosoftGraphPackage.type = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPackage.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPackage; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPageLinks.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPageLinks.java index 8283d2f6f0c9d..a5bc22870a47a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPageLinks.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPageLinks.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** pageLinks. */ +/** + * pageLinks. + */ @Fluent -public final class MicrosoftGraphPageLinks { +public final class MicrosoftGraphPageLinks implements JsonSerializable { /* * externalLink */ - @JsonProperty(value = "oneNoteClientUrl") private MicrosoftGraphExternalLink oneNoteClientUrl; /* * externalLink */ - @JsonProperty(value = "oneNoteWebUrl") private MicrosoftGraphExternalLink oneNoteWebUrl; /* * pageLinks */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPageLinks class. */ + /** + * Creates an instance of MicrosoftGraphPageLinks class. + */ public MicrosoftGraphPageLinks() { } /** * Get the oneNoteClientUrl property: externalLink. - * + * * @return the oneNoteClientUrl value. */ public MicrosoftGraphExternalLink oneNoteClientUrl() { @@ -47,7 +50,7 @@ public MicrosoftGraphExternalLink oneNoteClientUrl() { /** * Set the oneNoteClientUrl property: externalLink. - * + * * @param oneNoteClientUrl the oneNoteClientUrl value to set. * @return the MicrosoftGraphPageLinks object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphPageLinks withOneNoteClientUrl(MicrosoftGraphExternalLink o /** * Get the oneNoteWebUrl property: externalLink. - * + * * @return the oneNoteWebUrl value. */ public MicrosoftGraphExternalLink oneNoteWebUrl() { @@ -67,7 +70,7 @@ public MicrosoftGraphExternalLink oneNoteWebUrl() { /** * Set the oneNoteWebUrl property: externalLink. - * + * * @param oneNoteWebUrl the oneNoteWebUrl value to set. * @return the MicrosoftGraphPageLinks object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphPageLinks withOneNoteWebUrl(MicrosoftGraphExternalLink oneN /** * Get the additionalProperties property: pageLinks. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: pageLinks. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPageLinks object itself. */ @@ -97,17 +99,9 @@ public MicrosoftGraphPageLinks withAdditionalProperties(Map addi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -118,4 +112,54 @@ public void validate() { oneNoteWebUrl().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("oneNoteClientUrl", this.oneNoteClientUrl); + jsonWriter.writeJsonField("oneNoteWebUrl", this.oneNoteWebUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPageLinks from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPageLinks 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 MicrosoftGraphPageLinks. + */ + public static MicrosoftGraphPageLinks fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPageLinks deserializedMicrosoftGraphPageLinks = new MicrosoftGraphPageLinks(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("oneNoteClientUrl".equals(fieldName)) { + deserializedMicrosoftGraphPageLinks.oneNoteClientUrl = MicrosoftGraphExternalLink.fromJson(reader); + } else if ("oneNoteWebUrl".equals(fieldName)) { + deserializedMicrosoftGraphPageLinks.oneNoteWebUrl = MicrosoftGraphExternalLink.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPageLinks.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPageLinks; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphParentalControlSettings.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphParentalControlSettings.java index a9b406980df7f..5776869bb6d6f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphParentalControlSettings.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphParentalControlSettings.java @@ -5,48 +5,52 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** parentalControlSettings. */ +/** + * parentalControlSettings. + */ @Fluent -public final class MicrosoftGraphParentalControlSettings { +public final class MicrosoftGraphParentalControlSettings + implements JsonSerializable { /* * Specifies the two-letter ISO country codes. Access to the application will be blocked for minors from the * countries specified in this list. */ - @JsonProperty(value = "countriesBlockedForMinors") private List countriesBlockedForMinors; /* * Specifies the legal age group rule that applies to users of the app. Can be set to one of the following values: * ValueDescriptionAllowDefault. Enforces the legal minimum. This means parental consent is required for minors in - * the European Union and Korea.RequireConsentForPrivacyServicesEnforces the user to specify date of birth to - * comply with COPPA rules. RequireConsentForMinorsRequires parental consent for ages below 18, regardless of - * country minor rules.RequireConsentForKidsRequires parental consent for ages below 14, regardless of country - * minor rules.BlockMinorsBlocks minors from using the app. + * the European Union and Korea.RequireConsentForPrivacyServicesEnforces the user to specify date of birth to comply + * with COPPA rules. RequireConsentForMinorsRequires parental consent for ages below 18, regardless of country minor + * rules.RequireConsentForKidsRequires parental consent for ages below 14, regardless of country minor + * rules.BlockMinorsBlocks minors from using the app. */ - @JsonProperty(value = "legalAgeGroupRule") private String legalAgeGroupRule; /* * parentalControlSettings */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphParentalControlSettings class. */ + /** + * Creates an instance of MicrosoftGraphParentalControlSettings class. + */ public MicrosoftGraphParentalControlSettings() { } /** * Get the countriesBlockedForMinors property: Specifies the two-letter ISO country codes. Access to the application * will be blocked for minors from the countries specified in this list. - * + * * @return the countriesBlockedForMinors value. */ public List countriesBlockedForMinors() { @@ -56,7 +60,7 @@ public List countriesBlockedForMinors() { /** * Set the countriesBlockedForMinors property: Specifies the two-letter ISO country codes. Access to the application * will be blocked for minors from the countries specified in this list. - * + * * @param countriesBlockedForMinors the countriesBlockedForMinors value to set. * @return the MicrosoftGraphParentalControlSettings object itself. */ @@ -72,7 +76,7 @@ public MicrosoftGraphParentalControlSettings withCountriesBlockedForMinors(List< * to specify date of birth to comply with COPPA rules. RequireConsentForMinorsRequires parental consent for ages * below 18, regardless of country minor rules.RequireConsentForKidsRequires parental consent for ages below 14, * regardless of country minor rules.BlockMinorsBlocks minors from using the app. - * + * * @return the legalAgeGroupRule value. */ public String legalAgeGroupRule() { @@ -86,7 +90,7 @@ public String legalAgeGroupRule() { * to specify date of birth to comply with COPPA rules. RequireConsentForMinorsRequires parental consent for ages * below 18, regardless of country minor rules.RequireConsentForKidsRequires parental consent for ages below 14, * regardless of country minor rules.BlockMinorsBlocks minors from using the app. - * + * * @param legalAgeGroupRule the legalAgeGroupRule value to set. * @return the MicrosoftGraphParentalControlSettings object itself. */ @@ -97,17 +101,16 @@ public MicrosoftGraphParentalControlSettings withLegalAgeGroupRule(String legalA /** * Get the additionalProperties property: parentalControlSettings. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: parentalControlSettings. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphParentalControlSettings object itself. */ @@ -116,19 +119,65 @@ public MicrosoftGraphParentalControlSettings withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("countriesBlockedForMinors", this.countriesBlockedForMinors, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("legalAgeGroupRule", this.legalAgeGroupRule); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphParentalControlSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphParentalControlSettings 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 MicrosoftGraphParentalControlSettings. + */ + public static MicrosoftGraphParentalControlSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphParentalControlSettings deserializedMicrosoftGraphParentalControlSettings + = new MicrosoftGraphParentalControlSettings(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("countriesBlockedForMinors".equals(fieldName)) { + List countriesBlockedForMinors = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphParentalControlSettings.countriesBlockedForMinors + = countriesBlockedForMinors; + } else if ("legalAgeGroupRule".equals(fieldName)) { + deserializedMicrosoftGraphParentalControlSettings.legalAgeGroupRule = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphParentalControlSettings.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphParentalControlSettings; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPasswordCredentialInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPasswordCredentialInner.java index dbe4ac251c1c7..dc276e9946d55 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPasswordCredentialInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPasswordCredentialInner.java @@ -7,57 +7,57 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.Base64Url; import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** passwordCredential. */ +/** + * passwordCredential. + */ @Fluent -public final class MicrosoftGraphPasswordCredentialInner { +public final class MicrosoftGraphPasswordCredentialInner + implements JsonSerializable { private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; /* * Do not use. */ - @JsonProperty(value = "customKeyIdentifier") private Base64Url customKeyIdentifier; /* * Friendly name for the password. Optional. */ - @JsonProperty(value = "displayName") private String displayName; /* * The date and time at which the password expires represented using ISO 8601 format and is always in UTC time. For * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Optional. */ - @JsonProperty(value = "endDateTime") private OffsetDateTime endDateTime; /* * Contains the first three characters of the password. Read-only. */ - @JsonProperty(value = "hint") private String hint; /* * The unique identifier for the password. */ - @JsonProperty(value = "keyId") private UUID keyId; /* - * Read-only; Contains the strong passwords generated by Azure AD that are 16-64 characters in length. The - * generated password value is only returned during the initial POST request to addPassword. There is no way to - * retrieve this password in the future. + * Read-only; Contains the strong passwords generated by Azure AD that are 16-64 characters in length. The generated + * password value is only returned during the initial POST request to addPassword. There is no way to retrieve this + * password in the future. */ - @JsonProperty(value = "secretText") private String secretText; /* @@ -65,21 +65,22 @@ public final class MicrosoftGraphPasswordCredentialInner { * using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. Optional. */ - @JsonProperty(value = "startDateTime") private OffsetDateTime startDateTime; /* * passwordCredential */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPasswordCredentialInner class. */ + /** + * Creates an instance of MicrosoftGraphPasswordCredentialInner class. + */ public MicrosoftGraphPasswordCredentialInner() { } /** * Get the customKeyIdentifier property: Do not use. - * + * * @return the customKeyIdentifier value. */ public byte[] customKeyIdentifier() { @@ -91,7 +92,7 @@ public byte[] customKeyIdentifier() { /** * Set the customKeyIdentifier property: Do not use. - * + * * @param customKeyIdentifier the customKeyIdentifier value to set. * @return the MicrosoftGraphPasswordCredentialInner object itself. */ @@ -106,7 +107,7 @@ public MicrosoftGraphPasswordCredentialInner withCustomKeyIdentifier(byte[] cust /** * Get the displayName property: Friendly name for the password. Optional. - * + * * @return the displayName value. */ public String displayName() { @@ -115,7 +116,7 @@ public String displayName() { /** * Set the displayName property: Friendly name for the password. Optional. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphPasswordCredentialInner object itself. */ @@ -128,7 +129,7 @@ public MicrosoftGraphPasswordCredentialInner withDisplayName(String displayName) * Get the endDateTime property: The date and time at which the password expires represented using ISO 8601 format * and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. * Optional. - * + * * @return the endDateTime value. */ public OffsetDateTime endDateTime() { @@ -139,7 +140,7 @@ public OffsetDateTime endDateTime() { * Set the endDateTime property: The date and time at which the password expires represented using ISO 8601 format * and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. * Optional. - * + * * @param endDateTime the endDateTime value to set. * @return the MicrosoftGraphPasswordCredentialInner object itself. */ @@ -150,7 +151,7 @@ public MicrosoftGraphPasswordCredentialInner withEndDateTime(OffsetDateTime endD /** * Get the hint property: Contains the first three characters of the password. Read-only. - * + * * @return the hint value. */ public String hint() { @@ -159,7 +160,7 @@ public String hint() { /** * Set the hint property: Contains the first three characters of the password. Read-only. - * + * * @param hint the hint value to set. * @return the MicrosoftGraphPasswordCredentialInner object itself. */ @@ -170,7 +171,7 @@ public MicrosoftGraphPasswordCredentialInner withHint(String hint) { /** * Get the keyId property: The unique identifier for the password. - * + * * @return the keyId value. */ public UUID keyId() { @@ -179,7 +180,7 @@ public UUID keyId() { /** * Set the keyId property: The unique identifier for the password. - * + * * @param keyId the keyId value to set. * @return the MicrosoftGraphPasswordCredentialInner object itself. */ @@ -192,7 +193,7 @@ public MicrosoftGraphPasswordCredentialInner withKeyId(UUID keyId) { * Get the secretText property: Read-only; Contains the strong passwords generated by Azure AD that are 16-64 * characters in length. The generated password value is only returned during the initial POST request to * addPassword. There is no way to retrieve this password in the future. - * + * * @return the secretText value. */ public String secretText() { @@ -203,7 +204,7 @@ public String secretText() { * Set the secretText property: Read-only; Contains the strong passwords generated by Azure AD that are 16-64 * characters in length. The generated password value is only returned during the initial POST request to * addPassword. There is no way to retrieve this password in the future. - * + * * @param secretText the secretText value to set. * @return the MicrosoftGraphPasswordCredentialInner object itself. */ @@ -216,7 +217,7 @@ public MicrosoftGraphPasswordCredentialInner withSecretText(String secretText) { * Get the startDateTime property: The date and time at which the password becomes valid. The Timestamp type * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Optional. - * + * * @return the startDateTime value. */ public OffsetDateTime startDateTime() { @@ -227,7 +228,7 @@ public OffsetDateTime startDateTime() { * Set the startDateTime property: The date and time at which the password becomes valid. The Timestamp type * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Optional. - * + * * @param startDateTime the startDateTime value to set. * @return the MicrosoftGraphPasswordCredentialInner object itself. */ @@ -238,17 +239,16 @@ public MicrosoftGraphPasswordCredentialInner withStartDateTime(OffsetDateTime st /** * Get the additionalProperties property: passwordCredential. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: passwordCredential. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPasswordCredentialInner object itself. */ @@ -257,19 +257,83 @@ public MicrosoftGraphPasswordCredentialInner withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("customKeyIdentifier", Objects.toString(this.customKeyIdentifier, null)); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("endDateTime", + this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime)); + jsonWriter.writeStringField("hint", this.hint); + jsonWriter.writeStringField("keyId", Objects.toString(this.keyId, null)); + jsonWriter.writeStringField("secretText", this.secretText); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPasswordCredentialInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPasswordCredentialInner 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 MicrosoftGraphPasswordCredentialInner. + */ + public static MicrosoftGraphPasswordCredentialInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPasswordCredentialInner deserializedMicrosoftGraphPasswordCredentialInner + = new MicrosoftGraphPasswordCredentialInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("customKeyIdentifier".equals(fieldName)) { + deserializedMicrosoftGraphPasswordCredentialInner.customKeyIdentifier + = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString())); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphPasswordCredentialInner.displayName = reader.getString(); + } else if ("endDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPasswordCredentialInner.endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("hint".equals(fieldName)) { + deserializedMicrosoftGraphPasswordCredentialInner.hint = reader.getString(); + } else if ("keyId".equals(fieldName)) { + deserializedMicrosoftGraphPasswordCredentialInner.keyId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("secretText".equals(fieldName)) { + deserializedMicrosoftGraphPasswordCredentialInner.secretText = reader.getString(); + } else if ("startDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPasswordCredentialInner.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPasswordCredentialInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPasswordCredentialInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPasswordProfile.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPasswordProfile.java index 2e3cf194b1943..875ac89296754 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPasswordProfile.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPasswordProfile.java @@ -5,52 +5,54 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** passwordProfile. */ +/** + * passwordProfile. + */ @Fluent -public final class MicrosoftGraphPasswordProfile { +public final class MicrosoftGraphPasswordProfile implements JsonSerializable { /* * true if the user must change her password on the next login; otherwise false. */ - @JsonProperty(value = "forceChangePasswordNextSignIn") private Boolean forceChangePasswordNextSignIn; /* - * If true, at next sign-in, the user must perform a multi-factor authentication (MFA) before being forced to - * change their password. The behavior is identical to forceChangePasswordNextSignIn except that the user is - * required to first perform a multi-factor authentication before password change. After a password change, this - * property will be automatically reset to false. If not set, default is false. + * If true, at next sign-in, the user must perform a multi-factor authentication (MFA) before being forced to change + * their password. The behavior is identical to forceChangePasswordNextSignIn except that the user is required to + * first perform a multi-factor authentication before password change. After a password change, this property will + * be automatically reset to false. If not set, default is false. */ - @JsonProperty(value = "forceChangePasswordNextSignInWithMfa") private Boolean forceChangePasswordNextSignInWithMfa; /* - * The password for the user. This property is required when a user is created. It can be updated, but the user - * will be required to change the password on the next login. The password must satisfy minimum requirements as - * specified by the user’s passwordPolicies property. By default, a strong password is required. + * The password for the user. This property is required when a user is created. It can be updated, but the user will + * be required to change the password on the next login. The password must satisfy minimum requirements as specified + * by the user’s passwordPolicies property. By default, a strong password is required. */ - @JsonProperty(value = "password") private String password; /* * passwordProfile */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPasswordProfile class. */ + /** + * Creates an instance of MicrosoftGraphPasswordProfile class. + */ public MicrosoftGraphPasswordProfile() { } /** * Get the forceChangePasswordNextSignIn property: true if the user must change her password on the next login; * otherwise false. - * + * * @return the forceChangePasswordNextSignIn value. */ public Boolean forceChangePasswordNextSignIn() { @@ -60,7 +62,7 @@ public Boolean forceChangePasswordNextSignIn() { /** * Set the forceChangePasswordNextSignIn property: true if the user must change her password on the next login; * otherwise false. - * + * * @param forceChangePasswordNextSignIn the forceChangePasswordNextSignIn value to set. * @return the MicrosoftGraphPasswordProfile object itself. */ @@ -75,7 +77,7 @@ public MicrosoftGraphPasswordProfile withForceChangePasswordNextSignIn(Boolean f * forceChangePasswordNextSignIn except that the user is required to first perform a multi-factor authentication * before password change. After a password change, this property will be automatically reset to false. If not set, * default is false. - * + * * @return the forceChangePasswordNextSignInWithMfa value. */ public Boolean forceChangePasswordNextSignInWithMfa() { @@ -88,12 +90,12 @@ public Boolean forceChangePasswordNextSignInWithMfa() { * forceChangePasswordNextSignIn except that the user is required to first perform a multi-factor authentication * before password change. After a password change, this property will be automatically reset to false. If not set, * default is false. - * + * * @param forceChangePasswordNextSignInWithMfa the forceChangePasswordNextSignInWithMfa value to set. * @return the MicrosoftGraphPasswordProfile object itself. */ - public MicrosoftGraphPasswordProfile withForceChangePasswordNextSignInWithMfa( - Boolean forceChangePasswordNextSignInWithMfa) { + public MicrosoftGraphPasswordProfile + withForceChangePasswordNextSignInWithMfa(Boolean forceChangePasswordNextSignInWithMfa) { this.forceChangePasswordNextSignInWithMfa = forceChangePasswordNextSignInWithMfa; return this; } @@ -103,7 +105,7 @@ public MicrosoftGraphPasswordProfile withForceChangePasswordNextSignInWithMfa( * updated, but the user will be required to change the password on the next login. The password must satisfy * minimum requirements as specified by the user’s passwordPolicies property. By default, a strong password is * required. - * + * * @return the password value. */ public String password() { @@ -115,7 +117,7 @@ public String password() { * updated, but the user will be required to change the password on the next login. The password must satisfy * minimum requirements as specified by the user’s passwordPolicies property. By default, a strong password is * required. - * + * * @param password the password value to set. * @return the MicrosoftGraphPasswordProfile object itself. */ @@ -126,17 +128,16 @@ public MicrosoftGraphPasswordProfile withPassword(String password) { /** * Get the additionalProperties property: passwordProfile. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: passwordProfile. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPasswordProfile object itself. */ @@ -145,19 +146,67 @@ public MicrosoftGraphPasswordProfile withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("forceChangePasswordNextSignIn", this.forceChangePasswordNextSignIn); + jsonWriter.writeBooleanField("forceChangePasswordNextSignInWithMfa", this.forceChangePasswordNextSignInWithMfa); + jsonWriter.writeStringField("password", this.password); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPasswordProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPasswordProfile 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 MicrosoftGraphPasswordProfile. + */ + public static MicrosoftGraphPasswordProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPasswordProfile deserializedMicrosoftGraphPasswordProfile + = new MicrosoftGraphPasswordProfile(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("forceChangePasswordNextSignIn".equals(fieldName)) { + deserializedMicrosoftGraphPasswordProfile.forceChangePasswordNextSignIn + = reader.getNullable(JsonReader::getBoolean); + } else if ("forceChangePasswordNextSignInWithMfa".equals(fieldName)) { + deserializedMicrosoftGraphPasswordProfile.forceChangePasswordNextSignInWithMfa + = reader.getNullable(JsonReader::getBoolean); + } else if ("password".equals(fieldName)) { + deserializedMicrosoftGraphPasswordProfile.password = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPasswordProfile.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPasswordProfile; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPatternedRecurrence.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPatternedRecurrence.java index ed22415eed18f..d423d513f4e56 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPatternedRecurrence.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPatternedRecurrence.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** patternedRecurrence. */ +/** + * patternedRecurrence. + */ @Fluent -public final class MicrosoftGraphPatternedRecurrence { +public final class MicrosoftGraphPatternedRecurrence implements JsonSerializable { /* * recurrencePattern */ - @JsonProperty(value = "pattern") private MicrosoftGraphRecurrencePattern pattern; /* * recurrenceRange */ - @JsonProperty(value = "range") private MicrosoftGraphRecurrenceRange range; /* * patternedRecurrence */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPatternedRecurrence class. */ + /** + * Creates an instance of MicrosoftGraphPatternedRecurrence class. + */ public MicrosoftGraphPatternedRecurrence() { } /** * Get the pattern property: recurrencePattern. - * + * * @return the pattern value. */ public MicrosoftGraphRecurrencePattern pattern() { @@ -47,7 +50,7 @@ public MicrosoftGraphRecurrencePattern pattern() { /** * Set the pattern property: recurrencePattern. - * + * * @param pattern the pattern value to set. * @return the MicrosoftGraphPatternedRecurrence object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphPatternedRecurrence withPattern(MicrosoftGraphRecurrencePat /** * Get the range property: recurrenceRange. - * + * * @return the range value. */ public MicrosoftGraphRecurrenceRange range() { @@ -67,7 +70,7 @@ public MicrosoftGraphRecurrenceRange range() { /** * Set the range property: recurrenceRange. - * + * * @param range the range value to set. * @return the MicrosoftGraphPatternedRecurrence object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphPatternedRecurrence withRange(MicrosoftGraphRecurrenceRange /** * Get the additionalProperties property: patternedRecurrence. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: patternedRecurrence. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPatternedRecurrence object itself. */ @@ -97,17 +99,9 @@ public MicrosoftGraphPatternedRecurrence withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -118,4 +112,57 @@ public void validate() { range().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("pattern", this.pattern); + jsonWriter.writeJsonField("range", this.range); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPatternedRecurrence from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPatternedRecurrence 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 MicrosoftGraphPatternedRecurrence. + */ + public static MicrosoftGraphPatternedRecurrence fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPatternedRecurrence deserializedMicrosoftGraphPatternedRecurrence + = new MicrosoftGraphPatternedRecurrence(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pattern".equals(fieldName)) { + deserializedMicrosoftGraphPatternedRecurrence.pattern + = MicrosoftGraphRecurrencePattern.fromJson(reader); + } else if ("range".equals(fieldName)) { + deserializedMicrosoftGraphPatternedRecurrence.range + = MicrosoftGraphRecurrenceRange.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPatternedRecurrence.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPatternedRecurrence; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPendingContentUpdate.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPendingContentUpdate.java index f783fa232eb47..58d9f191eb28e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPendingContentUpdate.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPendingContentUpdate.java @@ -5,35 +5,41 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** pendingContentUpdate. */ +/** + * pendingContentUpdate. + */ @Fluent -public final class MicrosoftGraphPendingContentUpdate { +public final class MicrosoftGraphPendingContentUpdate implements JsonSerializable { /* * Date and time the pending binary operation was queued in UTC time. Read-only. */ - @JsonProperty(value = "queuedDateTime") private OffsetDateTime queuedDateTime; /* * pendingContentUpdate */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPendingContentUpdate class. */ + /** + * Creates an instance of MicrosoftGraphPendingContentUpdate class. + */ public MicrosoftGraphPendingContentUpdate() { } /** * Get the queuedDateTime property: Date and time the pending binary operation was queued in UTC time. Read-only. - * + * * @return the queuedDateTime value. */ public OffsetDateTime queuedDateTime() { @@ -42,7 +48,7 @@ public OffsetDateTime queuedDateTime() { /** * Set the queuedDateTime property: Date and time the pending binary operation was queued in UTC time. Read-only. - * + * * @param queuedDateTime the queuedDateTime value to set. * @return the MicrosoftGraphPendingContentUpdate object itself. */ @@ -53,17 +59,16 @@ public MicrosoftGraphPendingContentUpdate withQueuedDateTime(OffsetDateTime queu /** * Get the additionalProperties property: pendingContentUpdate. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: pendingContentUpdate. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPendingContentUpdate object itself. */ @@ -72,19 +77,61 @@ public MicrosoftGraphPendingContentUpdate withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("queuedDateTime", + this.queuedDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.queuedDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPendingContentUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPendingContentUpdate 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 MicrosoftGraphPendingContentUpdate. + */ + public static MicrosoftGraphPendingContentUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPendingContentUpdate deserializedMicrosoftGraphPendingContentUpdate + = new MicrosoftGraphPendingContentUpdate(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("queuedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPendingContentUpdate.queuedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPendingContentUpdate.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPendingContentUpdate; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPendingOperations.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPendingOperations.java index 5814a57c41a48..9adac5523b9ea 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPendingOperations.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPendingOperations.java @@ -5,34 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** pendingOperations. */ +/** + * pendingOperations. + */ @Fluent -public final class MicrosoftGraphPendingOperations { +public final class MicrosoftGraphPendingOperations implements JsonSerializable { /* * pendingContentUpdate */ - @JsonProperty(value = "pendingContentUpdate") private MicrosoftGraphPendingContentUpdate pendingContentUpdate; /* * pendingOperations */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPendingOperations class. */ + /** + * Creates an instance of MicrosoftGraphPendingOperations class. + */ public MicrosoftGraphPendingOperations() { } /** * Get the pendingContentUpdate property: pendingContentUpdate. - * + * * @return the pendingContentUpdate value. */ public MicrosoftGraphPendingContentUpdate pendingContentUpdate() { @@ -41,29 +45,28 @@ public MicrosoftGraphPendingContentUpdate pendingContentUpdate() { /** * Set the pendingContentUpdate property: pendingContentUpdate. - * + * * @param pendingContentUpdate the pendingContentUpdate value to set. * @return the MicrosoftGraphPendingOperations object itself. */ - public MicrosoftGraphPendingOperations withPendingContentUpdate( - MicrosoftGraphPendingContentUpdate pendingContentUpdate) { + public MicrosoftGraphPendingOperations + withPendingContentUpdate(MicrosoftGraphPendingContentUpdate pendingContentUpdate) { this.pendingContentUpdate = pendingContentUpdate; return this; } /** * Get the additionalProperties property: pendingOperations. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: pendingOperations. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPendingOperations object itself. */ @@ -72,17 +75,9 @@ public MicrosoftGraphPendingOperations withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -90,4 +85,53 @@ public void validate() { pendingContentUpdate().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("pendingContentUpdate", this.pendingContentUpdate); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPendingOperations from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPendingOperations 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 MicrosoftGraphPendingOperations. + */ + public static MicrosoftGraphPendingOperations fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPendingOperations deserializedMicrosoftGraphPendingOperations + = new MicrosoftGraphPendingOperations(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pendingContentUpdate".equals(fieldName)) { + deserializedMicrosoftGraphPendingOperations.pendingContentUpdate + = MicrosoftGraphPendingContentUpdate.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPendingOperations.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPendingOperations; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermission.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermission.java index a532d061df1e2..e3cf41fcd8c81 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermission.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermission.java @@ -5,87 +5,84 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** permission. */ +/** + * permission. + */ @Fluent public final class MicrosoftGraphPermission extends MicrosoftGraphEntity { /* * A format of yyyy-MM-ddTHH:mm:ssZ of DateTimeOffset indicates the expiration time of the permission. * DateTime.MinValue indicates there is no expiration set for this permission. Optional. */ - @JsonProperty(value = "expirationDateTime") private OffsetDateTime expirationDateTime; /* * identitySet */ - @JsonProperty(value = "grantedTo") private MicrosoftGraphIdentitySet grantedTo; /* * For link type permissions, the details of the users to whom permission was granted. Read-only. */ - @JsonProperty(value = "grantedToIdentities") private List grantedToIdentities; /* - * This indicates whether password is set for this permission, it's only showing in response. Optional and - * Read-only and for OneDrive Personal only. + * This indicates whether password is set for this permission, it's only showing in response. Optional and Read-only + * and for OneDrive Personal only. */ - @JsonProperty(value = "hasPassword") private Boolean hasPassword; /* * itemReference */ - @JsonProperty(value = "inheritedFrom") private MicrosoftGraphItemReference inheritedFrom; /* * sharingInvitation */ - @JsonProperty(value = "invitation") private MicrosoftGraphSharingInvitation invitation; /* * sharingLink */ - @JsonProperty(value = "link") private MicrosoftGraphSharingLink link; /* * The type of permission, e.g. read. See below for the full list of roles. Read-only. */ - @JsonProperty(value = "roles") private List roles; /* * A unique token that can be used to access this shared item via the **shares** API. Read-only. */ - @JsonProperty(value = "shareId") private String shareId; /* * permission */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPermission class. */ + /** + * Creates an instance of MicrosoftGraphPermission class. + */ public MicrosoftGraphPermission() { } /** * Get the expirationDateTime property: A format of yyyy-MM-ddTHH:mm:ssZ of DateTimeOffset indicates the expiration * time of the permission. DateTime.MinValue indicates there is no expiration set for this permission. Optional. - * + * * @return the expirationDateTime value. */ public OffsetDateTime expirationDateTime() { @@ -95,7 +92,7 @@ public OffsetDateTime expirationDateTime() { /** * Set the expirationDateTime property: A format of yyyy-MM-ddTHH:mm:ssZ of DateTimeOffset indicates the expiration * time of the permission. DateTime.MinValue indicates there is no expiration set for this permission. Optional. - * + * * @param expirationDateTime the expirationDateTime value to set. * @return the MicrosoftGraphPermission object itself. */ @@ -106,7 +103,7 @@ public MicrosoftGraphPermission withExpirationDateTime(OffsetDateTime expiration /** * Get the grantedTo property: identitySet. - * + * * @return the grantedTo value. */ public MicrosoftGraphIdentitySet grantedTo() { @@ -115,7 +112,7 @@ public MicrosoftGraphIdentitySet grantedTo() { /** * Set the grantedTo property: identitySet. - * + * * @param grantedTo the grantedTo value to set. * @return the MicrosoftGraphPermission object itself. */ @@ -127,7 +124,7 @@ public MicrosoftGraphPermission withGrantedTo(MicrosoftGraphIdentitySet grantedT /** * Get the grantedToIdentities property: For link type permissions, the details of the users to whom permission was * granted. Read-only. - * + * * @return the grantedToIdentities value. */ public List grantedToIdentities() { @@ -137,7 +134,7 @@ public List grantedToIdentities() { /** * Set the grantedToIdentities property: For link type permissions, the details of the users to whom permission was * granted. Read-only. - * + * * @param grantedToIdentities the grantedToIdentities value to set. * @return the MicrosoftGraphPermission object itself. */ @@ -149,7 +146,7 @@ public MicrosoftGraphPermission withGrantedToIdentities(List roles() { @@ -239,7 +236,7 @@ public List roles() { /** * Set the roles property: The type of permission, e.g. read. See below for the full list of roles. Read-only. - * + * * @param roles the roles value to set. * @return the MicrosoftGraphPermission object itself. */ @@ -251,7 +248,7 @@ public MicrosoftGraphPermission withRoles(List roles) { /** * Get the shareId property: A unique token that can be used to access this shared item via the **shares** API. * Read-only. - * + * * @return the shareId value. */ public String shareId() { @@ -261,7 +258,7 @@ public String shareId() { /** * Set the shareId property: A unique token that can be used to access this shared item via the **shares** API. * Read-only. - * + * * @param shareId the shareId value to set. * @return the MicrosoftGraphPermission object itself. */ @@ -272,17 +269,16 @@ public MicrosoftGraphPermission withShareId(String shareId) { /** * Get the additionalProperties property: permission. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: permission. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPermission object itself. */ @@ -291,15 +287,9 @@ public MicrosoftGraphPermission withAdditionalProperties(Map add return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPermission withId(String id) { super.withId(id); @@ -308,7 +298,7 @@ public MicrosoftGraphPermission withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -330,4 +320,86 @@ public void validate() { link().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("expirationDateTime", + this.expirationDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateTime)); + jsonWriter.writeJsonField("grantedTo", this.grantedTo); + jsonWriter.writeArrayField("grantedToIdentities", this.grantedToIdentities, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("hasPassword", this.hasPassword); + jsonWriter.writeJsonField("inheritedFrom", this.inheritedFrom); + jsonWriter.writeJsonField("invitation", this.invitation); + jsonWriter.writeJsonField("link", this.link); + jsonWriter.writeArrayField("roles", this.roles, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("shareId", this.shareId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPermission from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPermission 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 MicrosoftGraphPermission. + */ + public static MicrosoftGraphPermission fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPermission deserializedMicrosoftGraphPermission = new MicrosoftGraphPermission(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPermission.withId(reader.getString()); + } else if ("expirationDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPermission.expirationDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("grantedTo".equals(fieldName)) { + deserializedMicrosoftGraphPermission.grantedTo = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("grantedToIdentities".equals(fieldName)) { + List grantedToIdentities + = reader.readArray(reader1 -> MicrosoftGraphIdentitySet.fromJson(reader1)); + deserializedMicrosoftGraphPermission.grantedToIdentities = grantedToIdentities; + } else if ("hasPassword".equals(fieldName)) { + deserializedMicrosoftGraphPermission.hasPassword = reader.getNullable(JsonReader::getBoolean); + } else if ("inheritedFrom".equals(fieldName)) { + deserializedMicrosoftGraphPermission.inheritedFrom = MicrosoftGraphItemReference.fromJson(reader); + } else if ("invitation".equals(fieldName)) { + deserializedMicrosoftGraphPermission.invitation = MicrosoftGraphSharingInvitation.fromJson(reader); + } else if ("link".equals(fieldName)) { + deserializedMicrosoftGraphPermission.link = MicrosoftGraphSharingLink.fromJson(reader); + } else if ("roles".equals(fieldName)) { + List roles = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphPermission.roles = roles; + } else if ("shareId".equals(fieldName)) { + deserializedMicrosoftGraphPermission.shareId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPermission.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPermission; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermissionClassificationType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermissionClassificationType.java index 2594a9d8fe07b..dbb9469986192 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermissionClassificationType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermissionClassificationType.java @@ -5,28 +5,37 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** permissionClassificationType. */ +/** + * permissionClassificationType. + */ public final class MicrosoftGraphPermissionClassificationType extends ExpandableStringEnum { - /** Static value low for MicrosoftGraphPermissionClassificationType. */ + /** + * Static value low for MicrosoftGraphPermissionClassificationType. + */ public static final MicrosoftGraphPermissionClassificationType LOW = fromString("low"); - /** Static value medium for MicrosoftGraphPermissionClassificationType. */ + /** + * Static value medium for MicrosoftGraphPermissionClassificationType. + */ public static final MicrosoftGraphPermissionClassificationType MEDIUM = fromString("medium"); - /** Static value high for MicrosoftGraphPermissionClassificationType. */ + /** + * Static value high for MicrosoftGraphPermissionClassificationType. + */ public static final MicrosoftGraphPermissionClassificationType HIGH = fromString("high"); - /** Static value unknownFutureValue for MicrosoftGraphPermissionClassificationType. */ - public static final MicrosoftGraphPermissionClassificationType UNKNOWN_FUTURE_VALUE = - fromString("unknownFutureValue"); + /** + * Static value unknownFutureValue for MicrosoftGraphPermissionClassificationType. + */ + public static final MicrosoftGraphPermissionClassificationType UNKNOWN_FUTURE_VALUE + = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphPermissionClassificationType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -35,18 +44,17 @@ public MicrosoftGraphPermissionClassificationType() { /** * Creates or finds a MicrosoftGraphPermissionClassificationType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphPermissionClassificationType. */ - @JsonCreator public static MicrosoftGraphPermissionClassificationType fromString(String name) { return fromString(name, MicrosoftGraphPermissionClassificationType.class); } /** * Gets known MicrosoftGraphPermissionClassificationType values. - * + * * @return known MicrosoftGraphPermissionClassificationType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermissionScope.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermissionScope.java index f785fe68a4216..69393b3d112cc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermissionScope.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPermissionScope.java @@ -5,88 +5,85 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** permissionScope. */ +/** + * permissionScope. + */ @Fluent -public final class MicrosoftGraphPermissionScope { +public final class MicrosoftGraphPermissionScope implements JsonSerializable { /* * A description of the delegated permissions, intended to be read by an administrator granting the permission on * behalf of all users. This text appears in tenant-wide admin consent experiences. */ - @JsonProperty(value = "adminConsentDescription") private String adminConsentDescription; /* * The permission's title, intended to be read by an administrator granting the permission on behalf of all users. */ - @JsonProperty(value = "adminConsentDisplayName") private String adminConsentDisplayName; /* * Unique delegated permission identifier inside the collection of delegated permissions defined for a resource * application. */ - @JsonProperty(value = "id") private UUID id; /* * When creating or updating a permission, this property must be set to true (which is the default). To delete a - * permission, this property must first be set to false. At that point, in a subsequent call, the permission may - * be removed. + * permission, this property must first be set to false. At that point, in a subsequent call, the permission may be + * removed. */ - @JsonProperty(value = "isEnabled") private Boolean isEnabled; /* * The origin property. */ - @JsonProperty(value = "origin") private String origin; /* - * Specifies whether this delegated permission should be considered safe for non-admin users to consent to on - * behalf of themselves, or whether an administrator should be required for consent to the permissions. This will - * be the default behavior, but each customer can choose to customize the behavior in their organization (by - * allowing, restricting or limiting user consent to this delegated permission.) + * Specifies whether this delegated permission should be considered safe for non-admin users to consent to on behalf + * of themselves, or whether an administrator should be required for consent to the permissions. This will be the + * default behavior, but each customer can choose to customize the behavior in their organization (by allowing, + * restricting or limiting user consent to this delegated permission.) */ - @JsonProperty(value = "type") private String type; /* * A description of the delegated permissions, intended to be read by a user granting the permission on their own * behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves. */ - @JsonProperty(value = "userConsentDescription") private String userConsentDescription; /* * A title for the permission, intended to be read by a user granting the permission on their own behalf. This text * appears in consent experiences where the user is consenting only on behalf of themselves. */ - @JsonProperty(value = "userConsentDisplayName") private String userConsentDisplayName; /* * Specifies the value to include in the scp (scope) claim in access tokens. Must not exceed 120 characters in - * length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as - * characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. + * length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in + * the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. */ - @JsonProperty(value = "value") private String value; /* * permissionScope */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPermissionScope class. */ + /** + * Creates an instance of MicrosoftGraphPermissionScope class. + */ public MicrosoftGraphPermissionScope() { } @@ -94,7 +91,7 @@ public MicrosoftGraphPermissionScope() { * Get the adminConsentDescription property: A description of the delegated permissions, intended to be read by an * administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent * experiences. - * + * * @return the adminConsentDescription value. */ public String adminConsentDescription() { @@ -105,7 +102,7 @@ public String adminConsentDescription() { * Set the adminConsentDescription property: A description of the delegated permissions, intended to be read by an * administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent * experiences. - * + * * @param adminConsentDescription the adminConsentDescription value to set. * @return the MicrosoftGraphPermissionScope object itself. */ @@ -117,7 +114,7 @@ public MicrosoftGraphPermissionScope withAdminConsentDescription(String adminCon /** * Get the adminConsentDisplayName property: The permission's title, intended to be read by an administrator * granting the permission on behalf of all users. - * + * * @return the adminConsentDisplayName value. */ public String adminConsentDisplayName() { @@ -127,7 +124,7 @@ public String adminConsentDisplayName() { /** * Set the adminConsentDisplayName property: The permission's title, intended to be read by an administrator * granting the permission on behalf of all users. - * + * * @param adminConsentDisplayName the adminConsentDisplayName value to set. * @return the MicrosoftGraphPermissionScope object itself. */ @@ -139,7 +136,7 @@ public MicrosoftGraphPermissionScope withAdminConsentDisplayName(String adminCon /** * Get the id property: Unique delegated permission identifier inside the collection of delegated permissions * defined for a resource application. - * + * * @return the id value. */ public UUID id() { @@ -149,7 +146,7 @@ public UUID id() { /** * Set the id property: Unique delegated permission identifier inside the collection of delegated permissions * defined for a resource application. - * + * * @param id the id value to set. * @return the MicrosoftGraphPermissionScope object itself. */ @@ -162,7 +159,7 @@ public MicrosoftGraphPermissionScope withId(UUID id) { * Get the isEnabled property: When creating or updating a permission, this property must be set to true (which is * the default). To delete a permission, this property must first be set to false. At that point, in a subsequent * call, the permission may be removed. - * + * * @return the isEnabled value. */ public Boolean isEnabled() { @@ -173,7 +170,7 @@ public Boolean isEnabled() { * Set the isEnabled property: When creating or updating a permission, this property must be set to true (which is * the default). To delete a permission, this property must first be set to false. At that point, in a subsequent * call, the permission may be removed. - * + * * @param isEnabled the isEnabled value to set. * @return the MicrosoftGraphPermissionScope object itself. */ @@ -184,7 +181,7 @@ public MicrosoftGraphPermissionScope withIsEnabled(Boolean isEnabled) { /** * Get the origin property: The origin property. - * + * * @return the origin value. */ public String origin() { @@ -193,7 +190,7 @@ public String origin() { /** * Set the origin property: The origin property. - * + * * @param origin the origin value to set. * @return the MicrosoftGraphPermissionScope object itself. */ @@ -207,7 +204,7 @@ public MicrosoftGraphPermissionScope withOrigin(String origin) { * to consent to on behalf of themselves, or whether an administrator should be required for consent to the * permissions. This will be the default behavior, but each customer can choose to customize the behavior in their * organization (by allowing, restricting or limiting user consent to this delegated permission.). - * + * * @return the type value. */ public String type() { @@ -219,7 +216,7 @@ public String type() { * to consent to on behalf of themselves, or whether an administrator should be required for consent to the * permissions. This will be the default behavior, but each customer can choose to customize the behavior in their * organization (by allowing, restricting or limiting user consent to this delegated permission.). - * + * * @param type the type value to set. * @return the MicrosoftGraphPermissionScope object itself. */ @@ -232,7 +229,7 @@ public MicrosoftGraphPermissionScope withType(String type) { * Get the userConsentDescription property: A description of the delegated permissions, intended to be read by a * user granting the permission on their own behalf. This text appears in consent experiences where the user is * consenting only on behalf of themselves. - * + * * @return the userConsentDescription value. */ public String userConsentDescription() { @@ -243,7 +240,7 @@ public String userConsentDescription() { * Set the userConsentDescription property: A description of the delegated permissions, intended to be read by a * user granting the permission on their own behalf. This text appears in consent experiences where the user is * consenting only on behalf of themselves. - * + * * @param userConsentDescription the userConsentDescription value to set. * @return the MicrosoftGraphPermissionScope object itself. */ @@ -256,7 +253,7 @@ public MicrosoftGraphPermissionScope withUserConsentDescription(String userConse * Get the userConsentDisplayName property: A title for the permission, intended to be read by a user granting the * permission on their own behalf. This text appears in consent experiences where the user is consenting only on * behalf of themselves. - * + * * @return the userConsentDisplayName value. */ public String userConsentDisplayName() { @@ -267,7 +264,7 @@ public String userConsentDisplayName() { * Set the userConsentDisplayName property: A title for the permission, intended to be read by a user granting the * permission on their own behalf. This text appears in consent experiences where the user is consenting only on * behalf of themselves. - * + * * @param userConsentDisplayName the userConsentDisplayName value to set. * @return the MicrosoftGraphPermissionScope object itself. */ @@ -278,10 +275,10 @@ public MicrosoftGraphPermissionScope withUserConsentDisplayName(String userConse /** * Get the value property: Specifies the value to include in the scp (scope) claim in access tokens. Must not exceed - * 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as - * well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not - * allowed. - * + * 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } + * ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are + * not allowed. + * * @return the value value. */ public String value() { @@ -290,10 +287,10 @@ public String value() { /** * Set the value property: Specifies the value to include in the scp (scope) claim in access tokens. Must not exceed - * 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as - * well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not - * allowed. - * + * 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } + * ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are + * not allowed. + * * @param value the value value to set. * @return the MicrosoftGraphPermissionScope object itself. */ @@ -304,17 +301,16 @@ public MicrosoftGraphPermissionScope withValue(String value) { /** * Get the additionalProperties property: permissionScope. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: permissionScope. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPermissionScope object itself. */ @@ -323,19 +319,84 @@ public MicrosoftGraphPermissionScope withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("adminConsentDescription", this.adminConsentDescription); + jsonWriter.writeStringField("adminConsentDisplayName", this.adminConsentDisplayName); + jsonWriter.writeStringField("id", Objects.toString(this.id, null)); + jsonWriter.writeBooleanField("isEnabled", this.isEnabled); + jsonWriter.writeStringField("origin", this.origin); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("userConsentDescription", this.userConsentDescription); + jsonWriter.writeStringField("userConsentDisplayName", this.userConsentDisplayName); + jsonWriter.writeStringField("value", this.value); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPermissionScope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPermissionScope 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 MicrosoftGraphPermissionScope. + */ + public static MicrosoftGraphPermissionScope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPermissionScope deserializedMicrosoftGraphPermissionScope + = new MicrosoftGraphPermissionScope(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("adminConsentDescription".equals(fieldName)) { + deserializedMicrosoftGraphPermissionScope.adminConsentDescription = reader.getString(); + } else if ("adminConsentDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphPermissionScope.adminConsentDisplayName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPermissionScope.id + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("isEnabled".equals(fieldName)) { + deserializedMicrosoftGraphPermissionScope.isEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("origin".equals(fieldName)) { + deserializedMicrosoftGraphPermissionScope.origin = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphPermissionScope.type = reader.getString(); + } else if ("userConsentDescription".equals(fieldName)) { + deserializedMicrosoftGraphPermissionScope.userConsentDescription = reader.getString(); + } else if ("userConsentDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphPermissionScope.userConsentDisplayName = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedMicrosoftGraphPermissionScope.value = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPermissionScope.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPermissionScope; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPerson.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPerson.java index 6b56524bffa4f..700afc9756355 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPerson.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPerson.java @@ -5,111 +5,97 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** person. */ +/** + * person. + */ @Fluent public final class MicrosoftGraphPerson extends MicrosoftGraphEntity { /* * The person's birthday. */ - @JsonProperty(value = "birthday") private String birthday; /* * The name of the person's company. */ - @JsonProperty(value = "companyName") private String companyName; /* * The person's department. */ - @JsonProperty(value = "department") private String department; /* * The person's display name. */ - @JsonProperty(value = "displayName") private String displayName; /* * The person's given name. */ - @JsonProperty(value = "givenName") private String givenName; /* * The instant message voice over IP (VOIP) session initiation protocol (SIP) address for the user. Read-only. */ - @JsonProperty(value = "imAddress") private String imAddress; /* * true if the user has flagged this person as a favorite. */ - @JsonProperty(value = "isFavorite") private Boolean isFavorite; /* * The person's job title. */ - @JsonProperty(value = "jobTitle") private String jobTitle; /* * The location of the person's office. */ - @JsonProperty(value = "officeLocation") private String officeLocation; /* * Free-form notes that the user has taken about this person. */ - @JsonProperty(value = "personNotes") private String personNotes; /* * personType */ - @JsonProperty(value = "personType") private MicrosoftGraphPersonType personType; /* * The person's phone numbers. */ - @JsonProperty(value = "phones") private List phones; /* * The person's addresses. */ - @JsonProperty(value = "postalAddresses") private List postalAddresses; /* * The person's profession. */ - @JsonProperty(value = "profession") private String profession; /* * The person's email addresses. */ - @JsonProperty(value = "scoredEmailAddresses") private List scoredEmailAddresses; /* * The person's surname. */ - @JsonProperty(value = "surname") private String surname; /* @@ -117,33 +103,32 @@ public final class MicrosoftGraphPerson extends MicrosoftGraphEntity { * Internet standard RFC 822. By convention, this should map to the person's email name. The general format is * alias@domain. */ - @JsonProperty(value = "userPrincipalName") private String userPrincipalName; /* * The person's websites. */ - @JsonProperty(value = "websites") private List websites; /* * The phonetic Japanese name of the person's company. */ - @JsonProperty(value = "yomiCompany") private String yomiCompany; /* * person */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPerson class. */ + /** + * Creates an instance of MicrosoftGraphPerson class. + */ public MicrosoftGraphPerson() { } /** * Get the birthday property: The person's birthday. - * + * * @return the birthday value. */ public String birthday() { @@ -152,7 +137,7 @@ public String birthday() { /** * Set the birthday property: The person's birthday. - * + * * @param birthday the birthday value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -163,7 +148,7 @@ public MicrosoftGraphPerson withBirthday(String birthday) { /** * Get the companyName property: The name of the person's company. - * + * * @return the companyName value. */ public String companyName() { @@ -172,7 +157,7 @@ public String companyName() { /** * Set the companyName property: The name of the person's company. - * + * * @param companyName the companyName value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -183,7 +168,7 @@ public MicrosoftGraphPerson withCompanyName(String companyName) { /** * Get the department property: The person's department. - * + * * @return the department value. */ public String department() { @@ -192,7 +177,7 @@ public String department() { /** * Set the department property: The person's department. - * + * * @param department the department value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -203,7 +188,7 @@ public MicrosoftGraphPerson withDepartment(String department) { /** * Get the displayName property: The person's display name. - * + * * @return the displayName value. */ public String displayName() { @@ -212,7 +197,7 @@ public String displayName() { /** * Set the displayName property: The person's display name. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -223,7 +208,7 @@ public MicrosoftGraphPerson withDisplayName(String displayName) { /** * Get the givenName property: The person's given name. - * + * * @return the givenName value. */ public String givenName() { @@ -232,7 +217,7 @@ public String givenName() { /** * Set the givenName property: The person's given name. - * + * * @param givenName the givenName value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -244,7 +229,7 @@ public MicrosoftGraphPerson withGivenName(String givenName) { /** * Get the imAddress property: The instant message voice over IP (VOIP) session initiation protocol (SIP) address * for the user. Read-only. - * + * * @return the imAddress value. */ public String imAddress() { @@ -254,7 +239,7 @@ public String imAddress() { /** * Set the imAddress property: The instant message voice over IP (VOIP) session initiation protocol (SIP) address * for the user. Read-only. - * + * * @param imAddress the imAddress value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -265,7 +250,7 @@ public MicrosoftGraphPerson withImAddress(String imAddress) { /** * Get the isFavorite property: true if the user has flagged this person as a favorite. - * + * * @return the isFavorite value. */ public Boolean isFavorite() { @@ -274,7 +259,7 @@ public Boolean isFavorite() { /** * Set the isFavorite property: true if the user has flagged this person as a favorite. - * + * * @param isFavorite the isFavorite value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -285,7 +270,7 @@ public MicrosoftGraphPerson withIsFavorite(Boolean isFavorite) { /** * Get the jobTitle property: The person's job title. - * + * * @return the jobTitle value. */ public String jobTitle() { @@ -294,7 +279,7 @@ public String jobTitle() { /** * Set the jobTitle property: The person's job title. - * + * * @param jobTitle the jobTitle value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -305,7 +290,7 @@ public MicrosoftGraphPerson withJobTitle(String jobTitle) { /** * Get the officeLocation property: The location of the person's office. - * + * * @return the officeLocation value. */ public String officeLocation() { @@ -314,7 +299,7 @@ public String officeLocation() { /** * Set the officeLocation property: The location of the person's office. - * + * * @param officeLocation the officeLocation value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -325,7 +310,7 @@ public MicrosoftGraphPerson withOfficeLocation(String officeLocation) { /** * Get the personNotes property: Free-form notes that the user has taken about this person. - * + * * @return the personNotes value. */ public String personNotes() { @@ -334,7 +319,7 @@ public String personNotes() { /** * Set the personNotes property: Free-form notes that the user has taken about this person. - * + * * @param personNotes the personNotes value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -345,7 +330,7 @@ public MicrosoftGraphPerson withPersonNotes(String personNotes) { /** * Get the personType property: personType. - * + * * @return the personType value. */ public MicrosoftGraphPersonType personType() { @@ -354,7 +339,7 @@ public MicrosoftGraphPersonType personType() { /** * Set the personType property: personType. - * + * * @param personType the personType value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -365,7 +350,7 @@ public MicrosoftGraphPerson withPersonType(MicrosoftGraphPersonType personType) /** * Get the phones property: The person's phone numbers. - * + * * @return the phones value. */ public List phones() { @@ -374,7 +359,7 @@ public List phones() { /** * Set the phones property: The person's phone numbers. - * + * * @param phones the phones value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -385,7 +370,7 @@ public MicrosoftGraphPerson withPhones(List phones) { /** * Get the postalAddresses property: The person's addresses. - * + * * @return the postalAddresses value. */ public List postalAddresses() { @@ -394,7 +379,7 @@ public List postalAddresses() { /** * Set the postalAddresses property: The person's addresses. - * + * * @param postalAddresses the postalAddresses value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -405,7 +390,7 @@ public MicrosoftGraphPerson withPostalAddresses(List pos /** * Get the profession property: The person's profession. - * + * * @return the profession value. */ public String profession() { @@ -414,7 +399,7 @@ public String profession() { /** * Set the profession property: The person's profession. - * + * * @param profession the profession value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -425,7 +410,7 @@ public MicrosoftGraphPerson withProfession(String profession) { /** * Get the scoredEmailAddresses property: The person's email addresses. - * + * * @return the scoredEmailAddresses value. */ public List scoredEmailAddresses() { @@ -434,7 +419,7 @@ public List scoredEmailAddresses() { /** * Set the scoredEmailAddresses property: The person's email addresses. - * + * * @param scoredEmailAddresses the scoredEmailAddresses value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -445,7 +430,7 @@ public MicrosoftGraphPerson withScoredEmailAddresses(List websites() { @@ -498,7 +483,7 @@ public List websites() { /** * Set the websites property: The person's websites. - * + * * @param websites the websites value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -509,7 +494,7 @@ public MicrosoftGraphPerson withWebsites(List websites) { /** * Get the yomiCompany property: The phonetic Japanese name of the person's company. - * + * * @return the yomiCompany value. */ public String yomiCompany() { @@ -518,7 +503,7 @@ public String yomiCompany() { /** * Set the yomiCompany property: The phonetic Japanese name of the person's company. - * + * * @param yomiCompany the yomiCompany value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -529,17 +514,16 @@ public MicrosoftGraphPerson withYomiCompany(String yomiCompany) { /** * Get the additionalProperties property: person. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: person. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPerson object itself. */ @@ -548,15 +532,9 @@ public MicrosoftGraphPerson withAdditionalProperties(Map additio return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPerson withId(String id) { super.withId(id); @@ -565,7 +543,7 @@ public MicrosoftGraphPerson withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -587,4 +565,118 @@ public void validate() { websites().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("birthday", this.birthday); + jsonWriter.writeStringField("companyName", this.companyName); + jsonWriter.writeStringField("department", this.department); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("givenName", this.givenName); + jsonWriter.writeStringField("imAddress", this.imAddress); + jsonWriter.writeBooleanField("isFavorite", this.isFavorite); + jsonWriter.writeStringField("jobTitle", this.jobTitle); + jsonWriter.writeStringField("officeLocation", this.officeLocation); + jsonWriter.writeStringField("personNotes", this.personNotes); + jsonWriter.writeJsonField("personType", this.personType); + jsonWriter.writeArrayField("phones", this.phones, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("postalAddresses", this.postalAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("profession", this.profession); + jsonWriter.writeArrayField("scoredEmailAddresses", this.scoredEmailAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("surname", this.surname); + jsonWriter.writeStringField("userPrincipalName", this.userPrincipalName); + jsonWriter.writeArrayField("websites", this.websites, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("yomiCompany", this.yomiCompany); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPerson from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPerson 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 MicrosoftGraphPerson. + */ + public static MicrosoftGraphPerson fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPerson deserializedMicrosoftGraphPerson = new MicrosoftGraphPerson(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPerson.withId(reader.getString()); + } else if ("birthday".equals(fieldName)) { + deserializedMicrosoftGraphPerson.birthday = reader.getString(); + } else if ("companyName".equals(fieldName)) { + deserializedMicrosoftGraphPerson.companyName = reader.getString(); + } else if ("department".equals(fieldName)) { + deserializedMicrosoftGraphPerson.department = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphPerson.displayName = reader.getString(); + } else if ("givenName".equals(fieldName)) { + deserializedMicrosoftGraphPerson.givenName = reader.getString(); + } else if ("imAddress".equals(fieldName)) { + deserializedMicrosoftGraphPerson.imAddress = reader.getString(); + } else if ("isFavorite".equals(fieldName)) { + deserializedMicrosoftGraphPerson.isFavorite = reader.getNullable(JsonReader::getBoolean); + } else if ("jobTitle".equals(fieldName)) { + deserializedMicrosoftGraphPerson.jobTitle = reader.getString(); + } else if ("officeLocation".equals(fieldName)) { + deserializedMicrosoftGraphPerson.officeLocation = reader.getString(); + } else if ("personNotes".equals(fieldName)) { + deserializedMicrosoftGraphPerson.personNotes = reader.getString(); + } else if ("personType".equals(fieldName)) { + deserializedMicrosoftGraphPerson.personType = MicrosoftGraphPersonType.fromJson(reader); + } else if ("phones".equals(fieldName)) { + List phones + = reader.readArray(reader1 -> MicrosoftGraphPhone.fromJson(reader1)); + deserializedMicrosoftGraphPerson.phones = phones; + } else if ("postalAddresses".equals(fieldName)) { + List postalAddresses + = reader.readArray(reader1 -> MicrosoftGraphLocation.fromJson(reader1)); + deserializedMicrosoftGraphPerson.postalAddresses = postalAddresses; + } else if ("profession".equals(fieldName)) { + deserializedMicrosoftGraphPerson.profession = reader.getString(); + } else if ("scoredEmailAddresses".equals(fieldName)) { + List scoredEmailAddresses + = reader.readArray(reader1 -> MicrosoftGraphScoredEmailAddress.fromJson(reader1)); + deserializedMicrosoftGraphPerson.scoredEmailAddresses = scoredEmailAddresses; + } else if ("surname".equals(fieldName)) { + deserializedMicrosoftGraphPerson.surname = reader.getString(); + } else if ("userPrincipalName".equals(fieldName)) { + deserializedMicrosoftGraphPerson.userPrincipalName = reader.getString(); + } else if ("websites".equals(fieldName)) { + List websites + = reader.readArray(reader1 -> MicrosoftGraphWebsite.fromJson(reader1)); + deserializedMicrosoftGraphPerson.websites = websites; + } else if ("yomiCompany".equals(fieldName)) { + deserializedMicrosoftGraphPerson.yomiCompany = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPerson.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPerson; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPersonOrGroupColumn.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPersonOrGroupColumn.java index a81fbf5372a86..f5c00391c4b4f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPersonOrGroupColumn.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPersonOrGroupColumn.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** personOrGroupColumn. */ +/** + * personOrGroupColumn. + */ @Fluent -public final class MicrosoftGraphPersonOrGroupColumn { +public final class MicrosoftGraphPersonOrGroupColumn implements JsonSerializable { /* * Indicates whether multiple values can be selected from the source. */ - @JsonProperty(value = "allowMultipleSelection") private Boolean allowMultipleSelection; /* * Whether to allow selection of people only, or people and groups. Must be one of peopleAndGroups or peopleOnly. */ - @JsonProperty(value = "chooseFromType") private String chooseFromType; /* * How to display the information about the person or group chosen. See below. */ - @JsonProperty(value = "displayAs") private String displayAs; /* * personOrGroupColumn */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPersonOrGroupColumn class. */ + /** + * Creates an instance of MicrosoftGraphPersonOrGroupColumn class. + */ public MicrosoftGraphPersonOrGroupColumn() { } /** * Get the allowMultipleSelection property: Indicates whether multiple values can be selected from the source. - * + * * @return the allowMultipleSelection value. */ public Boolean allowMultipleSelection() { @@ -53,7 +55,7 @@ public Boolean allowMultipleSelection() { /** * Set the allowMultipleSelection property: Indicates whether multiple values can be selected from the source. - * + * * @param allowMultipleSelection the allowMultipleSelection value to set. * @return the MicrosoftGraphPersonOrGroupColumn object itself. */ @@ -65,7 +67,7 @@ public MicrosoftGraphPersonOrGroupColumn withAllowMultipleSelection(Boolean allo /** * Get the chooseFromType property: Whether to allow selection of people only, or people and groups. Must be one of * peopleAndGroups or peopleOnly. - * + * * @return the chooseFromType value. */ public String chooseFromType() { @@ -75,7 +77,7 @@ public String chooseFromType() { /** * Set the chooseFromType property: Whether to allow selection of people only, or people and groups. Must be one of * peopleAndGroups or peopleOnly. - * + * * @param chooseFromType the chooseFromType value to set. * @return the MicrosoftGraphPersonOrGroupColumn object itself. */ @@ -86,7 +88,7 @@ public MicrosoftGraphPersonOrGroupColumn withChooseFromType(String chooseFromTyp /** * Get the displayAs property: How to display the information about the person or group chosen. See below. - * + * * @return the displayAs value. */ public String displayAs() { @@ -95,7 +97,7 @@ public String displayAs() { /** * Set the displayAs property: How to display the information about the person or group chosen. See below. - * + * * @param displayAs the displayAs value to set. * @return the MicrosoftGraphPersonOrGroupColumn object itself. */ @@ -106,17 +108,16 @@ public MicrosoftGraphPersonOrGroupColumn withDisplayAs(String displayAs) { /** * Get the additionalProperties property: personOrGroupColumn. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: personOrGroupColumn. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPersonOrGroupColumn object itself. */ @@ -125,19 +126,66 @@ public MicrosoftGraphPersonOrGroupColumn withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("allowMultipleSelection", this.allowMultipleSelection); + jsonWriter.writeStringField("chooseFromType", this.chooseFromType); + jsonWriter.writeStringField("displayAs", this.displayAs); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPersonOrGroupColumn from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPersonOrGroupColumn 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 MicrosoftGraphPersonOrGroupColumn. + */ + public static MicrosoftGraphPersonOrGroupColumn fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPersonOrGroupColumn deserializedMicrosoftGraphPersonOrGroupColumn + = new MicrosoftGraphPersonOrGroupColumn(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("allowMultipleSelection".equals(fieldName)) { + deserializedMicrosoftGraphPersonOrGroupColumn.allowMultipleSelection + = reader.getNullable(JsonReader::getBoolean); + } else if ("chooseFromType".equals(fieldName)) { + deserializedMicrosoftGraphPersonOrGroupColumn.chooseFromType = reader.getString(); + } else if ("displayAs".equals(fieldName)) { + deserializedMicrosoftGraphPersonOrGroupColumn.displayAs = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPersonOrGroupColumn.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPersonOrGroupColumn; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPersonType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPersonType.java index 52b0aac7a13be..4e191c913eda8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPersonType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPersonType.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** personType. */ +/** + * personType. + */ @Fluent -public final class MicrosoftGraphPersonType { +public final class MicrosoftGraphPersonType implements JsonSerializable { /* * The type of data source, such as Person. */ - @JsonProperty(value = "class") private String classProperty; /* * The secondary type of data source, such as OrganizationUser. */ - @JsonProperty(value = "subclass") private String subclass; /* * personType */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPersonType class. */ + /** + * Creates an instance of MicrosoftGraphPersonType class. + */ public MicrosoftGraphPersonType() { } /** * Get the classProperty property: The type of data source, such as Person. - * + * * @return the classProperty value. */ public String classProperty() { @@ -47,7 +50,7 @@ public String classProperty() { /** * Set the classProperty property: The type of data source, such as Person. - * + * * @param classProperty the classProperty value to set. * @return the MicrosoftGraphPersonType object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphPersonType withClassProperty(String classProperty) { /** * Get the subclass property: The secondary type of data source, such as OrganizationUser. - * + * * @return the subclass value. */ public String subclass() { @@ -67,7 +70,7 @@ public String subclass() { /** * Set the subclass property: The secondary type of data source, such as OrganizationUser. - * + * * @param subclass the subclass value to set. * @return the MicrosoftGraphPersonType object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphPersonType withSubclass(String subclass) { /** * Get the additionalProperties property: personType. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: personType. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPersonType object itself. */ @@ -97,19 +99,61 @@ public MicrosoftGraphPersonType withAdditionalProperties(Map add return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("class", this.classProperty); + jsonWriter.writeStringField("subclass", this.subclass); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPersonType from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPersonType 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 MicrosoftGraphPersonType. + */ + public static MicrosoftGraphPersonType fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPersonType deserializedMicrosoftGraphPersonType = new MicrosoftGraphPersonType(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("class".equals(fieldName)) { + deserializedMicrosoftGraphPersonType.classProperty = reader.getString(); + } else if ("subclass".equals(fieldName)) { + deserializedMicrosoftGraphPersonType.subclass = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPersonType.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPersonType; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhone.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhone.java index 855ee6fd3109f..326fdcdd0e44c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhone.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhone.java @@ -5,52 +5,53 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** phone. */ +/** + * phone. + */ @Fluent -public final class MicrosoftGraphPhone { +public final class MicrosoftGraphPhone implements JsonSerializable { /* * The language property. */ - @JsonProperty(value = "language") private String language; /* * The phone number. */ - @JsonProperty(value = "number") private String number; /* * The region property. */ - @JsonProperty(value = "region") private String region; /* * The type property. */ - @JsonProperty(value = "type") private MicrosoftGraphPhoneType type; /* * phone */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPhone class. */ + /** + * Creates an instance of MicrosoftGraphPhone class. + */ public MicrosoftGraphPhone() { } /** * Get the language property: The language property. - * + * * @return the language value. */ public String language() { @@ -59,7 +60,7 @@ public String language() { /** * Set the language property: The language property. - * + * * @param language the language value to set. * @return the MicrosoftGraphPhone object itself. */ @@ -70,7 +71,7 @@ public MicrosoftGraphPhone withLanguage(String language) { /** * Get the number property: The phone number. - * + * * @return the number value. */ public String number() { @@ -79,7 +80,7 @@ public String number() { /** * Set the number property: The phone number. - * + * * @param number the number value to set. * @return the MicrosoftGraphPhone object itself. */ @@ -90,7 +91,7 @@ public MicrosoftGraphPhone withNumber(String number) { /** * Get the region property: The region property. - * + * * @return the region value. */ public String region() { @@ -99,7 +100,7 @@ public String region() { /** * Set the region property: The region property. - * + * * @param region the region value to set. * @return the MicrosoftGraphPhone object itself. */ @@ -110,7 +111,7 @@ public MicrosoftGraphPhone withRegion(String region) { /** * Get the type property: The type property. - * + * * @return the type value. */ public MicrosoftGraphPhoneType type() { @@ -119,7 +120,7 @@ public MicrosoftGraphPhoneType type() { /** * Set the type property: The type property. - * + * * @param type the type value to set. * @return the MicrosoftGraphPhone object itself. */ @@ -130,17 +131,16 @@ public MicrosoftGraphPhone withType(MicrosoftGraphPhoneType type) { /** * Get the additionalProperties property: phone. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: phone. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPhone object itself. */ @@ -149,19 +149,67 @@ public MicrosoftGraphPhone withAdditionalProperties(Map addition return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("language", this.language); + jsonWriter.writeStringField("number", this.number); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPhone from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPhone 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 MicrosoftGraphPhone. + */ + public static MicrosoftGraphPhone fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPhone deserializedMicrosoftGraphPhone = new MicrosoftGraphPhone(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("language".equals(fieldName)) { + deserializedMicrosoftGraphPhone.language = reader.getString(); + } else if ("number".equals(fieldName)) { + deserializedMicrosoftGraphPhone.number = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedMicrosoftGraphPhone.region = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphPhone.type = MicrosoftGraphPhoneType.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPhone.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPhone; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhoneType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhoneType.java index d72a2ce9c7379..b707b17a32e5a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhoneType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhoneType.java @@ -5,44 +5,65 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for MicrosoftGraphPhoneType. */ +/** + * Defines values for MicrosoftGraphPhoneType. + */ public final class MicrosoftGraphPhoneType extends ExpandableStringEnum { - /** Static value home for MicrosoftGraphPhoneType. */ + /** + * Static value home for MicrosoftGraphPhoneType. + */ public static final MicrosoftGraphPhoneType HOME = fromString("home"); - /** Static value business for MicrosoftGraphPhoneType. */ + /** + * Static value business for MicrosoftGraphPhoneType. + */ public static final MicrosoftGraphPhoneType BUSINESS = fromString("business"); - /** Static value mobile for MicrosoftGraphPhoneType. */ + /** + * Static value mobile for MicrosoftGraphPhoneType. + */ public static final MicrosoftGraphPhoneType MOBILE = fromString("mobile"); - /** Static value other for MicrosoftGraphPhoneType. */ + /** + * Static value other for MicrosoftGraphPhoneType. + */ public static final MicrosoftGraphPhoneType OTHER = fromString("other"); - /** Static value assistant for MicrosoftGraphPhoneType. */ + /** + * Static value assistant for MicrosoftGraphPhoneType. + */ public static final MicrosoftGraphPhoneType ASSISTANT = fromString("assistant"); - /** Static value homeFax for MicrosoftGraphPhoneType. */ + /** + * Static value homeFax for MicrosoftGraphPhoneType. + */ public static final MicrosoftGraphPhoneType HOME_FAX = fromString("homeFax"); - /** Static value businessFax for MicrosoftGraphPhoneType. */ + /** + * Static value businessFax for MicrosoftGraphPhoneType. + */ public static final MicrosoftGraphPhoneType BUSINESS_FAX = fromString("businessFax"); - /** Static value otherFax for MicrosoftGraphPhoneType. */ + /** + * Static value otherFax for MicrosoftGraphPhoneType. + */ public static final MicrosoftGraphPhoneType OTHER_FAX = fromString("otherFax"); - /** Static value pager for MicrosoftGraphPhoneType. */ + /** + * Static value pager for MicrosoftGraphPhoneType. + */ public static final MicrosoftGraphPhoneType PAGER = fromString("pager"); - /** Static value radio for MicrosoftGraphPhoneType. */ + /** + * Static value radio for MicrosoftGraphPhoneType. + */ public static final MicrosoftGraphPhoneType RADIO = fromString("radio"); /** * Creates a new instance of MicrosoftGraphPhoneType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -51,18 +72,17 @@ public MicrosoftGraphPhoneType() { /** * Creates or finds a MicrosoftGraphPhoneType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphPhoneType. */ - @JsonCreator public static MicrosoftGraphPhoneType fromString(String name) { return fromString(name, MicrosoftGraphPhoneType.class); } /** * Gets known MicrosoftGraphPhoneType values. - * + * * @return known MicrosoftGraphPhoneType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhoto.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhoto.java index 9f0791ac3ed3d..7ce79d6ef5e0c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhoto.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhoto.java @@ -5,83 +5,81 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** photo. */ +/** + * photo. + */ @Fluent -public final class MicrosoftGraphPhoto { +public final class MicrosoftGraphPhoto implements JsonSerializable { /* * Camera manufacturer. Read-only. */ - @JsonProperty(value = "cameraMake") private String cameraMake; /* * Camera model. Read-only. */ - @JsonProperty(value = "cameraModel") private String cameraModel; /* * The denominator for the exposure time fraction from the camera. Read-only. */ - @JsonProperty(value = "exposureDenominator") private Double exposureDenominator; /* * The numerator for the exposure time fraction from the camera. Read-only. */ - @JsonProperty(value = "exposureNumerator") private Double exposureNumerator; /* * The F-stop value from the camera. Read-only. */ - @JsonProperty(value = "fNumber") private Double fNumber; /* * The focal length from the camera. Read-only. */ - @JsonProperty(value = "focalLength") private Double focalLength; /* * The ISO value from the camera. Read-only. */ - @JsonProperty(value = "iso") private Integer iso; /* * The orientation value from the camera. Writable on OneDrive Personal. */ - @JsonProperty(value = "orientation") private Integer orientation; /* * Represents the date and time the photo was taken. Read-only. */ - @JsonProperty(value = "takenDateTime") private OffsetDateTime takenDateTime; /* * photo */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPhoto class. */ + /** + * Creates an instance of MicrosoftGraphPhoto class. + */ public MicrosoftGraphPhoto() { } /** * Get the cameraMake property: Camera manufacturer. Read-only. - * + * * @return the cameraMake value. */ public String cameraMake() { @@ -90,7 +88,7 @@ public String cameraMake() { /** * Set the cameraMake property: Camera manufacturer. Read-only. - * + * * @param cameraMake the cameraMake value to set. * @return the MicrosoftGraphPhoto object itself. */ @@ -101,7 +99,7 @@ public MicrosoftGraphPhoto withCameraMake(String cameraMake) { /** * Get the cameraModel property: Camera model. Read-only. - * + * * @return the cameraModel value. */ public String cameraModel() { @@ -110,7 +108,7 @@ public String cameraModel() { /** * Set the cameraModel property: Camera model. Read-only. - * + * * @param cameraModel the cameraModel value to set. * @return the MicrosoftGraphPhoto object itself. */ @@ -121,7 +119,7 @@ public MicrosoftGraphPhoto withCameraModel(String cameraModel) { /** * Get the exposureDenominator property: The denominator for the exposure time fraction from the camera. Read-only. - * + * * @return the exposureDenominator value. */ public Double exposureDenominator() { @@ -130,7 +128,7 @@ public Double exposureDenominator() { /** * Set the exposureDenominator property: The denominator for the exposure time fraction from the camera. Read-only. - * + * * @param exposureDenominator the exposureDenominator value to set. * @return the MicrosoftGraphPhoto object itself. */ @@ -141,7 +139,7 @@ public MicrosoftGraphPhoto withExposureDenominator(Double exposureDenominator) { /** * Get the exposureNumerator property: The numerator for the exposure time fraction from the camera. Read-only. - * + * * @return the exposureNumerator value. */ public Double exposureNumerator() { @@ -150,7 +148,7 @@ public Double exposureNumerator() { /** * Set the exposureNumerator property: The numerator for the exposure time fraction from the camera. Read-only. - * + * * @param exposureNumerator the exposureNumerator value to set. * @return the MicrosoftGraphPhoto object itself. */ @@ -161,7 +159,7 @@ public MicrosoftGraphPhoto withExposureNumerator(Double exposureNumerator) { /** * Get the fNumber property: The F-stop value from the camera. Read-only. - * + * * @return the fNumber value. */ public Double fNumber() { @@ -170,7 +168,7 @@ public Double fNumber() { /** * Set the fNumber property: The F-stop value from the camera. Read-only. - * + * * @param fNumber the fNumber value to set. * @return the MicrosoftGraphPhoto object itself. */ @@ -181,7 +179,7 @@ public MicrosoftGraphPhoto withFNumber(Double fNumber) { /** * Get the focalLength property: The focal length from the camera. Read-only. - * + * * @return the focalLength value. */ public Double focalLength() { @@ -190,7 +188,7 @@ public Double focalLength() { /** * Set the focalLength property: The focal length from the camera. Read-only. - * + * * @param focalLength the focalLength value to set. * @return the MicrosoftGraphPhoto object itself. */ @@ -201,7 +199,7 @@ public MicrosoftGraphPhoto withFocalLength(Double focalLength) { /** * Get the iso property: The ISO value from the camera. Read-only. - * + * * @return the iso value. */ public Integer iso() { @@ -210,7 +208,7 @@ public Integer iso() { /** * Set the iso property: The ISO value from the camera. Read-only. - * + * * @param iso the iso value to set. * @return the MicrosoftGraphPhoto object itself. */ @@ -221,7 +219,7 @@ public MicrosoftGraphPhoto withIso(Integer iso) { /** * Get the orientation property: The orientation value from the camera. Writable on OneDrive Personal. - * + * * @return the orientation value. */ public Integer orientation() { @@ -230,7 +228,7 @@ public Integer orientation() { /** * Set the orientation property: The orientation value from the camera. Writable on OneDrive Personal. - * + * * @param orientation the orientation value to set. * @return the MicrosoftGraphPhoto object itself. */ @@ -241,7 +239,7 @@ public MicrosoftGraphPhoto withOrientation(Integer orientation) { /** * Get the takenDateTime property: Represents the date and time the photo was taken. Read-only. - * + * * @return the takenDateTime value. */ public OffsetDateTime takenDateTime() { @@ -250,7 +248,7 @@ public OffsetDateTime takenDateTime() { /** * Set the takenDateTime property: Represents the date and time the photo was taken. Read-only. - * + * * @param takenDateTime the takenDateTime value to set. * @return the MicrosoftGraphPhoto object itself. */ @@ -261,17 +259,16 @@ public MicrosoftGraphPhoto withTakenDateTime(OffsetDateTime takenDateTime) { /** * Get the additionalProperties property: photo. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: photo. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPhoto object itself. */ @@ -280,19 +277,84 @@ public MicrosoftGraphPhoto withAdditionalProperties(Map addition return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cameraMake", this.cameraMake); + jsonWriter.writeStringField("cameraModel", this.cameraModel); + jsonWriter.writeNumberField("exposureDenominator", this.exposureDenominator); + jsonWriter.writeNumberField("exposureNumerator", this.exposureNumerator); + jsonWriter.writeNumberField("fNumber", this.fNumber); + jsonWriter.writeNumberField("focalLength", this.focalLength); + jsonWriter.writeNumberField("iso", this.iso); + jsonWriter.writeNumberField("orientation", this.orientation); + jsonWriter.writeStringField("takenDateTime", + this.takenDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.takenDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPhoto from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPhoto 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 MicrosoftGraphPhoto. + */ + public static MicrosoftGraphPhoto fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPhoto deserializedMicrosoftGraphPhoto = new MicrosoftGraphPhoto(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cameraMake".equals(fieldName)) { + deserializedMicrosoftGraphPhoto.cameraMake = reader.getString(); + } else if ("cameraModel".equals(fieldName)) { + deserializedMicrosoftGraphPhoto.cameraModel = reader.getString(); + } else if ("exposureDenominator".equals(fieldName)) { + deserializedMicrosoftGraphPhoto.exposureDenominator = reader.getNullable(JsonReader::getDouble); + } else if ("exposureNumerator".equals(fieldName)) { + deserializedMicrosoftGraphPhoto.exposureNumerator = reader.getNullable(JsonReader::getDouble); + } else if ("fNumber".equals(fieldName)) { + deserializedMicrosoftGraphPhoto.fNumber = reader.getNullable(JsonReader::getDouble); + } else if ("focalLength".equals(fieldName)) { + deserializedMicrosoftGraphPhoto.focalLength = reader.getNullable(JsonReader::getDouble); + } else if ("iso".equals(fieldName)) { + deserializedMicrosoftGraphPhoto.iso = reader.getNullable(JsonReader::getInt); + } else if ("orientation".equals(fieldName)) { + deserializedMicrosoftGraphPhoto.orientation = reader.getNullable(JsonReader::getInt); + } else if ("takenDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPhoto.takenDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPhoto.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPhoto; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhysicalAddress.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhysicalAddress.java index bd838cf24adb1..85910de30d90f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhysicalAddress.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhysicalAddress.java @@ -5,58 +5,58 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** physicalAddress. */ +/** + * physicalAddress. + */ @Fluent -public final class MicrosoftGraphPhysicalAddress { +public final class MicrosoftGraphPhysicalAddress implements JsonSerializable { /* * The city. */ - @JsonProperty(value = "city") private String city; /* * The country or region. It's a free-format string value, for example, 'United States'. */ - @JsonProperty(value = "countryOrRegion") private String countryOrRegion; /* * The postal code. */ - @JsonProperty(value = "postalCode") private String postalCode; /* * The state. */ - @JsonProperty(value = "state") private String state; /* * The street. */ - @JsonProperty(value = "street") private String street; /* * physicalAddress */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPhysicalAddress class. */ + /** + * Creates an instance of MicrosoftGraphPhysicalAddress class. + */ public MicrosoftGraphPhysicalAddress() { } /** * Get the city property: The city. - * + * * @return the city value. */ public String city() { @@ -65,7 +65,7 @@ public String city() { /** * Set the city property: The city. - * + * * @param city the city value to set. * @return the MicrosoftGraphPhysicalAddress object itself. */ @@ -77,7 +77,7 @@ public MicrosoftGraphPhysicalAddress withCity(String city) { /** * Get the countryOrRegion property: The country or region. It's a free-format string value, for example, 'United * States'. - * + * * @return the countryOrRegion value. */ public String countryOrRegion() { @@ -87,7 +87,7 @@ public String countryOrRegion() { /** * Set the countryOrRegion property: The country or region. It's a free-format string value, for example, 'United * States'. - * + * * @param countryOrRegion the countryOrRegion value to set. * @return the MicrosoftGraphPhysicalAddress object itself. */ @@ -98,7 +98,7 @@ public MicrosoftGraphPhysicalAddress withCountryOrRegion(String countryOrRegion) /** * Get the postalCode property: The postal code. - * + * * @return the postalCode value. */ public String postalCode() { @@ -107,7 +107,7 @@ public String postalCode() { /** * Set the postalCode property: The postal code. - * + * * @param postalCode the postalCode value to set. * @return the MicrosoftGraphPhysicalAddress object itself. */ @@ -118,7 +118,7 @@ public MicrosoftGraphPhysicalAddress withPostalCode(String postalCode) { /** * Get the state property: The state. - * + * * @return the state value. */ public String state() { @@ -127,7 +127,7 @@ public String state() { /** * Set the state property: The state. - * + * * @param state the state value to set. * @return the MicrosoftGraphPhysicalAddress object itself. */ @@ -138,7 +138,7 @@ public MicrosoftGraphPhysicalAddress withState(String state) { /** * Get the street property: The street. - * + * * @return the street value. */ public String street() { @@ -147,7 +147,7 @@ public String street() { /** * Set the street property: The street. - * + * * @param street the street value to set. * @return the MicrosoftGraphPhysicalAddress object itself. */ @@ -158,17 +158,16 @@ public MicrosoftGraphPhysicalAddress withStreet(String street) { /** * Get the additionalProperties property: physicalAddress. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: physicalAddress. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPhysicalAddress object itself. */ @@ -177,19 +176,71 @@ public MicrosoftGraphPhysicalAddress withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("city", this.city); + jsonWriter.writeStringField("countryOrRegion", this.countryOrRegion); + jsonWriter.writeStringField("postalCode", this.postalCode); + jsonWriter.writeStringField("state", this.state); + jsonWriter.writeStringField("street", this.street); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPhysicalAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPhysicalAddress 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 MicrosoftGraphPhysicalAddress. + */ + public static MicrosoftGraphPhysicalAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPhysicalAddress deserializedMicrosoftGraphPhysicalAddress + = new MicrosoftGraphPhysicalAddress(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("city".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalAddress.city = reader.getString(); + } else if ("countryOrRegion".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalAddress.countryOrRegion = reader.getString(); + } else if ("postalCode".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalAddress.postalCode = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalAddress.state = reader.getString(); + } else if ("street".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalAddress.street = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPhysicalAddress.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPhysicalAddress; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhysicalOfficeAddress.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhysicalOfficeAddress.java index fd001965419aa..2430c90482d7b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhysicalOfficeAddress.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPhysicalOfficeAddress.java @@ -5,64 +5,64 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** physicalOfficeAddress. */ +/** + * physicalOfficeAddress. + */ @Fluent -public final class MicrosoftGraphPhysicalOfficeAddress { +public final class MicrosoftGraphPhysicalOfficeAddress + implements JsonSerializable { /* * The city. */ - @JsonProperty(value = "city") private String city; /* * The country or region. It's a free-format string value, for example, 'United States'. */ - @JsonProperty(value = "countryOrRegion") private String countryOrRegion; /* * Office location such as building and office number for an organizational contact. */ - @JsonProperty(value = "officeLocation") private String officeLocation; /* * The postal code. */ - @JsonProperty(value = "postalCode") private String postalCode; /* * The state. */ - @JsonProperty(value = "state") private String state; /* * The street. */ - @JsonProperty(value = "street") private String street; /* * physicalOfficeAddress */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPhysicalOfficeAddress class. */ + /** + * Creates an instance of MicrosoftGraphPhysicalOfficeAddress class. + */ public MicrosoftGraphPhysicalOfficeAddress() { } /** * Get the city property: The city. - * + * * @return the city value. */ public String city() { @@ -71,7 +71,7 @@ public String city() { /** * Set the city property: The city. - * + * * @param city the city value to set. * @return the MicrosoftGraphPhysicalOfficeAddress object itself. */ @@ -83,7 +83,7 @@ public MicrosoftGraphPhysicalOfficeAddress withCity(String city) { /** * Get the countryOrRegion property: The country or region. It's a free-format string value, for example, 'United * States'. - * + * * @return the countryOrRegion value. */ public String countryOrRegion() { @@ -93,7 +93,7 @@ public String countryOrRegion() { /** * Set the countryOrRegion property: The country or region. It's a free-format string value, for example, 'United * States'. - * + * * @param countryOrRegion the countryOrRegion value to set. * @return the MicrosoftGraphPhysicalOfficeAddress object itself. */ @@ -105,7 +105,7 @@ public MicrosoftGraphPhysicalOfficeAddress withCountryOrRegion(String countryOrR /** * Get the officeLocation property: Office location such as building and office number for an organizational * contact. - * + * * @return the officeLocation value. */ public String officeLocation() { @@ -115,7 +115,7 @@ public String officeLocation() { /** * Set the officeLocation property: Office location such as building and office number for an organizational * contact. - * + * * @param officeLocation the officeLocation value to set. * @return the MicrosoftGraphPhysicalOfficeAddress object itself. */ @@ -126,7 +126,7 @@ public MicrosoftGraphPhysicalOfficeAddress withOfficeLocation(String officeLocat /** * Get the postalCode property: The postal code. - * + * * @return the postalCode value. */ public String postalCode() { @@ -135,7 +135,7 @@ public String postalCode() { /** * Set the postalCode property: The postal code. - * + * * @param postalCode the postalCode value to set. * @return the MicrosoftGraphPhysicalOfficeAddress object itself. */ @@ -146,7 +146,7 @@ public MicrosoftGraphPhysicalOfficeAddress withPostalCode(String postalCode) { /** * Get the state property: The state. - * + * * @return the state value. */ public String state() { @@ -155,7 +155,7 @@ public String state() { /** * Set the state property: The state. - * + * * @param state the state value to set. * @return the MicrosoftGraphPhysicalOfficeAddress object itself. */ @@ -166,7 +166,7 @@ public MicrosoftGraphPhysicalOfficeAddress withState(String state) { /** * Get the street property: The street. - * + * * @return the street value. */ public String street() { @@ -175,7 +175,7 @@ public String street() { /** * Set the street property: The street. - * + * * @param street the street value to set. * @return the MicrosoftGraphPhysicalOfficeAddress object itself. */ @@ -186,17 +186,16 @@ public MicrosoftGraphPhysicalOfficeAddress withStreet(String street) { /** * Get the additionalProperties property: physicalOfficeAddress. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: physicalOfficeAddress. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPhysicalOfficeAddress object itself. */ @@ -205,19 +204,74 @@ public MicrosoftGraphPhysicalOfficeAddress withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("city", this.city); + jsonWriter.writeStringField("countryOrRegion", this.countryOrRegion); + jsonWriter.writeStringField("officeLocation", this.officeLocation); + jsonWriter.writeStringField("postalCode", this.postalCode); + jsonWriter.writeStringField("state", this.state); + jsonWriter.writeStringField("street", this.street); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPhysicalOfficeAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPhysicalOfficeAddress 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 MicrosoftGraphPhysicalOfficeAddress. + */ + public static MicrosoftGraphPhysicalOfficeAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPhysicalOfficeAddress deserializedMicrosoftGraphPhysicalOfficeAddress + = new MicrosoftGraphPhysicalOfficeAddress(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("city".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalOfficeAddress.city = reader.getString(); + } else if ("countryOrRegion".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalOfficeAddress.countryOrRegion = reader.getString(); + } else if ("officeLocation".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalOfficeAddress.officeLocation = reader.getString(); + } else if ("postalCode".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalOfficeAddress.postalCode = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalOfficeAddress.state = reader.getString(); + } else if ("street".equals(fieldName)) { + deserializedMicrosoftGraphPhysicalOfficeAddress.street = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPhysicalOfficeAddress.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPhysicalOfficeAddress; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat.java index 892e917570725..26d4deecf0b13 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat.java @@ -5,22 +5,21 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** plannerAssignedToTaskBoardTaskFormat. */ +/** + * plannerAssignedToTaskBoardTaskFormat. + */ @Fluent public final class MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat extends MicrosoftGraphEntity { /* * plannerOrderHintsByAssignee */ - @JsonProperty(value = "orderHintsByAssignee") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map orderHintsByAssignee; /* @@ -28,21 +27,22 @@ public final class MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat extends Mi * anyone, or if the orderHintsByAssignee dictionary does not provide an order hint for the user the task is * assigned to. The format is defined as outlined here. */ - @JsonProperty(value = "unassignedOrderHint") private String unassignedOrderHint; /* * plannerAssignedToTaskBoardTaskFormat */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat class. */ + /** + * Creates an instance of MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat class. + */ public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat() { } /** * Get the orderHintsByAssignee property: plannerOrderHintsByAssignee. - * + * * @return the orderHintsByAssignee value. */ public Map orderHintsByAssignee() { @@ -51,12 +51,12 @@ public Map orderHintsByAssignee() { /** * Set the orderHintsByAssignee property: plannerOrderHintsByAssignee. - * + * * @param orderHintsByAssignee the orderHintsByAssignee value to set. * @return the MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat object itself. */ - public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat withOrderHintsByAssignee( - Map orderHintsByAssignee) { + public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat + withOrderHintsByAssignee(Map orderHintsByAssignee) { this.orderHintsByAssignee = orderHintsByAssignee; return this; } @@ -65,7 +65,7 @@ public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat withOrderHintsByAssign * Get the unassignedOrderHint property: Hint value used to order the task on the AssignedTo view of the Task Board * when the task is not assigned to anyone, or if the orderHintsByAssignee dictionary does not provide an order hint * for the user the task is assigned to. The format is defined as outlined here. - * + * * @return the unassignedOrderHint value. */ public String unassignedOrderHint() { @@ -76,7 +76,7 @@ public String unassignedOrderHint() { * Set the unassignedOrderHint property: Hint value used to order the task on the AssignedTo view of the Task Board * when the task is not assigned to anyone, or if the orderHintsByAssignee dictionary does not provide an order hint * for the user the task is assigned to. The format is defined as outlined here. - * + * * @param unassignedOrderHint the unassignedOrderHint value to set. * @return the MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat object itself. */ @@ -87,35 +87,28 @@ public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat withUnassignedOrderHin /** * Get the additionalProperties property: plannerAssignedToTaskBoardTaskFormat. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerAssignedToTaskBoardTaskFormat. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat object itself. */ - public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat withId(String id) { super.withId(id); @@ -124,11 +117,70 @@ public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeMapField("orderHintsByAssignee", this.orderHintsByAssignee, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("unassignedOrderHint", this.unassignedOrderHint); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat 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 MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat. + */ + public static MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat deserializedMicrosoftGraphPlannerAssignedToTaskBoardTaskFormat + = new MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPlannerAssignedToTaskBoardTaskFormat.withId(reader.getString()); + } else if ("orderHintsByAssignee".equals(fieldName)) { + Map orderHintsByAssignee = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphPlannerAssignedToTaskBoardTaskFormat.orderHintsByAssignee + = orderHintsByAssignee; + } else if ("unassignedOrderHint".equals(fieldName)) { + deserializedMicrosoftGraphPlannerAssignedToTaskBoardTaskFormat.unassignedOrderHint + = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerAssignedToTaskBoardTaskFormat.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerAssignedToTaskBoardTaskFormat; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerBucket.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerBucket.java index 9070f1ad8350c..d0d2f38775345 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerBucket.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerBucket.java @@ -5,53 +5,53 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** plannerBucket. */ +/** + * plannerBucket. + */ @Fluent public final class MicrosoftGraphPlannerBucket extends MicrosoftGraphEntity { /* * Name of the bucket. */ - @JsonProperty(value = "name") private String name; /* * Hint used to order items of this type in a list view. The format is defined as outlined here. */ - @JsonProperty(value = "orderHint") private String orderHint; /* * Plan ID to which the bucket belongs. */ - @JsonProperty(value = "planId") private String planId; /* * Read-only. Nullable. The collection of tasks in the bucket. */ - @JsonProperty(value = "tasks") private List tasks; /* * plannerBucket */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerBucket class. */ + /** + * Creates an instance of MicrosoftGraphPlannerBucket class. + */ public MicrosoftGraphPlannerBucket() { } /** * Get the name property: Name of the bucket. - * + * * @return the name value. */ public String name() { @@ -60,7 +60,7 @@ public String name() { /** * Set the name property: Name of the bucket. - * + * * @param name the name value to set. * @return the MicrosoftGraphPlannerBucket object itself. */ @@ -72,7 +72,7 @@ public MicrosoftGraphPlannerBucket withName(String name) { /** * Get the orderHint property: Hint used to order items of this type in a list view. The format is defined as * outlined here. - * + * * @return the orderHint value. */ public String orderHint() { @@ -82,7 +82,7 @@ public String orderHint() { /** * Set the orderHint property: Hint used to order items of this type in a list view. The format is defined as * outlined here. - * + * * @param orderHint the orderHint value to set. * @return the MicrosoftGraphPlannerBucket object itself. */ @@ -93,7 +93,7 @@ public MicrosoftGraphPlannerBucket withOrderHint(String orderHint) { /** * Get the planId property: Plan ID to which the bucket belongs. - * + * * @return the planId value. */ public String planId() { @@ -102,7 +102,7 @@ public String planId() { /** * Set the planId property: Plan ID to which the bucket belongs. - * + * * @param planId the planId value to set. * @return the MicrosoftGraphPlannerBucket object itself. */ @@ -113,7 +113,7 @@ public MicrosoftGraphPlannerBucket withPlanId(String planId) { /** * Get the tasks property: Read-only. Nullable. The collection of tasks in the bucket. - * + * * @return the tasks value. */ public List tasks() { @@ -122,7 +122,7 @@ public List tasks() { /** * Set the tasks property: Read-only. Nullable. The collection of tasks in the bucket. - * + * * @param tasks the tasks value to set. * @return the MicrosoftGraphPlannerBucket object itself. */ @@ -133,17 +133,16 @@ public MicrosoftGraphPlannerBucket withTasks(List tas /** * Get the additionalProperties property: plannerBucket. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerBucket. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerBucket object itself. */ @@ -152,15 +151,9 @@ public MicrosoftGraphPlannerBucket withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPlannerBucket withId(String id) { super.withId(id); @@ -169,7 +162,7 @@ public MicrosoftGraphPlannerBucket withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -179,4 +172,65 @@ public void validate() { tasks().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("orderHint", this.orderHint); + jsonWriter.writeStringField("planId", this.planId); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerBucket from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerBucket 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 MicrosoftGraphPlannerBucket. + */ + public static MicrosoftGraphPlannerBucket fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerBucket deserializedMicrosoftGraphPlannerBucket = new MicrosoftGraphPlannerBucket(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPlannerBucket.withId(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphPlannerBucket.name = reader.getString(); + } else if ("orderHint".equals(fieldName)) { + deserializedMicrosoftGraphPlannerBucket.orderHint = reader.getString(); + } else if ("planId".equals(fieldName)) { + deserializedMicrosoftGraphPlannerBucket.planId = reader.getString(); + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> MicrosoftGraphPlannerTask.fromJson(reader1)); + deserializedMicrosoftGraphPlannerBucket.tasks = tasks; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerBucket.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerBucket; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerBucketTaskBoardTaskFormat.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerBucketTaskBoardTaskFormat.java index c870f96969ae3..4581a8f354185 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerBucketTaskBoardTaskFormat.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerBucketTaskBoardTaskFormat.java @@ -5,35 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** plannerBucketTaskBoardTaskFormat. */ +/** + * plannerBucketTaskBoardTaskFormat. + */ @Fluent public final class MicrosoftGraphPlannerBucketTaskBoardTaskFormat extends MicrosoftGraphEntity { /* * Hint used to order tasks in the Bucket view of the Task Board. The format is defined as outlined here. */ - @JsonProperty(value = "orderHint") private String orderHint; /* * plannerBucketTaskBoardTaskFormat */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerBucketTaskBoardTaskFormat class. */ + /** + * Creates an instance of MicrosoftGraphPlannerBucketTaskBoardTaskFormat class. + */ public MicrosoftGraphPlannerBucketTaskBoardTaskFormat() { } /** * Get the orderHint property: Hint used to order tasks in the Bucket view of the Task Board. The format is defined * as outlined here. - * + * * @return the orderHint value. */ public String orderHint() { @@ -43,7 +46,7 @@ public String orderHint() { /** * Set the orderHint property: Hint used to order tasks in the Bucket view of the Task Board. The format is defined * as outlined here. - * + * * @param orderHint the orderHint value to set. * @return the MicrosoftGraphPlannerBucketTaskBoardTaskFormat object itself. */ @@ -54,35 +57,28 @@ public MicrosoftGraphPlannerBucketTaskBoardTaskFormat withOrderHint(String order /** * Get the additionalProperties property: plannerBucketTaskBoardTaskFormat. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerBucketTaskBoardTaskFormat. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerBucketTaskBoardTaskFormat object itself. */ - public MicrosoftGraphPlannerBucketTaskBoardTaskFormat withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphPlannerBucketTaskBoardTaskFormat + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPlannerBucketTaskBoardTaskFormat withId(String id) { super.withId(id); @@ -91,11 +87,62 @@ public MicrosoftGraphPlannerBucketTaskBoardTaskFormat withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("orderHint", this.orderHint); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerBucketTaskBoardTaskFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerBucketTaskBoardTaskFormat 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 MicrosoftGraphPlannerBucketTaskBoardTaskFormat. + */ + public static MicrosoftGraphPlannerBucketTaskBoardTaskFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerBucketTaskBoardTaskFormat deserializedMicrosoftGraphPlannerBucketTaskBoardTaskFormat + = new MicrosoftGraphPlannerBucketTaskBoardTaskFormat(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPlannerBucketTaskBoardTaskFormat.withId(reader.getString()); + } else if ("orderHint".equals(fieldName)) { + deserializedMicrosoftGraphPlannerBucketTaskBoardTaskFormat.orderHint = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerBucketTaskBoardTaskFormat.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerBucketTaskBoardTaskFormat; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerCategoryDescriptions.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerCategoryDescriptions.java index 8924a69a7c51c..65310d1b58b88 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerCategoryDescriptions.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerCategoryDescriptions.java @@ -5,64 +5,64 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** plannerCategoryDescriptions. */ +/** + * plannerCategoryDescriptions. + */ @Fluent -public final class MicrosoftGraphPlannerCategoryDescriptions { +public final class MicrosoftGraphPlannerCategoryDescriptions + implements JsonSerializable { /* * The label associated with Category 1 */ - @JsonProperty(value = "category1") private String category1; /* * The label associated with Category 2 */ - @JsonProperty(value = "category2") private String category2; /* * The label associated with Category 3 */ - @JsonProperty(value = "category3") private String category3; /* * The label associated with Category 4 */ - @JsonProperty(value = "category4") private String category4; /* * The label associated with Category 5 */ - @JsonProperty(value = "category5") private String category5; /* * The label associated with Category 6 */ - @JsonProperty(value = "category6") private String category6; /* * plannerCategoryDescriptions */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerCategoryDescriptions class. */ + /** + * Creates an instance of MicrosoftGraphPlannerCategoryDescriptions class. + */ public MicrosoftGraphPlannerCategoryDescriptions() { } /** * Get the category1 property: The label associated with Category 1. - * + * * @return the category1 value. */ public String category1() { @@ -71,7 +71,7 @@ public String category1() { /** * Set the category1 property: The label associated with Category 1. - * + * * @param category1 the category1 value to set. * @return the MicrosoftGraphPlannerCategoryDescriptions object itself. */ @@ -82,7 +82,7 @@ public MicrosoftGraphPlannerCategoryDescriptions withCategory1(String category1) /** * Get the category2 property: The label associated with Category 2. - * + * * @return the category2 value. */ public String category2() { @@ -91,7 +91,7 @@ public String category2() { /** * Set the category2 property: The label associated with Category 2. - * + * * @param category2 the category2 value to set. * @return the MicrosoftGraphPlannerCategoryDescriptions object itself. */ @@ -102,7 +102,7 @@ public MicrosoftGraphPlannerCategoryDescriptions withCategory2(String category2) /** * Get the category3 property: The label associated with Category 3. - * + * * @return the category3 value. */ public String category3() { @@ -111,7 +111,7 @@ public String category3() { /** * Set the category3 property: The label associated with Category 3. - * + * * @param category3 the category3 value to set. * @return the MicrosoftGraphPlannerCategoryDescriptions object itself. */ @@ -122,7 +122,7 @@ public MicrosoftGraphPlannerCategoryDescriptions withCategory3(String category3) /** * Get the category4 property: The label associated with Category 4. - * + * * @return the category4 value. */ public String category4() { @@ -131,7 +131,7 @@ public String category4() { /** * Set the category4 property: The label associated with Category 4. - * + * * @param category4 the category4 value to set. * @return the MicrosoftGraphPlannerCategoryDescriptions object itself. */ @@ -142,7 +142,7 @@ public MicrosoftGraphPlannerCategoryDescriptions withCategory4(String category4) /** * Get the category5 property: The label associated with Category 5. - * + * * @return the category5 value. */ public String category5() { @@ -151,7 +151,7 @@ public String category5() { /** * Set the category5 property: The label associated with Category 5. - * + * * @param category5 the category5 value to set. * @return the MicrosoftGraphPlannerCategoryDescriptions object itself. */ @@ -162,7 +162,7 @@ public MicrosoftGraphPlannerCategoryDescriptions withCategory5(String category5) /** * Get the category6 property: The label associated with Category 6. - * + * * @return the category6 value. */ public String category6() { @@ -171,7 +171,7 @@ public String category6() { /** * Set the category6 property: The label associated with Category 6. - * + * * @param category6 the category6 value to set. * @return the MicrosoftGraphPlannerCategoryDescriptions object itself. */ @@ -182,39 +182,93 @@ public MicrosoftGraphPlannerCategoryDescriptions withCategory6(String category6) /** * Get the additionalProperties property: plannerCategoryDescriptions. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerCategoryDescriptions. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerCategoryDescriptions object itself. */ - public MicrosoftGraphPlannerCategoryDescriptions withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphPlannerCategoryDescriptions + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category1", this.category1); + jsonWriter.writeStringField("category2", this.category2); + jsonWriter.writeStringField("category3", this.category3); + jsonWriter.writeStringField("category4", this.category4); + jsonWriter.writeStringField("category5", this.category5); + jsonWriter.writeStringField("category6", this.category6); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerCategoryDescriptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerCategoryDescriptions 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 MicrosoftGraphPlannerCategoryDescriptions. + */ + public static MicrosoftGraphPlannerCategoryDescriptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerCategoryDescriptions deserializedMicrosoftGraphPlannerCategoryDescriptions + = new MicrosoftGraphPlannerCategoryDescriptions(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category1".equals(fieldName)) { + deserializedMicrosoftGraphPlannerCategoryDescriptions.category1 = reader.getString(); + } else if ("category2".equals(fieldName)) { + deserializedMicrosoftGraphPlannerCategoryDescriptions.category2 = reader.getString(); + } else if ("category3".equals(fieldName)) { + deserializedMicrosoftGraphPlannerCategoryDescriptions.category3 = reader.getString(); + } else if ("category4".equals(fieldName)) { + deserializedMicrosoftGraphPlannerCategoryDescriptions.category4 = reader.getString(); + } else if ("category5".equals(fieldName)) { + deserializedMicrosoftGraphPlannerCategoryDescriptions.category5 = reader.getString(); + } else if ("category6".equals(fieldName)) { + deserializedMicrosoftGraphPlannerCategoryDescriptions.category6 = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerCategoryDescriptions.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerCategoryDescriptions; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerGroup.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerGroup.java index c1541e6b59707..ea5641c327d1f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerGroup.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerGroup.java @@ -5,35 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** plannerGroup. */ +/** + * plannerGroup. + */ @Fluent public final class MicrosoftGraphPlannerGroup extends MicrosoftGraphEntity { /* * Read-only. Nullable. Returns the plannerPlans owned by the group. */ - @JsonProperty(value = "plans") private List plans; /* * plannerGroup */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerGroup class. */ + /** + * Creates an instance of MicrosoftGraphPlannerGroup class. + */ public MicrosoftGraphPlannerGroup() { } /** * Get the plans property: Read-only. Nullable. Returns the plannerPlans owned by the group. - * + * * @return the plans value. */ public List plans() { @@ -42,7 +45,7 @@ public List plans() { /** * Set the plans property: Read-only. Nullable. Returns the plannerPlans owned by the group. - * + * * @param plans the plans value to set. * @return the MicrosoftGraphPlannerGroup object itself. */ @@ -53,17 +56,16 @@ public MicrosoftGraphPlannerGroup withPlans(List plan /** * Get the additionalProperties property: plannerGroup. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerGroup. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerGroup object itself. */ @@ -72,15 +74,9 @@ public MicrosoftGraphPlannerGroup withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPlannerGroup withId(String id) { super.withId(id); @@ -89,7 +85,7 @@ public MicrosoftGraphPlannerGroup withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -99,4 +95,56 @@ public void validate() { plans().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("plans", this.plans, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerGroup 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 MicrosoftGraphPlannerGroup. + */ + public static MicrosoftGraphPlannerGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerGroup deserializedMicrosoftGraphPlannerGroup = new MicrosoftGraphPlannerGroup(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPlannerGroup.withId(reader.getString()); + } else if ("plans".equals(fieldName)) { + List plans + = reader.readArray(reader1 -> MicrosoftGraphPlannerPlan.fromJson(reader1)); + deserializedMicrosoftGraphPlannerGroup.plans = plans; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerGroup.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerGroup; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPlan.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPlan.java index 20fd9ea365c29..57c25f513536f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPlan.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPlan.java @@ -5,22 +5,25 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** plannerPlan. */ +/** + * plannerPlan. + */ @Fluent public final class MicrosoftGraphPlannerPlan extends MicrosoftGraphEntity { /* * identitySet */ - @JsonProperty(value = "createdBy") private MicrosoftGraphIdentitySet createdBy; /* @@ -28,52 +31,48 @@ public final class MicrosoftGraphPlannerPlan extends MicrosoftGraphEntity { * using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * ID of the Group that owns the plan. A valid group must exist before this field can be set. After it is set, this * property can’t be updated. */ - @JsonProperty(value = "owner") private String owner; /* * Required. Title of the plan. */ - @JsonProperty(value = "title") private String title; /* * Read-only. Nullable. Collection of buckets in the plan. */ - @JsonProperty(value = "buckets") private List buckets; /* * plannerPlanDetails */ - @JsonProperty(value = "details") private MicrosoftGraphPlannerPlanDetails details; /* * Read-only. Nullable. Collection of tasks in the plan. */ - @JsonProperty(value = "tasks") private List tasks; /* * plannerPlan */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerPlan class. */ + /** + * Creates an instance of MicrosoftGraphPlannerPlan class. + */ public MicrosoftGraphPlannerPlan() { } /** * Get the createdBy property: identitySet. - * + * * @return the createdBy value. */ public MicrosoftGraphIdentitySet createdBy() { @@ -82,7 +81,7 @@ public MicrosoftGraphIdentitySet createdBy() { /** * Set the createdBy property: identitySet. - * + * * @param createdBy the createdBy value to set. * @return the MicrosoftGraphPlannerPlan object itself. */ @@ -95,7 +94,7 @@ public MicrosoftGraphPlannerPlan withCreatedBy(MicrosoftGraphIdentitySet created * Get the createdDateTime property: Read-only. Date and time at which the plan is created. The Timestamp type * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -106,7 +105,7 @@ public OffsetDateTime createdDateTime() { * Set the createdDateTime property: Read-only. Date and time at which the plan is created. The Timestamp type * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphPlannerPlan object itself. */ @@ -118,7 +117,7 @@ public MicrosoftGraphPlannerPlan withCreatedDateTime(OffsetDateTime createdDateT /** * Get the owner property: ID of the Group that owns the plan. A valid group must exist before this field can be * set. After it is set, this property can’t be updated. - * + * * @return the owner value. */ public String owner() { @@ -128,7 +127,7 @@ public String owner() { /** * Set the owner property: ID of the Group that owns the plan. A valid group must exist before this field can be * set. After it is set, this property can’t be updated. - * + * * @param owner the owner value to set. * @return the MicrosoftGraphPlannerPlan object itself. */ @@ -139,7 +138,7 @@ public MicrosoftGraphPlannerPlan withOwner(String owner) { /** * Get the title property: Required. Title of the plan. - * + * * @return the title value. */ public String title() { @@ -148,7 +147,7 @@ public String title() { /** * Set the title property: Required. Title of the plan. - * + * * @param title the title value to set. * @return the MicrosoftGraphPlannerPlan object itself. */ @@ -159,7 +158,7 @@ public MicrosoftGraphPlannerPlan withTitle(String title) { /** * Get the buckets property: Read-only. Nullable. Collection of buckets in the plan. - * + * * @return the buckets value. */ public List buckets() { @@ -168,7 +167,7 @@ public List buckets() { /** * Set the buckets property: Read-only. Nullable. Collection of buckets in the plan. - * + * * @param buckets the buckets value to set. * @return the MicrosoftGraphPlannerPlan object itself. */ @@ -179,7 +178,7 @@ public MicrosoftGraphPlannerPlan withBuckets(List b /** * Get the details property: plannerPlanDetails. - * + * * @return the details value. */ public MicrosoftGraphPlannerPlanDetails details() { @@ -188,7 +187,7 @@ public MicrosoftGraphPlannerPlanDetails details() { /** * Set the details property: plannerPlanDetails. - * + * * @param details the details value to set. * @return the MicrosoftGraphPlannerPlan object itself. */ @@ -199,7 +198,7 @@ public MicrosoftGraphPlannerPlan withDetails(MicrosoftGraphPlannerPlanDetails de /** * Get the tasks property: Read-only. Nullable. Collection of tasks in the plan. - * + * * @return the tasks value. */ public List tasks() { @@ -208,7 +207,7 @@ public List tasks() { /** * Set the tasks property: Read-only. Nullable. Collection of tasks in the plan. - * + * * @param tasks the tasks value to set. * @return the MicrosoftGraphPlannerPlan object itself. */ @@ -219,17 +218,16 @@ public MicrosoftGraphPlannerPlan withTasks(List tasks /** * Get the additionalProperties property: plannerPlan. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerPlan. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerPlan object itself. */ @@ -238,15 +236,9 @@ public MicrosoftGraphPlannerPlan withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPlannerPlan withId(String id) { super.withId(id); @@ -255,7 +247,7 @@ public MicrosoftGraphPlannerPlan withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -274,4 +266,78 @@ public void validate() { tasks().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("createdBy", this.createdBy); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("owner", this.owner); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeArrayField("buckets", this.buckets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("details", this.details); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerPlan from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerPlan 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 MicrosoftGraphPlannerPlan. + */ + public static MicrosoftGraphPlannerPlan fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerPlan deserializedMicrosoftGraphPlannerPlan = new MicrosoftGraphPlannerPlan(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPlannerPlan.withId(reader.getString()); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphPlannerPlan.createdBy = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPlannerPlan.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("owner".equals(fieldName)) { + deserializedMicrosoftGraphPlannerPlan.owner = reader.getString(); + } else if ("title".equals(fieldName)) { + deserializedMicrosoftGraphPlannerPlan.title = reader.getString(); + } else if ("buckets".equals(fieldName)) { + List buckets + = reader.readArray(reader1 -> MicrosoftGraphPlannerBucket.fromJson(reader1)); + deserializedMicrosoftGraphPlannerPlan.buckets = buckets; + } else if ("details".equals(fieldName)) { + deserializedMicrosoftGraphPlannerPlan.details = MicrosoftGraphPlannerPlanDetails.fromJson(reader); + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> MicrosoftGraphPlannerTask.fromJson(reader1)); + deserializedMicrosoftGraphPlannerPlan.tasks = tasks; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerPlan.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerPlan; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPlanDetails.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPlanDetails.java index cbbf580afdadc..71f95f3ed96f1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPlanDetails.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPlanDetails.java @@ -5,42 +5,42 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** plannerPlanDetails. */ +/** + * plannerPlanDetails. + */ @Fluent public final class MicrosoftGraphPlannerPlanDetails extends MicrosoftGraphEntity { /* * plannerCategoryDescriptions */ - @JsonProperty(value = "categoryDescriptions") private MicrosoftGraphPlannerCategoryDescriptions categoryDescriptions; /* * plannerUserIds */ - @JsonProperty(value = "sharedWith") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map sharedWith; /* * plannerPlanDetails */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerPlanDetails class. */ + /** + * Creates an instance of MicrosoftGraphPlannerPlanDetails class. + */ public MicrosoftGraphPlannerPlanDetails() { } /** * Get the categoryDescriptions property: plannerCategoryDescriptions. - * + * * @return the categoryDescriptions value. */ public MicrosoftGraphPlannerCategoryDescriptions categoryDescriptions() { @@ -49,19 +49,19 @@ public MicrosoftGraphPlannerCategoryDescriptions categoryDescriptions() { /** * Set the categoryDescriptions property: plannerCategoryDescriptions. - * + * * @param categoryDescriptions the categoryDescriptions value to set. * @return the MicrosoftGraphPlannerPlanDetails object itself. */ - public MicrosoftGraphPlannerPlanDetails withCategoryDescriptions( - MicrosoftGraphPlannerCategoryDescriptions categoryDescriptions) { + public MicrosoftGraphPlannerPlanDetails + withCategoryDescriptions(MicrosoftGraphPlannerCategoryDescriptions categoryDescriptions) { this.categoryDescriptions = categoryDescriptions; return this; } /** * Get the sharedWith property: plannerUserIds. - * + * * @return the sharedWith value. */ public Map sharedWith() { @@ -70,7 +70,7 @@ public Map sharedWith() { /** * Set the sharedWith property: plannerUserIds. - * + * * @param sharedWith the sharedWith value to set. * @return the MicrosoftGraphPlannerPlanDetails object itself. */ @@ -81,17 +81,16 @@ public MicrosoftGraphPlannerPlanDetails withSharedWith(Map share /** * Get the additionalProperties property: plannerPlanDetails. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerPlanDetails. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerPlanDetails object itself. */ @@ -100,15 +99,9 @@ public MicrosoftGraphPlannerPlanDetails withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPlannerPlanDetails withId(String id) { super.withId(id); @@ -117,7 +110,7 @@ public MicrosoftGraphPlannerPlanDetails withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -127,4 +120,60 @@ public void validate() { categoryDescriptions().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("categoryDescriptions", this.categoryDescriptions); + jsonWriter.writeMapField("sharedWith", this.sharedWith, (writer, element) -> writer.writeUntyped(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerPlanDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerPlanDetails 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 MicrosoftGraphPlannerPlanDetails. + */ + public static MicrosoftGraphPlannerPlanDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerPlanDetails deserializedMicrosoftGraphPlannerPlanDetails + = new MicrosoftGraphPlannerPlanDetails(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPlannerPlanDetails.withId(reader.getString()); + } else if ("categoryDescriptions".equals(fieldName)) { + deserializedMicrosoftGraphPlannerPlanDetails.categoryDescriptions + = MicrosoftGraphPlannerCategoryDescriptions.fromJson(reader); + } else if ("sharedWith".equals(fieldName)) { + Map sharedWith = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphPlannerPlanDetails.sharedWith = sharedWith; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerPlanDetails.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerPlanDetails; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPreviewType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPreviewType.java index ca7b488760411..281ffab4476df 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPreviewType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerPreviewType.java @@ -5,29 +5,40 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** plannerPreviewType. */ +/** + * plannerPreviewType. + */ public final class MicrosoftGraphPlannerPreviewType extends ExpandableStringEnum { - /** Static value automatic for MicrosoftGraphPlannerPreviewType. */ + /** + * Static value automatic for MicrosoftGraphPlannerPreviewType. + */ public static final MicrosoftGraphPlannerPreviewType AUTOMATIC = fromString("automatic"); - /** Static value noPreview for MicrosoftGraphPlannerPreviewType. */ + /** + * Static value noPreview for MicrosoftGraphPlannerPreviewType. + */ public static final MicrosoftGraphPlannerPreviewType NO_PREVIEW = fromString("noPreview"); - /** Static value checklist for MicrosoftGraphPlannerPreviewType. */ + /** + * Static value checklist for MicrosoftGraphPlannerPreviewType. + */ public static final MicrosoftGraphPlannerPreviewType CHECKLIST = fromString("checklist"); - /** Static value description for MicrosoftGraphPlannerPreviewType. */ + /** + * Static value description for MicrosoftGraphPlannerPreviewType. + */ public static final MicrosoftGraphPlannerPreviewType DESCRIPTION = fromString("description"); - /** Static value reference for MicrosoftGraphPlannerPreviewType. */ + /** + * Static value reference for MicrosoftGraphPlannerPreviewType. + */ public static final MicrosoftGraphPlannerPreviewType REFERENCE = fromString("reference"); /** * Creates a new instance of MicrosoftGraphPlannerPreviewType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,18 +47,17 @@ public MicrosoftGraphPlannerPreviewType() { /** * Creates or finds a MicrosoftGraphPlannerPreviewType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphPlannerPreviewType. */ - @JsonCreator public static MicrosoftGraphPlannerPreviewType fromString(String name) { return fromString(name, MicrosoftGraphPlannerPreviewType.class); } /** * Gets known MicrosoftGraphPlannerPreviewType values. - * + * * @return known MicrosoftGraphPlannerPreviewType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerProgressTaskBoardTaskFormat.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerProgressTaskBoardTaskFormat.java index f67b46283ce31..c936d2af8b050 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerProgressTaskBoardTaskFormat.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerProgressTaskBoardTaskFormat.java @@ -5,36 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** plannerProgressTaskBoardTaskFormat. */ +/** + * plannerProgressTaskBoardTaskFormat. + */ @Fluent public final class MicrosoftGraphPlannerProgressTaskBoardTaskFormat extends MicrosoftGraphEntity { /* - * Hint value used to order the task on the Progress view of the Task Board. The format is defined as outlined - * here. + * Hint value used to order the task on the Progress view of the Task Board. The format is defined as outlined here. */ - @JsonProperty(value = "orderHint") private String orderHint; /* * plannerProgressTaskBoardTaskFormat */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerProgressTaskBoardTaskFormat class. */ + /** + * Creates an instance of MicrosoftGraphPlannerProgressTaskBoardTaskFormat class. + */ public MicrosoftGraphPlannerProgressTaskBoardTaskFormat() { } /** * Get the orderHint property: Hint value used to order the task on the Progress view of the Task Board. The format * is defined as outlined here. - * + * * @return the orderHint value. */ public String orderHint() { @@ -44,7 +46,7 @@ public String orderHint() { /** * Set the orderHint property: Hint value used to order the task on the Progress view of the Task Board. The format * is defined as outlined here. - * + * * @param orderHint the orderHint value to set. * @return the MicrosoftGraphPlannerProgressTaskBoardTaskFormat object itself. */ @@ -55,35 +57,28 @@ public MicrosoftGraphPlannerProgressTaskBoardTaskFormat withOrderHint(String ord /** * Get the additionalProperties property: plannerProgressTaskBoardTaskFormat. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerProgressTaskBoardTaskFormat. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerProgressTaskBoardTaskFormat object itself. */ - public MicrosoftGraphPlannerProgressTaskBoardTaskFormat withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphPlannerProgressTaskBoardTaskFormat + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPlannerProgressTaskBoardTaskFormat withId(String id) { super.withId(id); @@ -92,11 +87,62 @@ public MicrosoftGraphPlannerProgressTaskBoardTaskFormat withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("orderHint", this.orderHint); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerProgressTaskBoardTaskFormat from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerProgressTaskBoardTaskFormat 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 MicrosoftGraphPlannerProgressTaskBoardTaskFormat. + */ + public static MicrosoftGraphPlannerProgressTaskBoardTaskFormat fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerProgressTaskBoardTaskFormat deserializedMicrosoftGraphPlannerProgressTaskBoardTaskFormat + = new MicrosoftGraphPlannerProgressTaskBoardTaskFormat(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPlannerProgressTaskBoardTaskFormat.withId(reader.getString()); + } else if ("orderHint".equals(fieldName)) { + deserializedMicrosoftGraphPlannerProgressTaskBoardTaskFormat.orderHint = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerProgressTaskBoardTaskFormat.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerProgressTaskBoardTaskFormat; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerTask.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerTask.java index 06dc10c3795d4..2711c5dd68e6e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerTask.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerTask.java @@ -5,61 +5,55 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** plannerTask. */ +/** + * plannerTask. + */ @Fluent public final class MicrosoftGraphPlannerTask extends MicrosoftGraphEntity { /* * Number of checklist items with value set to false, representing incomplete items. */ - @JsonProperty(value = "activeChecklistItemCount") private Integer activeChecklistItemCount; /* * plannerAppliedCategories */ - @JsonProperty(value = "appliedCategories") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map appliedCategories; /* * Hint used to order items of this type in a list view. The format is defined as outlined here. */ - @JsonProperty(value = "assigneePriority") private String assigneePriority; /* * plannerAssignments */ - @JsonProperty(value = "assignments") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map assignments; /* * Bucket ID to which the task belongs. The bucket needs to be in the plan that the task is in. It is 28 characters * long and case-sensitive. Format validation is done on the service. */ - @JsonProperty(value = "bucketId") private String bucketId; /* * Number of checklist items that are present on the task. */ - @JsonProperty(value = "checklistItemCount") private Integer checklistItemCount; /* * identitySet */ - @JsonProperty(value = "completedBy") private MicrosoftGraphIdentitySet completedBy; /* @@ -67,20 +61,16 @@ public final class MicrosoftGraphPlannerTask extends MicrosoftGraphEntity { * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "completedDateTime") private OffsetDateTime completedDateTime; /* - * Thread ID of the conversation on the task. This is the ID of the conversation thread object created in the - * group. + * Thread ID of the conversation on the task. This is the ID of the conversation thread object created in the group. */ - @JsonProperty(value = "conversationThreadId") private String conversationThreadId; /* * identitySet */ - @JsonProperty(value = "createdBy") private MicrosoftGraphIdentitySet createdBy; /* @@ -88,7 +78,6 @@ public final class MicrosoftGraphPlannerTask extends MicrosoftGraphEntity { * using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* @@ -96,43 +85,36 @@ public final class MicrosoftGraphPlannerTask extends MicrosoftGraphEntity { * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "dueDateTime") private OffsetDateTime dueDateTime; /* * Read-only. Value is true if the details object of the task has a non-empty description and false otherwise. */ - @JsonProperty(value = "hasDescription") private Boolean hasDescription; /* * Hint used to order items of this type in a list view. The format is defined as outlined here. */ - @JsonProperty(value = "orderHint") private String orderHint; /* * Percentage of task completion. When set to 100, the task is considered completed. */ - @JsonProperty(value = "percentComplete") private Integer percentComplete; /* * Plan ID to which the task belongs. */ - @JsonProperty(value = "planId") private String planId; /* * plannerPreviewType */ - @JsonProperty(value = "previewType") private MicrosoftGraphPlannerPreviewType previewType; /* * Number of external references that exist on the task. */ - @JsonProperty(value = "referenceCount") private Integer referenceCount; /* @@ -140,52 +122,48 @@ public final class MicrosoftGraphPlannerTask extends MicrosoftGraphEntity { * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "startDateTime") private OffsetDateTime startDateTime; /* * Title of the task. */ - @JsonProperty(value = "title") private String title; /* * plannerAssignedToTaskBoardTaskFormat */ - @JsonProperty(value = "assignedToTaskBoardFormat") private MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat assignedToTaskBoardFormat; /* * plannerBucketTaskBoardTaskFormat */ - @JsonProperty(value = "bucketTaskBoardFormat") private MicrosoftGraphPlannerBucketTaskBoardTaskFormat bucketTaskBoardFormat; /* * plannerTaskDetails */ - @JsonProperty(value = "details") private MicrosoftGraphPlannerTaskDetails details; /* * plannerProgressTaskBoardTaskFormat */ - @JsonProperty(value = "progressTaskBoardFormat") private MicrosoftGraphPlannerProgressTaskBoardTaskFormat progressTaskBoardFormat; /* * plannerTask */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerTask class. */ + /** + * Creates an instance of MicrosoftGraphPlannerTask class. + */ public MicrosoftGraphPlannerTask() { } /** * Get the activeChecklistItemCount property: Number of checklist items with value set to false, representing * incomplete items. - * + * * @return the activeChecklistItemCount value. */ public Integer activeChecklistItemCount() { @@ -195,7 +173,7 @@ public Integer activeChecklistItemCount() { /** * Set the activeChecklistItemCount property: Number of checklist items with value set to false, representing * incomplete items. - * + * * @param activeChecklistItemCount the activeChecklistItemCount value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -206,7 +184,7 @@ public MicrosoftGraphPlannerTask withActiveChecklistItemCount(Integer activeChec /** * Get the appliedCategories property: plannerAppliedCategories. - * + * * @return the appliedCategories value. */ public Map appliedCategories() { @@ -215,7 +193,7 @@ public Map appliedCategories() { /** * Set the appliedCategories property: plannerAppliedCategories. - * + * * @param appliedCategories the appliedCategories value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -227,7 +205,7 @@ public MicrosoftGraphPlannerTask withAppliedCategories(Map appli /** * Get the assigneePriority property: Hint used to order items of this type in a list view. The format is defined as * outlined here. - * + * * @return the assigneePriority value. */ public String assigneePriority() { @@ -237,7 +215,7 @@ public String assigneePriority() { /** * Set the assigneePriority property: Hint used to order items of this type in a list view. The format is defined as * outlined here. - * + * * @param assigneePriority the assigneePriority value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -248,7 +226,7 @@ public MicrosoftGraphPlannerTask withAssigneePriority(String assigneePriority) { /** * Get the assignments property: plannerAssignments. - * + * * @return the assignments value. */ public Map assignments() { @@ -257,7 +235,7 @@ public Map assignments() { /** * Set the assignments property: plannerAssignments. - * + * * @param assignments the assignments value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -269,7 +247,7 @@ public MicrosoftGraphPlannerTask withAssignments(Map assignments /** * Get the bucketId property: Bucket ID to which the task belongs. The bucket needs to be in the plan that the task * is in. It is 28 characters long and case-sensitive. Format validation is done on the service. - * + * * @return the bucketId value. */ public String bucketId() { @@ -279,7 +257,7 @@ public String bucketId() { /** * Set the bucketId property: Bucket ID to which the task belongs. The bucket needs to be in the plan that the task * is in. It is 28 characters long and case-sensitive. Format validation is done on the service. - * + * * @param bucketId the bucketId value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -290,7 +268,7 @@ public MicrosoftGraphPlannerTask withBucketId(String bucketId) { /** * Get the checklistItemCount property: Number of checklist items that are present on the task. - * + * * @return the checklistItemCount value. */ public Integer checklistItemCount() { @@ -299,7 +277,7 @@ public Integer checklistItemCount() { /** * Set the checklistItemCount property: Number of checklist items that are present on the task. - * + * * @param checklistItemCount the checklistItemCount value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -310,7 +288,7 @@ public MicrosoftGraphPlannerTask withChecklistItemCount(Integer checklistItemCou /** * Get the completedBy property: identitySet. - * + * * @return the completedBy value. */ public MicrosoftGraphIdentitySet completedBy() { @@ -319,7 +297,7 @@ public MicrosoftGraphIdentitySet completedBy() { /** * Set the completedBy property: identitySet. - * + * * @param completedBy the completedBy value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -332,7 +310,7 @@ public MicrosoftGraphPlannerTask withCompletedBy(MicrosoftGraphIdentitySet compl * Get the completedDateTime property: Read-only. Date and time at which the 'percentComplete' of the task is set to * '100'. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. * For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @return the completedDateTime value. */ public OffsetDateTime completedDateTime() { @@ -343,7 +321,7 @@ public OffsetDateTime completedDateTime() { * Set the completedDateTime property: Read-only. Date and time at which the 'percentComplete' of the task is set to * '100'. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. * For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @param completedDateTime the completedDateTime value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -355,7 +333,7 @@ public MicrosoftGraphPlannerTask withCompletedDateTime(OffsetDateTime completedD /** * Get the conversationThreadId property: Thread ID of the conversation on the task. This is the ID of the * conversation thread object created in the group. - * + * * @return the conversationThreadId value. */ public String conversationThreadId() { @@ -365,7 +343,7 @@ public String conversationThreadId() { /** * Set the conversationThreadId property: Thread ID of the conversation on the task. This is the ID of the * conversation thread object created in the group. - * + * * @param conversationThreadId the conversationThreadId value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -376,7 +354,7 @@ public MicrosoftGraphPlannerTask withConversationThreadId(String conversationThr /** * Get the createdBy property: identitySet. - * + * * @return the createdBy value. */ public MicrosoftGraphIdentitySet createdBy() { @@ -385,7 +363,7 @@ public MicrosoftGraphIdentitySet createdBy() { /** * Set the createdBy property: identitySet. - * + * * @param createdBy the createdBy value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -398,7 +376,7 @@ public MicrosoftGraphPlannerTask withCreatedBy(MicrosoftGraphIdentitySet created * Get the createdDateTime property: Read-only. Date and time at which the task is created. The Timestamp type * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -409,7 +387,7 @@ public OffsetDateTime createdDateTime() { * Set the createdDateTime property: Read-only. Date and time at which the task is created. The Timestamp type * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -422,7 +400,7 @@ public MicrosoftGraphPlannerTask withCreatedDateTime(OffsetDateTime createdDateT * Get the dueDateTime property: Date and time at which the task is due. The Timestamp type represents date and time * information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look * like this: '2014-01-01T00:00:00Z'. - * + * * @return the dueDateTime value. */ public OffsetDateTime dueDateTime() { @@ -433,7 +411,7 @@ public OffsetDateTime dueDateTime() { * Set the dueDateTime property: Date and time at which the task is due. The Timestamp type represents date and time * information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look * like this: '2014-01-01T00:00:00Z'. - * + * * @param dueDateTime the dueDateTime value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -445,7 +423,7 @@ public MicrosoftGraphPlannerTask withDueDateTime(OffsetDateTime dueDateTime) { /** * Get the hasDescription property: Read-only. Value is true if the details object of the task has a non-empty * description and false otherwise. - * + * * @return the hasDescription value. */ public Boolean hasDescription() { @@ -455,7 +433,7 @@ public Boolean hasDescription() { /** * Set the hasDescription property: Read-only. Value is true if the details object of the task has a non-empty * description and false otherwise. - * + * * @param hasDescription the hasDescription value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -467,7 +445,7 @@ public MicrosoftGraphPlannerTask withHasDescription(Boolean hasDescription) { /** * Get the orderHint property: Hint used to order items of this type in a list view. The format is defined as * outlined here. - * + * * @return the orderHint value. */ public String orderHint() { @@ -477,7 +455,7 @@ public String orderHint() { /** * Set the orderHint property: Hint used to order items of this type in a list view. The format is defined as * outlined here. - * + * * @param orderHint the orderHint value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -489,7 +467,7 @@ public MicrosoftGraphPlannerTask withOrderHint(String orderHint) { /** * Get the percentComplete property: Percentage of task completion. When set to 100, the task is considered * completed. - * + * * @return the percentComplete value. */ public Integer percentComplete() { @@ -499,7 +477,7 @@ public Integer percentComplete() { /** * Set the percentComplete property: Percentage of task completion. When set to 100, the task is considered * completed. - * + * * @param percentComplete the percentComplete value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -510,7 +488,7 @@ public MicrosoftGraphPlannerTask withPercentComplete(Integer percentComplete) { /** * Get the planId property: Plan ID to which the task belongs. - * + * * @return the planId value. */ public String planId() { @@ -519,7 +497,7 @@ public String planId() { /** * Set the planId property: Plan ID to which the task belongs. - * + * * @param planId the planId value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -530,7 +508,7 @@ public MicrosoftGraphPlannerTask withPlanId(String planId) { /** * Get the previewType property: plannerPreviewType. - * + * * @return the previewType value. */ public MicrosoftGraphPlannerPreviewType previewType() { @@ -539,7 +517,7 @@ public MicrosoftGraphPlannerPreviewType previewType() { /** * Set the previewType property: plannerPreviewType. - * + * * @param previewType the previewType value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -550,7 +528,7 @@ public MicrosoftGraphPlannerTask withPreviewType(MicrosoftGraphPlannerPreviewTyp /** * Get the referenceCount property: Number of external references that exist on the task. - * + * * @return the referenceCount value. */ public Integer referenceCount() { @@ -559,7 +537,7 @@ public Integer referenceCount() { /** * Set the referenceCount property: Number of external references that exist on the task. - * + * * @param referenceCount the referenceCount value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -572,7 +550,7 @@ public MicrosoftGraphPlannerTask withReferenceCount(Integer referenceCount) { * Get the startDateTime property: Date and time at which the task starts. The Timestamp type represents date and * time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would * look like this: '2014-01-01T00:00:00Z'. - * + * * @return the startDateTime value. */ public OffsetDateTime startDateTime() { @@ -583,7 +561,7 @@ public OffsetDateTime startDateTime() { * Set the startDateTime property: Date and time at which the task starts. The Timestamp type represents date and * time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would * look like this: '2014-01-01T00:00:00Z'. - * + * * @param startDateTime the startDateTime value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -594,7 +572,7 @@ public MicrosoftGraphPlannerTask withStartDateTime(OffsetDateTime startDateTime) /** * Get the title property: Title of the task. - * + * * @return the title value. */ public String title() { @@ -603,7 +581,7 @@ public String title() { /** * Set the title property: Title of the task. - * + * * @param title the title value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -614,7 +592,7 @@ public MicrosoftGraphPlannerTask withTitle(String title) { /** * Get the assignedToTaskBoardFormat property: plannerAssignedToTaskBoardTaskFormat. - * + * * @return the assignedToTaskBoardFormat value. */ public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat assignedToTaskBoardFormat() { @@ -623,19 +601,19 @@ public MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat assignedToTaskBoardFor /** * Set the assignedToTaskBoardFormat property: plannerAssignedToTaskBoardTaskFormat. - * + * * @param assignedToTaskBoardFormat the assignedToTaskBoardFormat value to set. * @return the MicrosoftGraphPlannerTask object itself. */ - public MicrosoftGraphPlannerTask withAssignedToTaskBoardFormat( - MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat assignedToTaskBoardFormat) { + public MicrosoftGraphPlannerTask + withAssignedToTaskBoardFormat(MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat assignedToTaskBoardFormat) { this.assignedToTaskBoardFormat = assignedToTaskBoardFormat; return this; } /** * Get the bucketTaskBoardFormat property: plannerBucketTaskBoardTaskFormat. - * + * * @return the bucketTaskBoardFormat value. */ public MicrosoftGraphPlannerBucketTaskBoardTaskFormat bucketTaskBoardFormat() { @@ -644,19 +622,19 @@ public MicrosoftGraphPlannerBucketTaskBoardTaskFormat bucketTaskBoardFormat() { /** * Set the bucketTaskBoardFormat property: plannerBucketTaskBoardTaskFormat. - * + * * @param bucketTaskBoardFormat the bucketTaskBoardFormat value to set. * @return the MicrosoftGraphPlannerTask object itself. */ - public MicrosoftGraphPlannerTask withBucketTaskBoardFormat( - MicrosoftGraphPlannerBucketTaskBoardTaskFormat bucketTaskBoardFormat) { + public MicrosoftGraphPlannerTask + withBucketTaskBoardFormat(MicrosoftGraphPlannerBucketTaskBoardTaskFormat bucketTaskBoardFormat) { this.bucketTaskBoardFormat = bucketTaskBoardFormat; return this; } /** * Get the details property: plannerTaskDetails. - * + * * @return the details value. */ public MicrosoftGraphPlannerTaskDetails details() { @@ -665,7 +643,7 @@ public MicrosoftGraphPlannerTaskDetails details() { /** * Set the details property: plannerTaskDetails. - * + * * @param details the details value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -676,7 +654,7 @@ public MicrosoftGraphPlannerTask withDetails(MicrosoftGraphPlannerTaskDetails de /** * Get the progressTaskBoardFormat property: plannerProgressTaskBoardTaskFormat. - * + * * @return the progressTaskBoardFormat value. */ public MicrosoftGraphPlannerProgressTaskBoardTaskFormat progressTaskBoardFormat() { @@ -685,29 +663,28 @@ public MicrosoftGraphPlannerProgressTaskBoardTaskFormat progressTaskBoardFormat( /** * Set the progressTaskBoardFormat property: plannerProgressTaskBoardTaskFormat. - * + * * @param progressTaskBoardFormat the progressTaskBoardFormat value to set. * @return the MicrosoftGraphPlannerTask object itself. */ - public MicrosoftGraphPlannerTask withProgressTaskBoardFormat( - MicrosoftGraphPlannerProgressTaskBoardTaskFormat progressTaskBoardFormat) { + public MicrosoftGraphPlannerTask + withProgressTaskBoardFormat(MicrosoftGraphPlannerProgressTaskBoardTaskFormat progressTaskBoardFormat) { this.progressTaskBoardFormat = progressTaskBoardFormat; return this; } /** * Get the additionalProperties property: plannerTask. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerTask. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerTask object itself. */ @@ -716,15 +693,9 @@ public MicrosoftGraphPlannerTask withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPlannerTask withId(String id) { super.withId(id); @@ -733,7 +704,7 @@ public MicrosoftGraphPlannerTask withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -758,4 +729,141 @@ public void validate() { progressTaskBoardFormat().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeNumberField("activeChecklistItemCount", this.activeChecklistItemCount); + jsonWriter.writeMapField("appliedCategories", this.appliedCategories, + (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("assigneePriority", this.assigneePriority); + jsonWriter.writeMapField("assignments", this.assignments, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("bucketId", this.bucketId); + jsonWriter.writeNumberField("checklistItemCount", this.checklistItemCount); + jsonWriter.writeJsonField("completedBy", this.completedBy); + jsonWriter.writeStringField("completedDateTime", + this.completedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.completedDateTime)); + jsonWriter.writeStringField("conversationThreadId", this.conversationThreadId); + jsonWriter.writeJsonField("createdBy", this.createdBy); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("dueDateTime", + this.dueDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dueDateTime)); + jsonWriter.writeBooleanField("hasDescription", this.hasDescription); + jsonWriter.writeStringField("orderHint", this.orderHint); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("planId", this.planId); + jsonWriter.writeStringField("previewType", this.previewType == null ? null : this.previewType.toString()); + jsonWriter.writeNumberField("referenceCount", this.referenceCount); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeJsonField("assignedToTaskBoardFormat", this.assignedToTaskBoardFormat); + jsonWriter.writeJsonField("bucketTaskBoardFormat", this.bucketTaskBoardFormat); + jsonWriter.writeJsonField("details", this.details); + jsonWriter.writeJsonField("progressTaskBoardFormat", this.progressTaskBoardFormat); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerTask 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 MicrosoftGraphPlannerTask. + */ + public static MicrosoftGraphPlannerTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerTask deserializedMicrosoftGraphPlannerTask = new MicrosoftGraphPlannerTask(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.withId(reader.getString()); + } else if ("activeChecklistItemCount".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.activeChecklistItemCount + = reader.getNullable(JsonReader::getInt); + } else if ("appliedCategories".equals(fieldName)) { + Map appliedCategories = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphPlannerTask.appliedCategories = appliedCategories; + } else if ("assigneePriority".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.assigneePriority = reader.getString(); + } else if ("assignments".equals(fieldName)) { + Map assignments = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphPlannerTask.assignments = assignments; + } else if ("bucketId".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.bucketId = reader.getString(); + } else if ("checklistItemCount".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.checklistItemCount = reader.getNullable(JsonReader::getInt); + } else if ("completedBy".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.completedBy = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("completedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.completedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("conversationThreadId".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.conversationThreadId = reader.getString(); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.createdBy = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("dueDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.dueDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("hasDescription".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.hasDescription = reader.getNullable(JsonReader::getBoolean); + } else if ("orderHint".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.orderHint = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.percentComplete = reader.getNullable(JsonReader::getInt); + } else if ("planId".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.planId = reader.getString(); + } else if ("previewType".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.previewType + = MicrosoftGraphPlannerPreviewType.fromString(reader.getString()); + } else if ("referenceCount".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.referenceCount = reader.getNullable(JsonReader::getInt); + } else if ("startDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("title".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.title = reader.getString(); + } else if ("assignedToTaskBoardFormat".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.assignedToTaskBoardFormat + = MicrosoftGraphPlannerAssignedToTaskBoardTaskFormat.fromJson(reader); + } else if ("bucketTaskBoardFormat".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.bucketTaskBoardFormat + = MicrosoftGraphPlannerBucketTaskBoardTaskFormat.fromJson(reader); + } else if ("details".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.details = MicrosoftGraphPlannerTaskDetails.fromJson(reader); + } else if ("progressTaskBoardFormat".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTask.progressTaskBoardFormat + = MicrosoftGraphPlannerProgressTaskBoardTaskFormat.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerTask.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerTask; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerTaskDetails.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerTaskDetails.java index 16453acc4e51f..0bc350f66d4ca 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerTaskDetails.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerTaskDetails.java @@ -5,55 +5,52 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** plannerTaskDetails. */ +/** + * plannerTaskDetails. + */ @Fluent public final class MicrosoftGraphPlannerTaskDetails extends MicrosoftGraphEntity { /* * plannerChecklistItems */ - @JsonProperty(value = "checklist") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map checklist; /* * Description of the task */ - @JsonProperty(value = "description") private String description; /* * plannerPreviewType */ - @JsonProperty(value = "previewType") private MicrosoftGraphPlannerPreviewType previewType; /* * plannerExternalReferences */ - @JsonProperty(value = "references") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map references; /* * plannerTaskDetails */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerTaskDetails class. */ + /** + * Creates an instance of MicrosoftGraphPlannerTaskDetails class. + */ public MicrosoftGraphPlannerTaskDetails() { } /** * Get the checklist property: plannerChecklistItems. - * + * * @return the checklist value. */ public Map checklist() { @@ -62,7 +59,7 @@ public Map checklist() { /** * Set the checklist property: plannerChecklistItems. - * + * * @param checklist the checklist value to set. * @return the MicrosoftGraphPlannerTaskDetails object itself. */ @@ -73,7 +70,7 @@ public MicrosoftGraphPlannerTaskDetails withChecklist(Map checkl /** * Get the description property: Description of the task. - * + * * @return the description value. */ public String description() { @@ -82,7 +79,7 @@ public String description() { /** * Set the description property: Description of the task. - * + * * @param description the description value to set. * @return the MicrosoftGraphPlannerTaskDetails object itself. */ @@ -93,7 +90,7 @@ public MicrosoftGraphPlannerTaskDetails withDescription(String description) { /** * Get the previewType property: plannerPreviewType. - * + * * @return the previewType value. */ public MicrosoftGraphPlannerPreviewType previewType() { @@ -102,7 +99,7 @@ public MicrosoftGraphPlannerPreviewType previewType() { /** * Set the previewType property: plannerPreviewType. - * + * * @param previewType the previewType value to set. * @return the MicrosoftGraphPlannerTaskDetails object itself. */ @@ -113,7 +110,7 @@ public MicrosoftGraphPlannerTaskDetails withPreviewType(MicrosoftGraphPlannerPre /** * Get the references property: plannerExternalReferences. - * + * * @return the references value. */ public Map references() { @@ -122,7 +119,7 @@ public Map references() { /** * Set the references property: plannerExternalReferences. - * + * * @param references the references value to set. * @return the MicrosoftGraphPlannerTaskDetails object itself. */ @@ -133,17 +130,16 @@ public MicrosoftGraphPlannerTaskDetails withReferences(Map refer /** * Get the additionalProperties property: plannerTaskDetails. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerTaskDetails. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerTaskDetails object itself. */ @@ -152,15 +148,9 @@ public MicrosoftGraphPlannerTaskDetails withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPlannerTaskDetails withId(String id) { super.withId(id); @@ -169,11 +159,74 @@ public MicrosoftGraphPlannerTaskDetails withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeMapField("checklist", this.checklist, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("previewType", this.previewType == null ? null : this.previewType.toString()); + jsonWriter.writeMapField("references", this.references, (writer, element) -> writer.writeUntyped(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerTaskDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerTaskDetails 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 MicrosoftGraphPlannerTaskDetails. + */ + public static MicrosoftGraphPlannerTaskDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerTaskDetails deserializedMicrosoftGraphPlannerTaskDetails + = new MicrosoftGraphPlannerTaskDetails(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTaskDetails.withId(reader.getString()); + } else if ("checklist".equals(fieldName)) { + Map checklist = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphPlannerTaskDetails.checklist = checklist; + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTaskDetails.description = reader.getString(); + } else if ("previewType".equals(fieldName)) { + deserializedMicrosoftGraphPlannerTaskDetails.previewType + = MicrosoftGraphPlannerPreviewType.fromString(reader.getString()); + } else if ("references".equals(fieldName)) { + Map references = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedMicrosoftGraphPlannerTaskDetails.references = references; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerTaskDetails.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerTaskDetails; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerUser.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerUser.java index b785fbba614da..27f734f1bc876 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerUser.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPlannerUser.java @@ -5,41 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** plannerUser. */ +/** + * plannerUser. + */ @Fluent public final class MicrosoftGraphPlannerUser extends MicrosoftGraphEntity { /* * Read-only. Nullable. Returns the plannerTasks assigned to the user. */ - @JsonProperty(value = "plans") private List plans; /* * Read-only. Nullable. Returns the plannerPlans shared with the user. */ - @JsonProperty(value = "tasks") private List tasks; /* * plannerUser */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPlannerUser class. */ + /** + * Creates an instance of MicrosoftGraphPlannerUser class. + */ public MicrosoftGraphPlannerUser() { } /** * Get the plans property: Read-only. Nullable. Returns the plannerTasks assigned to the user. - * + * * @return the plans value. */ public List plans() { @@ -48,7 +50,7 @@ public List plans() { /** * Set the plans property: Read-only. Nullable. Returns the plannerTasks assigned to the user. - * + * * @param plans the plans value to set. * @return the MicrosoftGraphPlannerUser object itself. */ @@ -59,7 +61,7 @@ public MicrosoftGraphPlannerUser withPlans(List plans /** * Get the tasks property: Read-only. Nullable. Returns the plannerPlans shared with the user. - * + * * @return the tasks value. */ public List tasks() { @@ -68,7 +70,7 @@ public List tasks() { /** * Set the tasks property: Read-only. Nullable. Returns the plannerPlans shared with the user. - * + * * @param tasks the tasks value to set. * @return the MicrosoftGraphPlannerUser object itself. */ @@ -79,17 +81,16 @@ public MicrosoftGraphPlannerUser withTasks(List tasks /** * Get the additionalProperties property: plannerUser. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: plannerUser. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPlannerUser object itself. */ @@ -98,15 +99,9 @@ public MicrosoftGraphPlannerUser withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPlannerUser withId(String id) { super.withId(id); @@ -115,7 +110,7 @@ public MicrosoftGraphPlannerUser withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -128,4 +123,61 @@ public void validate() { tasks().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("plans", this.plans, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPlannerUser from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPlannerUser 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 MicrosoftGraphPlannerUser. + */ + public static MicrosoftGraphPlannerUser fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPlannerUser deserializedMicrosoftGraphPlannerUser = new MicrosoftGraphPlannerUser(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPlannerUser.withId(reader.getString()); + } else if ("plans".equals(fieldName)) { + List plans + = reader.readArray(reader1 -> MicrosoftGraphPlannerPlan.fromJson(reader1)); + deserializedMicrosoftGraphPlannerUser.plans = plans; + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> MicrosoftGraphPlannerTask.fromJson(reader1)); + deserializedMicrosoftGraphPlannerUser.tasks = tasks; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPlannerUser.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPlannerUser; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPolicyBase.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPolicyBase.java index c3bfa118fec4c..8a0916fa15aa7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPolicyBase.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPolicyBase.java @@ -5,18 +5,20 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; /** * policyBase - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -24,28 +26,28 @@ public class MicrosoftGraphPolicyBase extends MicrosoftGraphDirectoryObjectInner /* * Description for this policy. */ - @JsonProperty(value = "description") private String description; /* * Display name for this policy. */ - @JsonProperty(value = "displayName") private String displayName; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPolicyBase class. */ + /** + * Creates an instance of MicrosoftGraphPolicyBase class. + */ public MicrosoftGraphPolicyBase() { } /** * Get the description property: Description for this policy. - * + * * @return the description value. */ public String description() { @@ -54,7 +56,7 @@ public String description() { /** * Set the description property: Description for this policy. - * + * * @param description the description value to set. * @return the MicrosoftGraphPolicyBase object itself. */ @@ -65,7 +67,7 @@ public MicrosoftGraphPolicyBase withDescription(String description) { /** * Get the displayName property: Display name for this policy. - * + * * @return the displayName value. */ public String displayName() { @@ -74,7 +76,7 @@ public String displayName() { /** * Set the displayName property: Display name for this policy. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphPolicyBase object itself. */ @@ -86,10 +88,9 @@ public MicrosoftGraphPolicyBase withDisplayName(String displayName) { /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -97,7 +98,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPolicyBase object itself. */ @@ -106,22 +107,18 @@ public MicrosoftGraphPolicyBase withAdditionalProperties(Map add return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPolicyBase withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPolicyBase withId(String id) { super.withId(id); @@ -130,11 +127,69 @@ public MicrosoftGraphPolicyBase withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPolicyBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPolicyBase 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 MicrosoftGraphPolicyBase. + */ + public static MicrosoftGraphPolicyBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPolicyBase deserializedMicrosoftGraphPolicyBase = new MicrosoftGraphPolicyBase(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPolicyBase.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPolicyBase.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphPolicyBase.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphPolicyBase.displayName = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPolicyBase.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPolicyBase; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPolicyPlatformType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPolicyPlatformType.java index 566c0e31b7d32..5797d4634d7cc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPolicyPlatformType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPolicyPlatformType.java @@ -5,38 +5,55 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** policyPlatformType. */ +/** + * policyPlatformType. + */ public final class MicrosoftGraphPolicyPlatformType extends ExpandableStringEnum { - /** Static value android for MicrosoftGraphPolicyPlatformType. */ + /** + * Static value android for MicrosoftGraphPolicyPlatformType. + */ public static final MicrosoftGraphPolicyPlatformType ANDROID = fromString("android"); - /** Static value iOS for MicrosoftGraphPolicyPlatformType. */ + /** + * Static value iOS for MicrosoftGraphPolicyPlatformType. + */ public static final MicrosoftGraphPolicyPlatformType I_OS = fromString("iOS"); - /** Static value macOS for MicrosoftGraphPolicyPlatformType. */ + /** + * Static value macOS for MicrosoftGraphPolicyPlatformType. + */ public static final MicrosoftGraphPolicyPlatformType MAC_OS = fromString("macOS"); - /** Static value windowsPhone81 for MicrosoftGraphPolicyPlatformType. */ + /** + * Static value windowsPhone81 for MicrosoftGraphPolicyPlatformType. + */ public static final MicrosoftGraphPolicyPlatformType WINDOWS_PHONE81 = fromString("windowsPhone81"); - /** Static value windows81AndLater for MicrosoftGraphPolicyPlatformType. */ + /** + * Static value windows81AndLater for MicrosoftGraphPolicyPlatformType. + */ public static final MicrosoftGraphPolicyPlatformType WINDOWS81AND_LATER = fromString("windows81AndLater"); - /** Static value windows10AndLater for MicrosoftGraphPolicyPlatformType. */ + /** + * Static value windows10AndLater for MicrosoftGraphPolicyPlatformType. + */ public static final MicrosoftGraphPolicyPlatformType WINDOWS10AND_LATER = fromString("windows10AndLater"); - /** Static value androidWorkProfile for MicrosoftGraphPolicyPlatformType. */ + /** + * Static value androidWorkProfile for MicrosoftGraphPolicyPlatformType. + */ public static final MicrosoftGraphPolicyPlatformType ANDROID_WORK_PROFILE = fromString("androidWorkProfile"); - /** Static value all for MicrosoftGraphPolicyPlatformType. */ + /** + * Static value all for MicrosoftGraphPolicyPlatformType. + */ public static final MicrosoftGraphPolicyPlatformType ALL = fromString("all"); /** * Creates a new instance of MicrosoftGraphPolicyPlatformType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -45,18 +62,17 @@ public MicrosoftGraphPolicyPlatformType() { /** * Creates or finds a MicrosoftGraphPolicyPlatformType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphPolicyPlatformType. */ - @JsonCreator public static MicrosoftGraphPolicyPlatformType fromString(String name) { return fromString(name, MicrosoftGraphPolicyPlatformType.class); } /** * Gets known MicrosoftGraphPolicyPlatformType values. - * + * * @return known MicrosoftGraphPolicyPlatformType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPost.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPost.java index 4fc5e74e60e26..1ed9a070b4370 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPost.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPost.java @@ -5,110 +5,103 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** post. */ +/** + * post. + */ @Fluent public final class MicrosoftGraphPost extends MicrosoftGraphOutlookItem { /* * itemBody */ - @JsonProperty(value = "body") private MicrosoftGraphItemBody body; /* * Unique ID of the conversation. Read-only. */ - @JsonProperty(value = "conversationId") private String conversationId; /* * Unique ID of the conversation thread. Read-only. */ - @JsonProperty(value = "conversationThreadId") private String conversationThreadId; /* * recipient */ - @JsonProperty(value = "from") private MicrosoftGraphRecipient from; /* * Indicates whether the post has at least one attachment. This is a default property. */ - @JsonProperty(value = "hasAttachments") private Boolean hasAttachments; /* * Conversation participants that were added to the thread as part of this post. */ - @JsonProperty(value = "newParticipants") private List newParticipants; /* - * Specifies when the post was received. The DateTimeOffset type represents date and time information using ISO - * 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: + * Specifies when the post was received. The DateTimeOffset type represents date and time information using ISO 8601 + * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "receivedDateTime") private OffsetDateTime receivedDateTime; /* * recipient */ - @JsonProperty(value = "sender") private MicrosoftGraphRecipient sender; /* * Read-only. Nullable. */ - @JsonProperty(value = "attachments") private List attachments; /* * The collection of open extensions defined for the post. Read-only. Nullable. */ - @JsonProperty(value = "extensions") private List extensions; /* * post */ - @JsonProperty(value = "inReplyTo") private MicrosoftGraphPost inReplyTo; /* * The collection of multi-value extended properties defined for the post. Read-only. Nullable. */ - @JsonProperty(value = "multiValueExtendedProperties") private List multiValueExtendedProperties; /* * The collection of single-value extended properties defined for the post. Read-only. Nullable. */ - @JsonProperty(value = "singleValueExtendedProperties") private List singleValueExtendedProperties; /* * post */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPost class. */ + /** + * Creates an instance of MicrosoftGraphPost class. + */ public MicrosoftGraphPost() { } /** * Get the body property: itemBody. - * + * * @return the body value. */ public MicrosoftGraphItemBody body() { @@ -117,7 +110,7 @@ public MicrosoftGraphItemBody body() { /** * Set the body property: itemBody. - * + * * @param body the body value to set. * @return the MicrosoftGraphPost object itself. */ @@ -128,7 +121,7 @@ public MicrosoftGraphPost withBody(MicrosoftGraphItemBody body) { /** * Get the conversationId property: Unique ID of the conversation. Read-only. - * + * * @return the conversationId value. */ public String conversationId() { @@ -137,7 +130,7 @@ public String conversationId() { /** * Set the conversationId property: Unique ID of the conversation. Read-only. - * + * * @param conversationId the conversationId value to set. * @return the MicrosoftGraphPost object itself. */ @@ -148,7 +141,7 @@ public MicrosoftGraphPost withConversationId(String conversationId) { /** * Get the conversationThreadId property: Unique ID of the conversation thread. Read-only. - * + * * @return the conversationThreadId value. */ public String conversationThreadId() { @@ -157,7 +150,7 @@ public String conversationThreadId() { /** * Set the conversationThreadId property: Unique ID of the conversation thread. Read-only. - * + * * @param conversationThreadId the conversationThreadId value to set. * @return the MicrosoftGraphPost object itself. */ @@ -168,7 +161,7 @@ public MicrosoftGraphPost withConversationThreadId(String conversationThreadId) /** * Get the from property: recipient. - * + * * @return the from value. */ public MicrosoftGraphRecipient from() { @@ -177,7 +170,7 @@ public MicrosoftGraphRecipient from() { /** * Set the from property: recipient. - * + * * @param from the from value to set. * @return the MicrosoftGraphPost object itself. */ @@ -189,7 +182,7 @@ public MicrosoftGraphPost withFrom(MicrosoftGraphRecipient from) { /** * Get the hasAttachments property: Indicates whether the post has at least one attachment. This is a default * property. - * + * * @return the hasAttachments value. */ public Boolean hasAttachments() { @@ -199,7 +192,7 @@ public Boolean hasAttachments() { /** * Set the hasAttachments property: Indicates whether the post has at least one attachment. This is a default * property. - * + * * @param hasAttachments the hasAttachments value to set. * @return the MicrosoftGraphPost object itself. */ @@ -210,7 +203,7 @@ public MicrosoftGraphPost withHasAttachments(Boolean hasAttachments) { /** * Get the newParticipants property: Conversation participants that were added to the thread as part of this post. - * + * * @return the newParticipants value. */ public List newParticipants() { @@ -219,7 +212,7 @@ public List newParticipants() { /** * Set the newParticipants property: Conversation participants that were added to the thread as part of this post. - * + * * @param newParticipants the newParticipants value to set. * @return the MicrosoftGraphPost object itself. */ @@ -232,7 +225,7 @@ public MicrosoftGraphPost withNewParticipants(List newP * Get the receivedDateTime property: Specifies when the post was received. The DateTimeOffset type represents date * and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 * would look like this: '2014-01-01T00:00:00Z'. - * + * * @return the receivedDateTime value. */ public OffsetDateTime receivedDateTime() { @@ -243,7 +236,7 @@ public OffsetDateTime receivedDateTime() { * Set the receivedDateTime property: Specifies when the post was received. The DateTimeOffset type represents date * and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 * would look like this: '2014-01-01T00:00:00Z'. - * + * * @param receivedDateTime the receivedDateTime value to set. * @return the MicrosoftGraphPost object itself. */ @@ -254,7 +247,7 @@ public MicrosoftGraphPost withReceivedDateTime(OffsetDateTime receivedDateTime) /** * Get the sender property: recipient. - * + * * @return the sender value. */ public MicrosoftGraphRecipient sender() { @@ -263,7 +256,7 @@ public MicrosoftGraphRecipient sender() { /** * Set the sender property: recipient. - * + * * @param sender the sender value to set. * @return the MicrosoftGraphPost object itself. */ @@ -274,7 +267,7 @@ public MicrosoftGraphPost withSender(MicrosoftGraphRecipient sender) { /** * Get the attachments property: Read-only. Nullable. - * + * * @return the attachments value. */ public List attachments() { @@ -283,7 +276,7 @@ public List attachments() { /** * Set the attachments property: Read-only. Nullable. - * + * * @param attachments the attachments value to set. * @return the MicrosoftGraphPost object itself. */ @@ -294,7 +287,7 @@ public MicrosoftGraphPost withAttachments(List attachm /** * Get the extensions property: The collection of open extensions defined for the post. Read-only. Nullable. - * + * * @return the extensions value. */ public List extensions() { @@ -303,7 +296,7 @@ public List extensions() { /** * Set the extensions property: The collection of open extensions defined for the post. Read-only. Nullable. - * + * * @param extensions the extensions value to set. * @return the MicrosoftGraphPost object itself. */ @@ -314,7 +307,7 @@ public MicrosoftGraphPost withExtensions(List extension /** * Get the inReplyTo property: post. - * + * * @return the inReplyTo value. */ public MicrosoftGraphPost inReplyTo() { @@ -323,7 +316,7 @@ public MicrosoftGraphPost inReplyTo() { /** * Set the inReplyTo property: post. - * + * * @param inReplyTo the inReplyTo value to set. * @return the MicrosoftGraphPost object itself. */ @@ -335,7 +328,7 @@ public MicrosoftGraphPost withInReplyTo(MicrosoftGraphPost inReplyTo) { /** * Get the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * post. Read-only. Nullable. - * + * * @return the multiValueExtendedProperties value. */ public List multiValueExtendedProperties() { @@ -345,7 +338,7 @@ public List multiValueExtendedPr /** * Set the multiValueExtendedProperties property: The collection of multi-value extended properties defined for the * post. Read-only. Nullable. - * + * * @param multiValueExtendedProperties the multiValueExtendedProperties value to set. * @return the MicrosoftGraphPost object itself. */ @@ -358,7 +351,7 @@ public MicrosoftGraphPost withMultiValueExtendedProperties( /** * Get the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the post. Read-only. Nullable. - * + * * @return the singleValueExtendedProperties value. */ public List singleValueExtendedProperties() { @@ -368,7 +361,7 @@ public List singleValueExtended /** * Set the singleValueExtendedProperties property: The collection of single-value extended properties defined for * the post. Read-only. Nullable. - * + * * @param singleValueExtendedProperties the singleValueExtendedProperties value to set. * @return the MicrosoftGraphPost object itself. */ @@ -380,17 +373,16 @@ public MicrosoftGraphPost withSingleValueExtendedProperties( /** * Get the additionalProperties property: post. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: post. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPost object itself. */ @@ -399,43 +391,45 @@ public MicrosoftGraphPost withAdditionalProperties(Map additiona return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPost withCategories(List categories) { super.withCategories(categories); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPost withChangeKey(String changeKey) { super.withChangeKey(changeKey); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPost withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPost withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPost withId(String id) { super.withId(id); @@ -444,7 +438,7 @@ public MicrosoftGraphPost withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -478,4 +472,126 @@ public void validate() { singleValueExtendedProperties().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeArrayField("categories", categories(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("changeKey", changeKey()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeJsonField("body", this.body); + jsonWriter.writeStringField("conversationId", this.conversationId); + jsonWriter.writeStringField("conversationThreadId", this.conversationThreadId); + jsonWriter.writeJsonField("from", this.from); + jsonWriter.writeBooleanField("hasAttachments", this.hasAttachments); + jsonWriter.writeArrayField("newParticipants", this.newParticipants, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("receivedDateTime", + this.receivedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.receivedDateTime)); + jsonWriter.writeJsonField("sender", this.sender); + jsonWriter.writeArrayField("attachments", this.attachments, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("inReplyTo", this.inReplyTo); + jsonWriter.writeArrayField("multiValueExtendedProperties", this.multiValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("singleValueExtendedProperties", this.singleValueExtendedProperties, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPost from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPost 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 MicrosoftGraphPost. + */ + public static MicrosoftGraphPost fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPost deserializedMicrosoftGraphPost = new MicrosoftGraphPost(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPost.withId(reader.getString()); + } else if ("categories".equals(fieldName)) { + List categories = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphPost.withCategories(categories); + } else if ("changeKey".equals(fieldName)) { + deserializedMicrosoftGraphPost.withChangeKey(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPost.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPost.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("body".equals(fieldName)) { + deserializedMicrosoftGraphPost.body = MicrosoftGraphItemBody.fromJson(reader); + } else if ("conversationId".equals(fieldName)) { + deserializedMicrosoftGraphPost.conversationId = reader.getString(); + } else if ("conversationThreadId".equals(fieldName)) { + deserializedMicrosoftGraphPost.conversationThreadId = reader.getString(); + } else if ("from".equals(fieldName)) { + deserializedMicrosoftGraphPost.from = MicrosoftGraphRecipient.fromJson(reader); + } else if ("hasAttachments".equals(fieldName)) { + deserializedMicrosoftGraphPost.hasAttachments = reader.getNullable(JsonReader::getBoolean); + } else if ("newParticipants".equals(fieldName)) { + List newParticipants + = reader.readArray(reader1 -> MicrosoftGraphRecipient.fromJson(reader1)); + deserializedMicrosoftGraphPost.newParticipants = newParticipants; + } else if ("receivedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphPost.receivedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sender".equals(fieldName)) { + deserializedMicrosoftGraphPost.sender = MicrosoftGraphRecipient.fromJson(reader); + } else if ("attachments".equals(fieldName)) { + List attachments + = reader.readArray(reader1 -> MicrosoftGraphAttachment.fromJson(reader1)); + deserializedMicrosoftGraphPost.attachments = attachments; + } else if ("extensions".equals(fieldName)) { + List extensions + = reader.readArray(reader1 -> MicrosoftGraphExtension.fromJson(reader1)); + deserializedMicrosoftGraphPost.extensions = extensions; + } else if ("inReplyTo".equals(fieldName)) { + deserializedMicrosoftGraphPost.inReplyTo = MicrosoftGraphPost.fromJson(reader); + } else if ("multiValueExtendedProperties".equals(fieldName)) { + List multiValueExtendedProperties + = reader.readArray(reader1 -> MicrosoftGraphMultiValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphPost.multiValueExtendedProperties = multiValueExtendedProperties; + } else if ("singleValueExtendedProperties".equals(fieldName)) { + List singleValueExtendedProperties = reader + .readArray(reader1 -> MicrosoftGraphSingleValueLegacyExtendedProperty.fromJson(reader1)); + deserializedMicrosoftGraphPost.singleValueExtendedProperties = singleValueExtendedProperties; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPost.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPost; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPreAuthorizedApplication.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPreAuthorizedApplication.java index d843c3a103b2b..c0df2d9fc710e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPreAuthorizedApplication.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPreAuthorizedApplication.java @@ -5,41 +5,45 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** preAuthorizedApplication. */ +/** + * preAuthorizedApplication. + */ @Fluent -public final class MicrosoftGraphPreAuthorizedApplication { +public final class MicrosoftGraphPreAuthorizedApplication + implements JsonSerializable { /* * The unique identifier for the application. */ - @JsonProperty(value = "appId") private String appId; /* * The unique identifier for the oauth2PermissionScopes the application requires. */ - @JsonProperty(value = "delegatedPermissionIds") private List delegatedPermissionIds; /* * preAuthorizedApplication */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPreAuthorizedApplication class. */ + /** + * Creates an instance of MicrosoftGraphPreAuthorizedApplication class. + */ public MicrosoftGraphPreAuthorizedApplication() { } /** * Get the appId property: The unique identifier for the application. - * + * * @return the appId value. */ public String appId() { @@ -48,7 +52,7 @@ public String appId() { /** * Set the appId property: The unique identifier for the application. - * + * * @param appId the appId value to set. * @return the MicrosoftGraphPreAuthorizedApplication object itself. */ @@ -60,7 +64,7 @@ public MicrosoftGraphPreAuthorizedApplication withAppId(String appId) { /** * Get the delegatedPermissionIds property: The unique identifier for the oauth2PermissionScopes the application * requires. - * + * * @return the delegatedPermissionIds value. */ public List delegatedPermissionIds() { @@ -70,7 +74,7 @@ public List delegatedPermissionIds() { /** * Set the delegatedPermissionIds property: The unique identifier for the oauth2PermissionScopes the application * requires. - * + * * @param delegatedPermissionIds the delegatedPermissionIds value to set. * @return the MicrosoftGraphPreAuthorizedApplication object itself. */ @@ -81,17 +85,16 @@ public MicrosoftGraphPreAuthorizedApplication withDelegatedPermissionIds(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: preAuthorizedApplication. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPreAuthorizedApplication object itself. */ @@ -100,19 +103,64 @@ public MicrosoftGraphPreAuthorizedApplication withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appId", this.appId); + jsonWriter.writeArrayField("delegatedPermissionIds", this.delegatedPermissionIds, + (writer, element) -> writer.writeString(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPreAuthorizedApplication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPreAuthorizedApplication 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 MicrosoftGraphPreAuthorizedApplication. + */ + public static MicrosoftGraphPreAuthorizedApplication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPreAuthorizedApplication deserializedMicrosoftGraphPreAuthorizedApplication + = new MicrosoftGraphPreAuthorizedApplication(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appId".equals(fieldName)) { + deserializedMicrosoftGraphPreAuthorizedApplication.appId = reader.getString(); + } else if ("delegatedPermissionIds".equals(fieldName)) { + List delegatedPermissionIds = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphPreAuthorizedApplication.delegatedPermissionIds = delegatedPermissionIds; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPreAuthorizedApplication.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPreAuthorizedApplication; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPresence.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPresence.java index 9b9b81639aea1..08241ac7e72f4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPresence.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPresence.java @@ -5,14 +5,16 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** presence. */ +/** + * presence. + */ @Fluent public final class MicrosoftGraphPresence extends MicrosoftGraphEntity { /* @@ -20,22 +22,22 @@ public final class MicrosoftGraphPresence extends MicrosoftGraphEntity { * DoNotDisturb, InACall, InAConferenceCall, Inactive,InAMeeting, Offline, OffWork,OutOfOffice, * PresenceUnknown,Presenting, UrgentInterruptionsOnly. */ - @JsonProperty(value = "activity") private String activity; /* - * The base presence information for a user. Possible values are Available, AvailableIdle, Away, BeRightBack, - * Busy, BusyIdle, DoNotDisturb, Offline, PresenceUnknown + * The base presence information for a user. Possible values are Available, AvailableIdle, Away, BeRightBack, Busy, + * BusyIdle, DoNotDisturb, Offline, PresenceUnknown */ - @JsonProperty(value = "availability") private String availability; /* * presence */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPresence class. */ + /** + * Creates an instance of MicrosoftGraphPresence class. + */ public MicrosoftGraphPresence() { } @@ -43,7 +45,7 @@ public MicrosoftGraphPresence() { * Get the activity property: The supplemental information to a user's availability. Possible values are Available, * Away, BeRightBack,Busy, DoNotDisturb, InACall, InAConferenceCall, Inactive,InAMeeting, Offline, * OffWork,OutOfOffice, PresenceUnknown,Presenting, UrgentInterruptionsOnly. - * + * * @return the activity value. */ public String activity() { @@ -54,7 +56,7 @@ public String activity() { * Set the activity property: The supplemental information to a user's availability. Possible values are Available, * Away, BeRightBack,Busy, DoNotDisturb, InACall, InAConferenceCall, Inactive,InAMeeting, Offline, * OffWork,OutOfOffice, PresenceUnknown,Presenting, UrgentInterruptionsOnly. - * + * * @param activity the activity value to set. * @return the MicrosoftGraphPresence object itself. */ @@ -66,7 +68,7 @@ public MicrosoftGraphPresence withActivity(String activity) { /** * Get the availability property: The base presence information for a user. Possible values are Available, * AvailableIdle, Away, BeRightBack, Busy, BusyIdle, DoNotDisturb, Offline, PresenceUnknown. - * + * * @return the availability value. */ public String availability() { @@ -76,7 +78,7 @@ public String availability() { /** * Set the availability property: The base presence information for a user. Possible values are Available, * AvailableIdle, Away, BeRightBack, Busy, BusyIdle, DoNotDisturb, Offline, PresenceUnknown. - * + * * @param availability the availability value to set. * @return the MicrosoftGraphPresence object itself. */ @@ -87,17 +89,16 @@ public MicrosoftGraphPresence withAvailability(String availability) { /** * Get the additionalProperties property: presence. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: presence. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPresence object itself. */ @@ -106,15 +107,9 @@ public MicrosoftGraphPresence withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphPresence withId(String id) { super.withId(id); @@ -123,11 +118,64 @@ public MicrosoftGraphPresence withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("activity", this.activity); + jsonWriter.writeStringField("availability", this.availability); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPresence from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPresence 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 MicrosoftGraphPresence. + */ + public static MicrosoftGraphPresence fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPresence deserializedMicrosoftGraphPresence = new MicrosoftGraphPresence(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphPresence.withId(reader.getString()); + } else if ("activity".equals(fieldName)) { + deserializedMicrosoftGraphPresence.activity = reader.getString(); + } else if ("availability".equals(fieldName)) { + deserializedMicrosoftGraphPresence.availability = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPresence.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPresence; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPrivacyProfile.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPrivacyProfile.java index 7f03397cfbac3..ad06ac34d42c4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPrivacyProfile.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPrivacyProfile.java @@ -5,41 +5,44 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** privacyProfile. */ +/** + * privacyProfile. + */ @Fluent -public final class MicrosoftGraphPrivacyProfile { +public final class MicrosoftGraphPrivacyProfile implements JsonSerializable { /* * A valid smtp email address for the privacy statement contact. Not required. */ - @JsonProperty(value = "contactEmail") private String contactEmail; /* * A valid URL format that begins with http:// or https://. Maximum length is 255 characters. The URL that directs * to the company's privacy statement. Not required. */ - @JsonProperty(value = "statementUrl") private String statementUrl; /* * privacyProfile */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPrivacyProfile class. */ + /** + * Creates an instance of MicrosoftGraphPrivacyProfile class. + */ public MicrosoftGraphPrivacyProfile() { } /** * Get the contactEmail property: A valid smtp email address for the privacy statement contact. Not required. - * + * * @return the contactEmail value. */ public String contactEmail() { @@ -48,7 +51,7 @@ public String contactEmail() { /** * Set the contactEmail property: A valid smtp email address for the privacy statement contact. Not required. - * + * * @param contactEmail the contactEmail value to set. * @return the MicrosoftGraphPrivacyProfile object itself. */ @@ -60,7 +63,7 @@ public MicrosoftGraphPrivacyProfile withContactEmail(String contactEmail) { /** * Get the statementUrl property: A valid URL format that begins with http:// or https://. Maximum length is 255 * characters. The URL that directs to the company's privacy statement. Not required. - * + * * @return the statementUrl value. */ public String statementUrl() { @@ -70,7 +73,7 @@ public String statementUrl() { /** * Set the statementUrl property: A valid URL format that begins with http:// or https://. Maximum length is 255 * characters. The URL that directs to the company's privacy statement. Not required. - * + * * @param statementUrl the statementUrl value to set. * @return the MicrosoftGraphPrivacyProfile object itself. */ @@ -81,17 +84,16 @@ public MicrosoftGraphPrivacyProfile withStatementUrl(String statementUrl) { /** * Get the additionalProperties property: privacyProfile. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: privacyProfile. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPrivacyProfile object itself. */ @@ -100,19 +102,61 @@ public MicrosoftGraphPrivacyProfile withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("contactEmail", this.contactEmail); + jsonWriter.writeStringField("statementUrl", this.statementUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPrivacyProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPrivacyProfile 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 MicrosoftGraphPrivacyProfile. + */ + public static MicrosoftGraphPrivacyProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPrivacyProfile deserializedMicrosoftGraphPrivacyProfile = new MicrosoftGraphPrivacyProfile(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("contactEmail".equals(fieldName)) { + deserializedMicrosoftGraphPrivacyProfile.contactEmail = reader.getString(); + } else if ("statementUrl".equals(fieldName)) { + deserializedMicrosoftGraphPrivacyProfile.statementUrl = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPrivacyProfile.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPrivacyProfile; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphProfilePhoto.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphProfilePhoto.java index 2757d9c65b641..1cf1f0969e551 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphProfilePhoto.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphProfilePhoto.java @@ -5,40 +5,42 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** profilePhoto. */ +/** + * profilePhoto. + */ @Fluent public final class MicrosoftGraphProfilePhoto extends MicrosoftGraphEntity { /* * The height of the photo. Read-only. */ - @JsonProperty(value = "height") private Integer height; /* * The width of the photo. Read-only. */ - @JsonProperty(value = "width") private Integer width; /* * profilePhoto */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphProfilePhoto class. */ + /** + * Creates an instance of MicrosoftGraphProfilePhoto class. + */ public MicrosoftGraphProfilePhoto() { } /** * Get the height property: The height of the photo. Read-only. - * + * * @return the height value. */ public Integer height() { @@ -47,7 +49,7 @@ public Integer height() { /** * Set the height property: The height of the photo. Read-only. - * + * * @param height the height value to set. * @return the MicrosoftGraphProfilePhoto object itself. */ @@ -58,7 +60,7 @@ public MicrosoftGraphProfilePhoto withHeight(Integer height) { /** * Get the width property: The width of the photo. Read-only. - * + * * @return the width value. */ public Integer width() { @@ -67,7 +69,7 @@ public Integer width() { /** * Set the width property: The width of the photo. Read-only. - * + * * @param width the width value to set. * @return the MicrosoftGraphProfilePhoto object itself. */ @@ -78,17 +80,16 @@ public MicrosoftGraphProfilePhoto withWidth(Integer width) { /** * Get the additionalProperties property: profilePhoto. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: profilePhoto. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphProfilePhoto object itself. */ @@ -97,15 +98,9 @@ public MicrosoftGraphProfilePhoto withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphProfilePhoto withId(String id) { super.withId(id); @@ -114,11 +109,64 @@ public MicrosoftGraphProfilePhoto withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeNumberField("height", this.height); + jsonWriter.writeNumberField("width", this.width); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphProfilePhoto from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphProfilePhoto 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 MicrosoftGraphProfilePhoto. + */ + public static MicrosoftGraphProfilePhoto fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphProfilePhoto deserializedMicrosoftGraphProfilePhoto = new MicrosoftGraphProfilePhoto(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphProfilePhoto.withId(reader.getString()); + } else if ("height".equals(fieldName)) { + deserializedMicrosoftGraphProfilePhoto.height = reader.getNullable(JsonReader::getInt); + } else if ("width".equals(fieldName)) { + deserializedMicrosoftGraphProfilePhoto.width = reader.getNullable(JsonReader::getInt); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphProfilePhoto.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphProfilePhoto; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphProvisionedPlan.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphProvisionedPlan.java index 5f07b6b6af42e..1e0488e008a7a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphProvisionedPlan.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphProvisionedPlan.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** provisionedPlan. */ +/** + * provisionedPlan. + */ @Fluent -public final class MicrosoftGraphProvisionedPlan { +public final class MicrosoftGraphProvisionedPlan implements JsonSerializable { /* * For example, 'Enabled'. */ - @JsonProperty(value = "capabilityStatus") private String capabilityStatus; /* * For example, 'Success'. */ - @JsonProperty(value = "provisioningStatus") private String provisioningStatus; /* * The name of the service; for example, 'AccessControlS2S' */ - @JsonProperty(value = "service") private String service; /* * provisionedPlan */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphProvisionedPlan class. */ + /** + * Creates an instance of MicrosoftGraphProvisionedPlan class. + */ public MicrosoftGraphProvisionedPlan() { } /** * Get the capabilityStatus property: For example, 'Enabled'. - * + * * @return the capabilityStatus value. */ public String capabilityStatus() { @@ -53,7 +55,7 @@ public String capabilityStatus() { /** * Set the capabilityStatus property: For example, 'Enabled'. - * + * * @param capabilityStatus the capabilityStatus value to set. * @return the MicrosoftGraphProvisionedPlan object itself. */ @@ -64,7 +66,7 @@ public MicrosoftGraphProvisionedPlan withCapabilityStatus(String capabilityStatu /** * Get the provisioningStatus property: For example, 'Success'. - * + * * @return the provisioningStatus value. */ public String provisioningStatus() { @@ -73,7 +75,7 @@ public String provisioningStatus() { /** * Set the provisioningStatus property: For example, 'Success'. - * + * * @param provisioningStatus the provisioningStatus value to set. * @return the MicrosoftGraphProvisionedPlan object itself. */ @@ -84,7 +86,7 @@ public MicrosoftGraphProvisionedPlan withProvisioningStatus(String provisioningS /** * Get the service property: The name of the service; for example, 'AccessControlS2S'. - * + * * @return the service value. */ public String service() { @@ -93,7 +95,7 @@ public String service() { /** * Set the service property: The name of the service; for example, 'AccessControlS2S'. - * + * * @param service the service value to set. * @return the MicrosoftGraphProvisionedPlan object itself. */ @@ -104,17 +106,16 @@ public MicrosoftGraphProvisionedPlan withService(String service) { /** * Get the additionalProperties property: provisionedPlan. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: provisionedPlan. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphProvisionedPlan object itself. */ @@ -123,19 +124,65 @@ public MicrosoftGraphProvisionedPlan withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("capabilityStatus", this.capabilityStatus); + jsonWriter.writeStringField("provisioningStatus", this.provisioningStatus); + jsonWriter.writeStringField("service", this.service); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphProvisionedPlan from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphProvisionedPlan 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 MicrosoftGraphProvisionedPlan. + */ + public static MicrosoftGraphProvisionedPlan fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphProvisionedPlan deserializedMicrosoftGraphProvisionedPlan + = new MicrosoftGraphProvisionedPlan(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capabilityStatus".equals(fieldName)) { + deserializedMicrosoftGraphProvisionedPlan.capabilityStatus = reader.getString(); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedMicrosoftGraphProvisionedPlan.provisioningStatus = reader.getString(); + } else if ("service".equals(fieldName)) { + deserializedMicrosoftGraphProvisionedPlan.service = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphProvisionedPlan.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphProvisionedPlan; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicClientApplication.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicClientApplication.java index 184178786fb1c..67dc4dca01070 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicClientApplication.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicClientApplication.java @@ -5,37 +5,42 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** publicClientApplication. */ +/** + * publicClientApplication. + */ @Fluent -public final class MicrosoftGraphPublicClientApplication { +public final class MicrosoftGraphPublicClientApplication + implements JsonSerializable { /* * Specifies the URLs where user tokens are sent for sign-in, or the redirect URIs where OAuth 2.0 authorization * codes and access tokens are sent. */ - @JsonProperty(value = "redirectUris") private List redirectUris; /* * publicClientApplication */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPublicClientApplication class. */ + /** + * Creates an instance of MicrosoftGraphPublicClientApplication class. + */ public MicrosoftGraphPublicClientApplication() { } /** * Get the redirectUris property: Specifies the URLs where user tokens are sent for sign-in, or the redirect URIs * where OAuth 2.0 authorization codes and access tokens are sent. - * + * * @return the redirectUris value. */ public List redirectUris() { @@ -45,7 +50,7 @@ public List redirectUris() { /** * Set the redirectUris property: Specifies the URLs where user tokens are sent for sign-in, or the redirect URIs * where OAuth 2.0 authorization codes and access tokens are sent. - * + * * @param redirectUris the redirectUris value to set. * @return the MicrosoftGraphPublicClientApplication object itself. */ @@ -56,17 +61,16 @@ public MicrosoftGraphPublicClientApplication withRedirectUris(List redir /** * Get the additionalProperties property: publicClientApplication. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: publicClientApplication. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPublicClientApplication object itself. */ @@ -75,19 +79,60 @@ public MicrosoftGraphPublicClientApplication withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("redirectUris", this.redirectUris, (writer, element) -> writer.writeString(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPublicClientApplication from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPublicClientApplication 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 MicrosoftGraphPublicClientApplication. + */ + public static MicrosoftGraphPublicClientApplication fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPublicClientApplication deserializedMicrosoftGraphPublicClientApplication + = new MicrosoftGraphPublicClientApplication(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("redirectUris".equals(fieldName)) { + List redirectUris = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphPublicClientApplication.redirectUris = redirectUris; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPublicClientApplication.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPublicClientApplication; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicError.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicError.java index cde5285386701..29bf4aa2b3846 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicError.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicError.java @@ -5,59 +5,59 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** publicError. */ +/** + * publicError. + */ @Fluent -public final class MicrosoftGraphPublicError { +public final class MicrosoftGraphPublicError implements JsonSerializable { /* * The code property. */ - @JsonProperty(value = "code") private String code; /* * The details property. */ - @JsonProperty(value = "details") private List details; /* * publicInnerError */ - @JsonProperty(value = "innerError") private MicrosoftGraphPublicInnerError innerError; /* * The message property. */ - @JsonProperty(value = "message") private String message; /* * The target property. */ - @JsonProperty(value = "target") private String target; /* * publicError */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPublicError class. */ + /** + * Creates an instance of MicrosoftGraphPublicError class. + */ public MicrosoftGraphPublicError() { } /** * Get the code property: The code property. - * + * * @return the code value. */ public String code() { @@ -66,7 +66,7 @@ public String code() { /** * Set the code property: The code property. - * + * * @param code the code value to set. * @return the MicrosoftGraphPublicError object itself. */ @@ -77,7 +77,7 @@ public MicrosoftGraphPublicError withCode(String code) { /** * Get the details property: The details property. - * + * * @return the details value. */ public List details() { @@ -86,7 +86,7 @@ public List details() { /** * Set the details property: The details property. - * + * * @param details the details value to set. * @return the MicrosoftGraphPublicError object itself. */ @@ -97,7 +97,7 @@ public MicrosoftGraphPublicError withDetails(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: publicError. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPublicError object itself. */ @@ -176,17 +175,9 @@ public MicrosoftGraphPublicError withAdditionalProperties(Map ad return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -197,4 +188,65 @@ public void validate() { innerError().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("innerError", this.innerError); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("target", this.target); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPublicError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPublicError 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 MicrosoftGraphPublicError. + */ + public static MicrosoftGraphPublicError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPublicError deserializedMicrosoftGraphPublicError = new MicrosoftGraphPublicError(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedMicrosoftGraphPublicError.code = reader.getString(); + } else if ("details".equals(fieldName)) { + List details + = reader.readArray(reader1 -> MicrosoftGraphPublicErrorDetail.fromJson(reader1)); + deserializedMicrosoftGraphPublicError.details = details; + } else if ("innerError".equals(fieldName)) { + deserializedMicrosoftGraphPublicError.innerError = MicrosoftGraphPublicInnerError.fromJson(reader); + } else if ("message".equals(fieldName)) { + deserializedMicrosoftGraphPublicError.message = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedMicrosoftGraphPublicError.target = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPublicError.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPublicError; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicErrorDetail.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicErrorDetail.java index 066086e690e68..eba091810a8f6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicErrorDetail.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicErrorDetail.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** publicErrorDetail. */ +/** + * publicErrorDetail. + */ @Fluent -public final class MicrosoftGraphPublicErrorDetail { +public final class MicrosoftGraphPublicErrorDetail implements JsonSerializable { /* * The code property. */ - @JsonProperty(value = "code") private String code; /* * The message property. */ - @JsonProperty(value = "message") private String message; /* * The target property. */ - @JsonProperty(value = "target") private String target; /* * publicErrorDetail */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPublicErrorDetail class. */ + /** + * Creates an instance of MicrosoftGraphPublicErrorDetail class. + */ public MicrosoftGraphPublicErrorDetail() { } /** * Get the code property: The code property. - * + * * @return the code value. */ public String code() { @@ -53,7 +55,7 @@ public String code() { /** * Set the code property: The code property. - * + * * @param code the code value to set. * @return the MicrosoftGraphPublicErrorDetail object itself. */ @@ -64,7 +66,7 @@ public MicrosoftGraphPublicErrorDetail withCode(String code) { /** * Get the message property: The message property. - * + * * @return the message value. */ public String message() { @@ -73,7 +75,7 @@ public String message() { /** * Set the message property: The message property. - * + * * @param message the message value to set. * @return the MicrosoftGraphPublicErrorDetail object itself. */ @@ -84,7 +86,7 @@ public MicrosoftGraphPublicErrorDetail withMessage(String message) { /** * Get the target property: The target property. - * + * * @return the target value. */ public String target() { @@ -93,7 +95,7 @@ public String target() { /** * Set the target property: The target property. - * + * * @param target the target value to set. * @return the MicrosoftGraphPublicErrorDetail object itself. */ @@ -104,17 +106,16 @@ public MicrosoftGraphPublicErrorDetail withTarget(String target) { /** * Get the additionalProperties property: publicErrorDetail. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: publicErrorDetail. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPublicErrorDetail object itself. */ @@ -123,19 +124,65 @@ public MicrosoftGraphPublicErrorDetail withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("target", this.target); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPublicErrorDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPublicErrorDetail 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 MicrosoftGraphPublicErrorDetail. + */ + public static MicrosoftGraphPublicErrorDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPublicErrorDetail deserializedMicrosoftGraphPublicErrorDetail + = new MicrosoftGraphPublicErrorDetail(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedMicrosoftGraphPublicErrorDetail.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedMicrosoftGraphPublicErrorDetail.message = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedMicrosoftGraphPublicErrorDetail.target = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPublicErrorDetail.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPublicErrorDetail; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicInnerError.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicInnerError.java index fb51f2ff553a7..61b25114c2e5d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicInnerError.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicInnerError.java @@ -5,53 +5,54 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** publicInnerError. */ +/** + * publicInnerError. + */ @Fluent -public final class MicrosoftGraphPublicInnerError { +public final class MicrosoftGraphPublicInnerError implements JsonSerializable { /* * The code property. */ - @JsonProperty(value = "code") private String code; /* * The details property. */ - @JsonProperty(value = "details") private List details; /* * The message property. */ - @JsonProperty(value = "message") private String message; /* * The target property. */ - @JsonProperty(value = "target") private String target; /* * publicInnerError */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPublicInnerError class. */ + /** + * Creates an instance of MicrosoftGraphPublicInnerError class. + */ public MicrosoftGraphPublicInnerError() { } /** * Get the code property: The code property. - * + * * @return the code value. */ public String code() { @@ -60,7 +61,7 @@ public String code() { /** * Set the code property: The code property. - * + * * @param code the code value to set. * @return the MicrosoftGraphPublicInnerError object itself. */ @@ -71,7 +72,7 @@ public MicrosoftGraphPublicInnerError withCode(String code) { /** * Get the details property: The details property. - * + * * @return the details value. */ public List details() { @@ -80,7 +81,7 @@ public List details() { /** * Set the details property: The details property. - * + * * @param details the details value to set. * @return the MicrosoftGraphPublicInnerError object itself. */ @@ -91,7 +92,7 @@ public MicrosoftGraphPublicInnerError withDetails(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: publicInnerError. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPublicInnerError object itself. */ @@ -150,17 +150,9 @@ public MicrosoftGraphPublicInnerError withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -168,4 +160,63 @@ public void validate() { details().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("target", this.target); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPublicInnerError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPublicInnerError 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 MicrosoftGraphPublicInnerError. + */ + public static MicrosoftGraphPublicInnerError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPublicInnerError deserializedMicrosoftGraphPublicInnerError + = new MicrosoftGraphPublicInnerError(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedMicrosoftGraphPublicInnerError.code = reader.getString(); + } else if ("details".equals(fieldName)) { + List details + = reader.readArray(reader1 -> MicrosoftGraphPublicErrorDetail.fromJson(reader1)); + deserializedMicrosoftGraphPublicInnerError.details = details; + } else if ("message".equals(fieldName)) { + deserializedMicrosoftGraphPublicInnerError.message = reader.getString(); + } else if ("target".equals(fieldName)) { + deserializedMicrosoftGraphPublicInnerError.target = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPublicInnerError.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPublicInnerError; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicationFacet.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicationFacet.java index a4b4f917b79e9..07bd2c5045d6f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicationFacet.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphPublicationFacet.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** publicationFacet. */ +/** + * publicationFacet. + */ @Fluent -public final class MicrosoftGraphPublicationFacet { +public final class MicrosoftGraphPublicationFacet implements JsonSerializable { /* * The state of publication for this document. Either published or checkout. Read-only. */ - @JsonProperty(value = "level") private String level; /* * The unique identifier for the version that is visible to the current caller. Read-only. */ - @JsonProperty(value = "versionId") private String versionId; /* * publicationFacet */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphPublicationFacet class. */ + /** + * Creates an instance of MicrosoftGraphPublicationFacet class. + */ public MicrosoftGraphPublicationFacet() { } /** * Get the level property: The state of publication for this document. Either published or checkout. Read-only. - * + * * @return the level value. */ public String level() { @@ -47,7 +50,7 @@ public String level() { /** * Set the level property: The state of publication for this document. Either published or checkout. Read-only. - * + * * @param level the level value to set. * @return the MicrosoftGraphPublicationFacet object itself. */ @@ -59,7 +62,7 @@ public MicrosoftGraphPublicationFacet withLevel(String level) { /** * Get the versionId property: The unique identifier for the version that is visible to the current caller. * Read-only. - * + * * @return the versionId value. */ public String versionId() { @@ -69,7 +72,7 @@ public String versionId() { /** * Set the versionId property: The unique identifier for the version that is visible to the current caller. * Read-only. - * + * * @param versionId the versionId value to set. * @return the MicrosoftGraphPublicationFacet object itself. */ @@ -80,17 +83,16 @@ public MicrosoftGraphPublicationFacet withVersionId(String versionId) { /** * Get the additionalProperties property: publicationFacet. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: publicationFacet. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphPublicationFacet object itself. */ @@ -99,19 +101,62 @@ public MicrosoftGraphPublicationFacet withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("level", this.level); + jsonWriter.writeStringField("versionId", this.versionId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphPublicationFacet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphPublicationFacet 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 MicrosoftGraphPublicationFacet. + */ + public static MicrosoftGraphPublicationFacet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphPublicationFacet deserializedMicrosoftGraphPublicationFacet + = new MicrosoftGraphPublicationFacet(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("level".equals(fieldName)) { + deserializedMicrosoftGraphPublicationFacet.level = reader.getString(); + } else if ("versionId".equals(fieldName)) { + deserializedMicrosoftGraphPublicationFacet.versionId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphPublicationFacet.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphPublicationFacet; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphQuota.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphQuota.java index 2dd5fc11de6f7..a8e50a2c317ba 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphQuota.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphQuota.java @@ -5,64 +5,63 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** quota. */ +/** + * quota. + */ @Fluent -public final class MicrosoftGraphQuota { +public final class MicrosoftGraphQuota implements JsonSerializable { /* * Total space consumed by files in the recycle bin, in bytes. Read-only. */ - @JsonProperty(value = "deleted") private Long deleted; /* * Total space remaining before reaching the quota limit, in bytes. Read-only. */ - @JsonProperty(value = "remaining") private Long remaining; /* * Enumeration value that indicates the state of the storage space. Read-only. */ - @JsonProperty(value = "state") private String state; /* * storagePlanInformation */ - @JsonProperty(value = "storagePlanInformation") private MicrosoftGraphStoragePlanInformation storagePlanInformation; /* * Total allowed storage space, in bytes. Read-only. */ - @JsonProperty(value = "total") private Long total; /* * Total space used, in bytes. Read-only. */ - @JsonProperty(value = "used") private Long used; /* * quota */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphQuota class. */ + /** + * Creates an instance of MicrosoftGraphQuota class. + */ public MicrosoftGraphQuota() { } /** * Get the deleted property: Total space consumed by files in the recycle bin, in bytes. Read-only. - * + * * @return the deleted value. */ public Long deleted() { @@ -71,7 +70,7 @@ public Long deleted() { /** * Set the deleted property: Total space consumed by files in the recycle bin, in bytes. Read-only. - * + * * @param deleted the deleted value to set. * @return the MicrosoftGraphQuota object itself. */ @@ -82,7 +81,7 @@ public MicrosoftGraphQuota withDeleted(Long deleted) { /** * Get the remaining property: Total space remaining before reaching the quota limit, in bytes. Read-only. - * + * * @return the remaining value. */ public Long remaining() { @@ -91,7 +90,7 @@ public Long remaining() { /** * Set the remaining property: Total space remaining before reaching the quota limit, in bytes. Read-only. - * + * * @param remaining the remaining value to set. * @return the MicrosoftGraphQuota object itself. */ @@ -102,7 +101,7 @@ public MicrosoftGraphQuota withRemaining(Long remaining) { /** * Get the state property: Enumeration value that indicates the state of the storage space. Read-only. - * + * * @return the state value. */ public String state() { @@ -111,7 +110,7 @@ public String state() { /** * Set the state property: Enumeration value that indicates the state of the storage space. Read-only. - * + * * @param state the state value to set. * @return the MicrosoftGraphQuota object itself. */ @@ -122,7 +121,7 @@ public MicrosoftGraphQuota withState(String state) { /** * Get the storagePlanInformation property: storagePlanInformation. - * + * * @return the storagePlanInformation value. */ public MicrosoftGraphStoragePlanInformation storagePlanInformation() { @@ -131,7 +130,7 @@ public MicrosoftGraphStoragePlanInformation storagePlanInformation() { /** * Set the storagePlanInformation property: storagePlanInformation. - * + * * @param storagePlanInformation the storagePlanInformation value to set. * @return the MicrosoftGraphQuota object itself. */ @@ -142,7 +141,7 @@ public MicrosoftGraphQuota withStoragePlanInformation(MicrosoftGraphStoragePlanI /** * Get the total property: Total allowed storage space, in bytes. Read-only. - * + * * @return the total value. */ public Long total() { @@ -151,7 +150,7 @@ public Long total() { /** * Set the total property: Total allowed storage space, in bytes. Read-only. - * + * * @param total the total value to set. * @return the MicrosoftGraphQuota object itself. */ @@ -162,7 +161,7 @@ public MicrosoftGraphQuota withTotal(Long total) { /** * Get the used property: Total space used, in bytes. Read-only. - * + * * @return the used value. */ public Long used() { @@ -171,7 +170,7 @@ public Long used() { /** * Set the used property: Total space used, in bytes. Read-only. - * + * * @param used the used value to set. * @return the MicrosoftGraphQuota object itself. */ @@ -182,17 +181,16 @@ public MicrosoftGraphQuota withUsed(Long used) { /** * Get the additionalProperties property: quota. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: quota. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphQuota object itself. */ @@ -201,17 +199,9 @@ public MicrosoftGraphQuota withAdditionalProperties(Map addition return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -219,4 +209,67 @@ public void validate() { storagePlanInformation().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("deleted", this.deleted); + jsonWriter.writeNumberField("remaining", this.remaining); + jsonWriter.writeStringField("state", this.state); + jsonWriter.writeJsonField("storagePlanInformation", this.storagePlanInformation); + jsonWriter.writeNumberField("total", this.total); + jsonWriter.writeNumberField("used", this.used); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphQuota from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphQuota 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 MicrosoftGraphQuota. + */ + public static MicrosoftGraphQuota fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphQuota deserializedMicrosoftGraphQuota = new MicrosoftGraphQuota(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deleted".equals(fieldName)) { + deserializedMicrosoftGraphQuota.deleted = reader.getNullable(JsonReader::getLong); + } else if ("remaining".equals(fieldName)) { + deserializedMicrosoftGraphQuota.remaining = reader.getNullable(JsonReader::getLong); + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphQuota.state = reader.getString(); + } else if ("storagePlanInformation".equals(fieldName)) { + deserializedMicrosoftGraphQuota.storagePlanInformation + = MicrosoftGraphStoragePlanInformation.fromJson(reader); + } else if ("total".equals(fieldName)) { + deserializedMicrosoftGraphQuota.total = reader.getNullable(JsonReader::getLong); + } else if ("used".equals(fieldName)) { + deserializedMicrosoftGraphQuota.used = reader.getNullable(JsonReader::getLong); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphQuota.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphQuota; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecentNotebook.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecentNotebook.java index 3bb09b9b2c0cc..6192189d27293 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecentNotebook.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecentNotebook.java @@ -5,21 +5,25 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** recentNotebook. */ +/** + * recentNotebook. + */ @Fluent -public final class MicrosoftGraphRecentNotebook { +public final class MicrosoftGraphRecentNotebook implements JsonSerializable { /* * The name of the notebook. */ - @JsonProperty(value = "displayName") private String displayName; /* @@ -27,33 +31,32 @@ public final class MicrosoftGraphRecentNotebook { * ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * '2014-01-01T00:00:00Z'. Read-only. */ - @JsonProperty(value = "lastAccessedTime") private OffsetDateTime lastAccessedTime; /* * recentNotebookLinks */ - @JsonProperty(value = "links") private MicrosoftGraphRecentNotebookLinks links; /* * onenoteSourceService */ - @JsonProperty(value = "sourceService") private MicrosoftGraphOnenoteSourceService sourceService; /* * recentNotebook */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphRecentNotebook class. */ + /** + * Creates an instance of MicrosoftGraphRecentNotebook class. + */ public MicrosoftGraphRecentNotebook() { } /** * Get the displayName property: The name of the notebook. - * + * * @return the displayName value. */ public String displayName() { @@ -62,7 +65,7 @@ public String displayName() { /** * Set the displayName property: The name of the notebook. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphRecentNotebook object itself. */ @@ -75,7 +78,7 @@ public MicrosoftGraphRecentNotebook withDisplayName(String displayName) { * Get the lastAccessedTime property: The date and time when the notebook was last modified. The timestamp * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @return the lastAccessedTime value. */ public OffsetDateTime lastAccessedTime() { @@ -86,7 +89,7 @@ public OffsetDateTime lastAccessedTime() { * Set the lastAccessedTime property: The date and time when the notebook was last modified. The timestamp * represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC * on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Read-only. - * + * * @param lastAccessedTime the lastAccessedTime value to set. * @return the MicrosoftGraphRecentNotebook object itself. */ @@ -97,7 +100,7 @@ public MicrosoftGraphRecentNotebook withLastAccessedTime(OffsetDateTime lastAcce /** * Get the links property: recentNotebookLinks. - * + * * @return the links value. */ public MicrosoftGraphRecentNotebookLinks links() { @@ -106,7 +109,7 @@ public MicrosoftGraphRecentNotebookLinks links() { /** * Set the links property: recentNotebookLinks. - * + * * @param links the links value to set. * @return the MicrosoftGraphRecentNotebook object itself. */ @@ -117,7 +120,7 @@ public MicrosoftGraphRecentNotebook withLinks(MicrosoftGraphRecentNotebookLinks /** * Get the sourceService property: onenoteSourceService. - * + * * @return the sourceService value. */ public MicrosoftGraphOnenoteSourceService sourceService() { @@ -126,7 +129,7 @@ public MicrosoftGraphOnenoteSourceService sourceService() { /** * Set the sourceService property: onenoteSourceService. - * + * * @param sourceService the sourceService value to set. * @return the MicrosoftGraphRecentNotebook object itself. */ @@ -137,17 +140,16 @@ public MicrosoftGraphRecentNotebook withSourceService(MicrosoftGraphOnenoteSourc /** * Get the additionalProperties property: recentNotebook. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: recentNotebook. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphRecentNotebook object itself. */ @@ -156,17 +158,9 @@ public MicrosoftGraphRecentNotebook withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -174,4 +168,65 @@ public void validate() { links().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("lastAccessedTime", + this.lastAccessedTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastAccessedTime)); + jsonWriter.writeJsonField("links", this.links); + jsonWriter.writeStringField("sourceService", this.sourceService == null ? null : this.sourceService.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphRecentNotebook from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphRecentNotebook 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 MicrosoftGraphRecentNotebook. + */ + public static MicrosoftGraphRecentNotebook fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphRecentNotebook deserializedMicrosoftGraphRecentNotebook = new MicrosoftGraphRecentNotebook(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphRecentNotebook.displayName = reader.getString(); + } else if ("lastAccessedTime".equals(fieldName)) { + deserializedMicrosoftGraphRecentNotebook.lastAccessedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("links".equals(fieldName)) { + deserializedMicrosoftGraphRecentNotebook.links = MicrosoftGraphRecentNotebookLinks.fromJson(reader); + } else if ("sourceService".equals(fieldName)) { + deserializedMicrosoftGraphRecentNotebook.sourceService + = MicrosoftGraphOnenoteSourceService.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphRecentNotebook.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphRecentNotebook; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecentNotebookLinks.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecentNotebookLinks.java index f4db5bd47eecb..6516baa6796c1 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecentNotebookLinks.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecentNotebookLinks.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** recentNotebookLinks. */ +/** + * recentNotebookLinks. + */ @Fluent -public final class MicrosoftGraphRecentNotebookLinks { +public final class MicrosoftGraphRecentNotebookLinks implements JsonSerializable { /* * externalLink */ - @JsonProperty(value = "oneNoteClientUrl") private MicrosoftGraphExternalLink oneNoteClientUrl; /* * externalLink */ - @JsonProperty(value = "oneNoteWebUrl") private MicrosoftGraphExternalLink oneNoteWebUrl; /* * recentNotebookLinks */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphRecentNotebookLinks class. */ + /** + * Creates an instance of MicrosoftGraphRecentNotebookLinks class. + */ public MicrosoftGraphRecentNotebookLinks() { } /** * Get the oneNoteClientUrl property: externalLink. - * + * * @return the oneNoteClientUrl value. */ public MicrosoftGraphExternalLink oneNoteClientUrl() { @@ -47,7 +50,7 @@ public MicrosoftGraphExternalLink oneNoteClientUrl() { /** * Set the oneNoteClientUrl property: externalLink. - * + * * @param oneNoteClientUrl the oneNoteClientUrl value to set. * @return the MicrosoftGraphRecentNotebookLinks object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphRecentNotebookLinks withOneNoteClientUrl(MicrosoftGraphExte /** * Get the oneNoteWebUrl property: externalLink. - * + * * @return the oneNoteWebUrl value. */ public MicrosoftGraphExternalLink oneNoteWebUrl() { @@ -67,7 +70,7 @@ public MicrosoftGraphExternalLink oneNoteWebUrl() { /** * Set the oneNoteWebUrl property: externalLink. - * + * * @param oneNoteWebUrl the oneNoteWebUrl value to set. * @return the MicrosoftGraphRecentNotebookLinks object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphRecentNotebookLinks withOneNoteWebUrl(MicrosoftGraphExterna /** * Get the additionalProperties property: recentNotebookLinks. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: recentNotebookLinks. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphRecentNotebookLinks object itself. */ @@ -97,17 +99,9 @@ public MicrosoftGraphRecentNotebookLinks withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -118,4 +112,57 @@ public void validate() { oneNoteWebUrl().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("oneNoteClientUrl", this.oneNoteClientUrl); + jsonWriter.writeJsonField("oneNoteWebUrl", this.oneNoteWebUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphRecentNotebookLinks from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphRecentNotebookLinks 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 MicrosoftGraphRecentNotebookLinks. + */ + public static MicrosoftGraphRecentNotebookLinks fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphRecentNotebookLinks deserializedMicrosoftGraphRecentNotebookLinks + = new MicrosoftGraphRecentNotebookLinks(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("oneNoteClientUrl".equals(fieldName)) { + deserializedMicrosoftGraphRecentNotebookLinks.oneNoteClientUrl + = MicrosoftGraphExternalLink.fromJson(reader); + } else if ("oneNoteWebUrl".equals(fieldName)) { + deserializedMicrosoftGraphRecentNotebookLinks.oneNoteWebUrl + = MicrosoftGraphExternalLink.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphRecentNotebookLinks.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphRecentNotebookLinks; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecipient.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecipient.java index 6514c58925689..6cccbea6095ad 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecipient.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecipient.java @@ -5,34 +5,38 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** recipient. */ +/** + * recipient. + */ @Fluent -public class MicrosoftGraphRecipient { +public class MicrosoftGraphRecipient implements JsonSerializable { /* * emailAddress */ - @JsonProperty(value = "emailAddress") private MicrosoftGraphEmailAddress emailAddress; /* * recipient */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphRecipient class. */ + /** + * Creates an instance of MicrosoftGraphRecipient class. + */ public MicrosoftGraphRecipient() { } /** * Get the emailAddress property: emailAddress. - * + * * @return the emailAddress value. */ public MicrosoftGraphEmailAddress emailAddress() { @@ -41,7 +45,7 @@ public MicrosoftGraphEmailAddress emailAddress() { /** * Set the emailAddress property: emailAddress. - * + * * @param emailAddress the emailAddress value to set. * @return the MicrosoftGraphRecipient object itself. */ @@ -52,17 +56,16 @@ public MicrosoftGraphRecipient withEmailAddress(MicrosoftGraphEmailAddress email /** * Get the additionalProperties property: recipient. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: recipient. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphRecipient object itself. */ @@ -71,17 +74,9 @@ public MicrosoftGraphRecipient withAdditionalProperties(Map addi return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -89,4 +84,51 @@ public void validate() { emailAddress().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("emailAddress", this.emailAddress); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphRecipient from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphRecipient 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 MicrosoftGraphRecipient. + */ + public static MicrosoftGraphRecipient fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphRecipient deserializedMicrosoftGraphRecipient = new MicrosoftGraphRecipient(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("emailAddress".equals(fieldName)) { + deserializedMicrosoftGraphRecipient.emailAddress = MicrosoftGraphEmailAddress.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphRecipient.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphRecipient; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrencePattern.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrencePattern.java index 69a83dd70ab57..9104e12915874 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrencePattern.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrencePattern.java @@ -5,76 +5,74 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** recurrencePattern. */ +/** + * recurrencePattern. + */ @Fluent -public final class MicrosoftGraphRecurrencePattern { +public final class MicrosoftGraphRecurrencePattern implements JsonSerializable { /* * The day of the month on which the event occurs. Required if type is absoluteMonthly or absoluteYearly. */ - @JsonProperty(value = "dayOfMonth") private Integer dayOfMonth; /* - * A collection of the days of the week on which the event occurs. The possible values are: sunday, monday, - * tuesday, wednesday, thursday, friday, saturday. If type is relativeMonthly or relativeYearly, and daysOfWeek - * specifies more than one day, the event falls on the first day that satisfies the pattern. Required if type is - * weekly, relativeMonthly, or relativeYearly. + * A collection of the days of the week on which the event occurs. The possible values are: sunday, monday, tuesday, + * wednesday, thursday, friday, saturday. If type is relativeMonthly or relativeYearly, and daysOfWeek specifies + * more than one day, the event falls on the first day that satisfies the pattern. Required if type is weekly, + * relativeMonthly, or relativeYearly. */ - @JsonProperty(value = "daysOfWeek") private List daysOfWeek; /* * dayOfWeek */ - @JsonProperty(value = "firstDayOfWeek") private MicrosoftGraphDayOfWeek firstDayOfWeek; /* * weekIndex */ - @JsonProperty(value = "index") private MicrosoftGraphWeekIndex index; /* * The number of units between occurrences, where units can be in days, weeks, months, or years, depending on the * type. Required. */ - @JsonProperty(value = "interval") private Integer interval; /* - * The month in which the event occurs. This is a number from 1 to 12. + * The month in which the event occurs. This is a number from 1 to 12. */ - @JsonProperty(value = "month") private Integer month; /* * recurrencePatternType */ - @JsonProperty(value = "type") private MicrosoftGraphRecurrencePatternType type; /* * recurrencePattern */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphRecurrencePattern class. */ + /** + * Creates an instance of MicrosoftGraphRecurrencePattern class. + */ public MicrosoftGraphRecurrencePattern() { } /** * Get the dayOfMonth property: The day of the month on which the event occurs. Required if type is absoluteMonthly * or absoluteYearly. - * + * * @return the dayOfMonth value. */ public Integer dayOfMonth() { @@ -84,7 +82,7 @@ public Integer dayOfMonth() { /** * Set the dayOfMonth property: The day of the month on which the event occurs. Required if type is absoluteMonthly * or absoluteYearly. - * + * * @param dayOfMonth the dayOfMonth value to set. * @return the MicrosoftGraphRecurrencePattern object itself. */ @@ -98,7 +96,7 @@ public MicrosoftGraphRecurrencePattern withDayOfMonth(Integer dayOfMonth) { * are: sunday, monday, tuesday, wednesday, thursday, friday, saturday. If type is relativeMonthly or * relativeYearly, and daysOfWeek specifies more than one day, the event falls on the first day that satisfies the * pattern. Required if type is weekly, relativeMonthly, or relativeYearly. - * + * * @return the daysOfWeek value. */ public List daysOfWeek() { @@ -110,7 +108,7 @@ public List daysOfWeek() { * are: sunday, monday, tuesday, wednesday, thursday, friday, saturday. If type is relativeMonthly or * relativeYearly, and daysOfWeek specifies more than one day, the event falls on the first day that satisfies the * pattern. Required if type is weekly, relativeMonthly, or relativeYearly. - * + * * @param daysOfWeek the daysOfWeek value to set. * @return the MicrosoftGraphRecurrencePattern object itself. */ @@ -121,7 +119,7 @@ public MicrosoftGraphRecurrencePattern withDaysOfWeek(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: recurrencePattern. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphRecurrencePattern object itself. */ @@ -242,19 +239,84 @@ public MicrosoftGraphRecurrencePattern withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("dayOfMonth", this.dayOfMonth); + jsonWriter.writeArrayField("daysOfWeek", this.daysOfWeek, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("firstDayOfWeek", + this.firstDayOfWeek == null ? null : this.firstDayOfWeek.toString()); + jsonWriter.writeStringField("index", this.index == null ? null : this.index.toString()); + jsonWriter.writeNumberField("interval", this.interval); + jsonWriter.writeNumberField("month", this.month); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphRecurrencePattern from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphRecurrencePattern 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 MicrosoftGraphRecurrencePattern. + */ + public static MicrosoftGraphRecurrencePattern fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphRecurrencePattern deserializedMicrosoftGraphRecurrencePattern + = new MicrosoftGraphRecurrencePattern(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dayOfMonth".equals(fieldName)) { + deserializedMicrosoftGraphRecurrencePattern.dayOfMonth = reader.getNullable(JsonReader::getInt); + } else if ("daysOfWeek".equals(fieldName)) { + List daysOfWeek + = reader.readArray(reader1 -> MicrosoftGraphDayOfWeek.fromString(reader1.getString())); + deserializedMicrosoftGraphRecurrencePattern.daysOfWeek = daysOfWeek; + } else if ("firstDayOfWeek".equals(fieldName)) { + deserializedMicrosoftGraphRecurrencePattern.firstDayOfWeek + = MicrosoftGraphDayOfWeek.fromString(reader.getString()); + } else if ("index".equals(fieldName)) { + deserializedMicrosoftGraphRecurrencePattern.index + = MicrosoftGraphWeekIndex.fromString(reader.getString()); + } else if ("interval".equals(fieldName)) { + deserializedMicrosoftGraphRecurrencePattern.interval = reader.getNullable(JsonReader::getInt); + } else if ("month".equals(fieldName)) { + deserializedMicrosoftGraphRecurrencePattern.month = reader.getNullable(JsonReader::getInt); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphRecurrencePattern.type + = MicrosoftGraphRecurrencePatternType.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphRecurrencePattern.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphRecurrencePattern; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrencePatternType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrencePatternType.java index 5c64b0e8ccf08..4ef1cb2f85982 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrencePatternType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrencePatternType.java @@ -5,33 +5,46 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** recurrencePatternType. */ +/** + * recurrencePatternType. + */ public final class MicrosoftGraphRecurrencePatternType extends ExpandableStringEnum { - /** Static value daily for MicrosoftGraphRecurrencePatternType. */ + /** + * Static value daily for MicrosoftGraphRecurrencePatternType. + */ public static final MicrosoftGraphRecurrencePatternType DAILY = fromString("daily"); - /** Static value weekly for MicrosoftGraphRecurrencePatternType. */ + /** + * Static value weekly for MicrosoftGraphRecurrencePatternType. + */ public static final MicrosoftGraphRecurrencePatternType WEEKLY = fromString("weekly"); - /** Static value absoluteMonthly for MicrosoftGraphRecurrencePatternType. */ + /** + * Static value absoluteMonthly for MicrosoftGraphRecurrencePatternType. + */ public static final MicrosoftGraphRecurrencePatternType ABSOLUTE_MONTHLY = fromString("absoluteMonthly"); - /** Static value relativeMonthly for MicrosoftGraphRecurrencePatternType. */ + /** + * Static value relativeMonthly for MicrosoftGraphRecurrencePatternType. + */ public static final MicrosoftGraphRecurrencePatternType RELATIVE_MONTHLY = fromString("relativeMonthly"); - /** Static value absoluteYearly for MicrosoftGraphRecurrencePatternType. */ + /** + * Static value absoluteYearly for MicrosoftGraphRecurrencePatternType. + */ public static final MicrosoftGraphRecurrencePatternType ABSOLUTE_YEARLY = fromString("absoluteYearly"); - /** Static value relativeYearly for MicrosoftGraphRecurrencePatternType. */ + /** + * Static value relativeYearly for MicrosoftGraphRecurrencePatternType. + */ public static final MicrosoftGraphRecurrencePatternType RELATIVE_YEARLY = fromString("relativeYearly"); /** * Creates a new instance of MicrosoftGraphRecurrencePatternType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -40,18 +53,17 @@ public MicrosoftGraphRecurrencePatternType() { /** * Creates or finds a MicrosoftGraphRecurrencePatternType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphRecurrencePatternType. */ - @JsonCreator public static MicrosoftGraphRecurrencePatternType fromString(String name) { return fromString(name, MicrosoftGraphRecurrencePatternType.class); } /** * Gets known MicrosoftGraphRecurrencePatternType values. - * + * * @return known MicrosoftGraphRecurrencePatternType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrenceRange.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrenceRange.java index b8526059a77e3..41c1e6d86ebb5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrenceRange.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrenceRange.java @@ -5,64 +5,65 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.LocalDate; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; -/** recurrenceRange. */ +/** + * recurrenceRange. + */ @Fluent -public final class MicrosoftGraphRecurrenceRange { +public final class MicrosoftGraphRecurrenceRange implements JsonSerializable { /* * The date to stop applying the recurrence pattern. Depending on the recurrence pattern of the event, the last * occurrence of the meeting may not be this date. Required if type is endDate. */ - @JsonProperty(value = "endDate") private LocalDate endDate; /* * The number of times to repeat the event. Required and must be positive if type is numbered. */ - @JsonProperty(value = "numberOfOccurrences") private Integer numberOfOccurrences; /* * Time zone for the startDate and endDate properties. Optional. If not specified, the time zone of the event is * used. */ - @JsonProperty(value = "recurrenceTimeZone") private String recurrenceTimeZone; /* - * The date to start applying the recurrence pattern. The first occurrence of the meeting may be this date or - * later, depending on the recurrence pattern of the event. Must be the same value as the start property of the - * recurring event. Required. + * The date to start applying the recurrence pattern. The first occurrence of the meeting may be this date or later, + * depending on the recurrence pattern of the event. Must be the same value as the start property of the recurring + * event. Required. */ - @JsonProperty(value = "startDate") private LocalDate startDate; /* * recurrenceRangeType */ - @JsonProperty(value = "type") private MicrosoftGraphRecurrenceRangeType type; /* * recurrenceRange */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphRecurrenceRange class. */ + /** + * Creates an instance of MicrosoftGraphRecurrenceRange class. + */ public MicrosoftGraphRecurrenceRange() { } /** * Get the endDate property: The date to stop applying the recurrence pattern. Depending on the recurrence pattern * of the event, the last occurrence of the meeting may not be this date. Required if type is endDate. - * + * * @return the endDate value. */ public LocalDate endDate() { @@ -72,7 +73,7 @@ public LocalDate endDate() { /** * Set the endDate property: The date to stop applying the recurrence pattern. Depending on the recurrence pattern * of the event, the last occurrence of the meeting may not be this date. Required if type is endDate. - * + * * @param endDate the endDate value to set. * @return the MicrosoftGraphRecurrenceRange object itself. */ @@ -84,7 +85,7 @@ public MicrosoftGraphRecurrenceRange withEndDate(LocalDate endDate) { /** * Get the numberOfOccurrences property: The number of times to repeat the event. Required and must be positive if * type is numbered. - * + * * @return the numberOfOccurrences value. */ public Integer numberOfOccurrences() { @@ -94,7 +95,7 @@ public Integer numberOfOccurrences() { /** * Set the numberOfOccurrences property: The number of times to repeat the event. Required and must be positive if * type is numbered. - * + * * @param numberOfOccurrences the numberOfOccurrences value to set. * @return the MicrosoftGraphRecurrenceRange object itself. */ @@ -106,7 +107,7 @@ public MicrosoftGraphRecurrenceRange withNumberOfOccurrences(Integer numberOfOcc /** * Get the recurrenceTimeZone property: Time zone for the startDate and endDate properties. Optional. If not * specified, the time zone of the event is used. - * + * * @return the recurrenceTimeZone value. */ public String recurrenceTimeZone() { @@ -116,7 +117,7 @@ public String recurrenceTimeZone() { /** * Set the recurrenceTimeZone property: Time zone for the startDate and endDate properties. Optional. If not * specified, the time zone of the event is used. - * + * * @param recurrenceTimeZone the recurrenceTimeZone value to set. * @return the MicrosoftGraphRecurrenceRange object itself. */ @@ -129,7 +130,7 @@ public MicrosoftGraphRecurrenceRange withRecurrenceTimeZone(String recurrenceTim * Get the startDate property: The date to start applying the recurrence pattern. The first occurrence of the * meeting may be this date or later, depending on the recurrence pattern of the event. Must be the same value as * the start property of the recurring event. Required. - * + * * @return the startDate value. */ public LocalDate startDate() { @@ -140,7 +141,7 @@ public LocalDate startDate() { * Set the startDate property: The date to start applying the recurrence pattern. The first occurrence of the * meeting may be this date or later, depending on the recurrence pattern of the event. Must be the same value as * the start property of the recurring event. Required. - * + * * @param startDate the startDate value to set. * @return the MicrosoftGraphRecurrenceRange object itself. */ @@ -151,7 +152,7 @@ public MicrosoftGraphRecurrenceRange withStartDate(LocalDate startDate) { /** * Get the type property: recurrenceRangeType. - * + * * @return the type value. */ public MicrosoftGraphRecurrenceRangeType type() { @@ -160,7 +161,7 @@ public MicrosoftGraphRecurrenceRangeType type() { /** * Set the type property: recurrenceRangeType. - * + * * @param type the type value to set. * @return the MicrosoftGraphRecurrenceRange object itself. */ @@ -171,17 +172,16 @@ public MicrosoftGraphRecurrenceRange withType(MicrosoftGraphRecurrenceRangeType /** * Get the additionalProperties property: recurrenceRange. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: recurrenceRange. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphRecurrenceRange object itself. */ @@ -190,19 +190,75 @@ public MicrosoftGraphRecurrenceRange withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endDate", Objects.toString(this.endDate, null)); + jsonWriter.writeNumberField("numberOfOccurrences", this.numberOfOccurrences); + jsonWriter.writeStringField("recurrenceTimeZone", this.recurrenceTimeZone); + jsonWriter.writeStringField("startDate", Objects.toString(this.startDate, null)); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphRecurrenceRange from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphRecurrenceRange 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 MicrosoftGraphRecurrenceRange. + */ + public static MicrosoftGraphRecurrenceRange fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphRecurrenceRange deserializedMicrosoftGraphRecurrenceRange + = new MicrosoftGraphRecurrenceRange(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endDate".equals(fieldName)) { + deserializedMicrosoftGraphRecurrenceRange.endDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("numberOfOccurrences".equals(fieldName)) { + deserializedMicrosoftGraphRecurrenceRange.numberOfOccurrences + = reader.getNullable(JsonReader::getInt); + } else if ("recurrenceTimeZone".equals(fieldName)) { + deserializedMicrosoftGraphRecurrenceRange.recurrenceTimeZone = reader.getString(); + } else if ("startDate".equals(fieldName)) { + deserializedMicrosoftGraphRecurrenceRange.startDate + = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphRecurrenceRange.type + = MicrosoftGraphRecurrenceRangeType.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphRecurrenceRange.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphRecurrenceRange; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrenceRangeType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrenceRangeType.java index 5e671ccd0fdf9..4f39789b400ee 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrenceRangeType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRecurrenceRangeType.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** recurrenceRangeType. */ +/** + * recurrenceRangeType. + */ public final class MicrosoftGraphRecurrenceRangeType extends ExpandableStringEnum { - /** Static value endDate for MicrosoftGraphRecurrenceRangeType. */ + /** + * Static value endDate for MicrosoftGraphRecurrenceRangeType. + */ public static final MicrosoftGraphRecurrenceRangeType END_DATE = fromString("endDate"); - /** Static value noEnd for MicrosoftGraphRecurrenceRangeType. */ + /** + * Static value noEnd for MicrosoftGraphRecurrenceRangeType. + */ public static final MicrosoftGraphRecurrenceRangeType NO_END = fromString("noEnd"); - /** Static value numbered for MicrosoftGraphRecurrenceRangeType. */ + /** + * Static value numbered for MicrosoftGraphRecurrenceRangeType. + */ public static final MicrosoftGraphRecurrenceRangeType NUMBERED = fromString("numbered"); /** * Creates a new instance of MicrosoftGraphRecurrenceRangeType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -30,18 +37,17 @@ public MicrosoftGraphRecurrenceRangeType() { /** * Creates or finds a MicrosoftGraphRecurrenceRangeType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphRecurrenceRangeType. */ - @JsonCreator public static MicrosoftGraphRecurrenceRangeType fromString(String name) { return fromString(name, MicrosoftGraphRecurrenceRangeType.class); } /** * Gets known MicrosoftGraphRecurrenceRangeType values. - * + * * @return known MicrosoftGraphRecurrenceRangeType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRemoteItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRemoteItem.java index 85239e7dc0288..3994be64ec952 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRemoteItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRemoteItem.java @@ -5,143 +5,131 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** remoteItem. */ +/** + * remoteItem. + */ @Fluent -public final class MicrosoftGraphRemoteItem { +public final class MicrosoftGraphRemoteItem implements JsonSerializable { /* * identitySet */ - @JsonProperty(value = "createdBy") private MicrosoftGraphIdentitySet createdBy; /* * Date and time of item creation. Read-only. */ - @JsonProperty(value = "createdDateTime") private OffsetDateTime createdDateTime; /* * file */ - @JsonProperty(value = "file") private MicrosoftGraphFile file; /* * fileSystemInfo */ - @JsonProperty(value = "fileSystemInfo") private MicrosoftGraphFileSystemInfo fileSystemInfo; /* * folder */ - @JsonProperty(value = "folder") private MicrosoftGraphFolder folder; /* * Unique identifier for the remote item in its drive. Read-only. */ - @JsonProperty(value = "id") private String id; /* * image */ - @JsonProperty(value = "image") private MicrosoftGraphImage image; /* * identitySet */ - @JsonProperty(value = "lastModifiedBy") private MicrosoftGraphIdentitySet lastModifiedBy; /* * Date and time the item was last modified. Read-only. */ - @JsonProperty(value = "lastModifiedDateTime") private OffsetDateTime lastModifiedDateTime; /* * Optional. Filename of the remote item. Read-only. */ - @JsonProperty(value = "name") private String name; /* * package */ - @JsonProperty(value = "package") private MicrosoftGraphPackage packageProperty; /* * itemReference */ - @JsonProperty(value = "parentReference") private MicrosoftGraphItemReference parentReference; /* * shared */ - @JsonProperty(value = "shared") private MicrosoftGraphShared shared; /* * sharepointIds */ - @JsonProperty(value = "sharepointIds") private MicrosoftGraphSharepointIds sharepointIds; /* * Size of the remote item. Read-only. */ - @JsonProperty(value = "size") private Long size; /* * specialFolder */ - @JsonProperty(value = "specialFolder") private MicrosoftGraphSpecialFolder specialFolder; /* * video */ - @JsonProperty(value = "video") private MicrosoftGraphVideo video; /* * DAV compatible URL for the item. */ - @JsonProperty(value = "webDavUrl") private String webDavUrl; /* * URL that displays the resource in the browser. Read-only. */ - @JsonProperty(value = "webUrl") private String webUrl; /* * remoteItem */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphRemoteItem class. */ + /** + * Creates an instance of MicrosoftGraphRemoteItem class. + */ public MicrosoftGraphRemoteItem() { } /** * Get the createdBy property: identitySet. - * + * * @return the createdBy value. */ public MicrosoftGraphIdentitySet createdBy() { @@ -150,7 +138,7 @@ public MicrosoftGraphIdentitySet createdBy() { /** * Set the createdBy property: identitySet. - * + * * @param createdBy the createdBy value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -161,7 +149,7 @@ public MicrosoftGraphRemoteItem withCreatedBy(MicrosoftGraphIdentitySet createdB /** * Get the createdDateTime property: Date and time of item creation. Read-only. - * + * * @return the createdDateTime value. */ public OffsetDateTime createdDateTime() { @@ -170,7 +158,7 @@ public OffsetDateTime createdDateTime() { /** * Set the createdDateTime property: Date and time of item creation. Read-only. - * + * * @param createdDateTime the createdDateTime value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -181,7 +169,7 @@ public MicrosoftGraphRemoteItem withCreatedDateTime(OffsetDateTime createdDateTi /** * Get the file property: file. - * + * * @return the file value. */ public MicrosoftGraphFile file() { @@ -190,7 +178,7 @@ public MicrosoftGraphFile file() { /** * Set the file property: file. - * + * * @param file the file value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -201,7 +189,7 @@ public MicrosoftGraphRemoteItem withFile(MicrosoftGraphFile file) { /** * Get the fileSystemInfo property: fileSystemInfo. - * + * * @return the fileSystemInfo value. */ public MicrosoftGraphFileSystemInfo fileSystemInfo() { @@ -210,7 +198,7 @@ public MicrosoftGraphFileSystemInfo fileSystemInfo() { /** * Set the fileSystemInfo property: fileSystemInfo. - * + * * @param fileSystemInfo the fileSystemInfo value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -221,7 +209,7 @@ public MicrosoftGraphRemoteItem withFileSystemInfo(MicrosoftGraphFileSystemInfo /** * Get the folder property: folder. - * + * * @return the folder value. */ public MicrosoftGraphFolder folder() { @@ -230,7 +218,7 @@ public MicrosoftGraphFolder folder() { /** * Set the folder property: folder. - * + * * @param folder the folder value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -241,7 +229,7 @@ public MicrosoftGraphRemoteItem withFolder(MicrosoftGraphFolder folder) { /** * Get the id property: Unique identifier for the remote item in its drive. Read-only. - * + * * @return the id value. */ public String id() { @@ -250,7 +238,7 @@ public String id() { /** * Set the id property: Unique identifier for the remote item in its drive. Read-only. - * + * * @param id the id value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -261,7 +249,7 @@ public MicrosoftGraphRemoteItem withId(String id) { /** * Get the image property: image. - * + * * @return the image value. */ public MicrosoftGraphImage image() { @@ -270,7 +258,7 @@ public MicrosoftGraphImage image() { /** * Set the image property: image. - * + * * @param image the image value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -281,7 +269,7 @@ public MicrosoftGraphRemoteItem withImage(MicrosoftGraphImage image) { /** * Get the lastModifiedBy property: identitySet. - * + * * @return the lastModifiedBy value. */ public MicrosoftGraphIdentitySet lastModifiedBy() { @@ -290,7 +278,7 @@ public MicrosoftGraphIdentitySet lastModifiedBy() { /** * Set the lastModifiedBy property: identitySet. - * + * * @param lastModifiedBy the lastModifiedBy value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -301,7 +289,7 @@ public MicrosoftGraphRemoteItem withLastModifiedBy(MicrosoftGraphIdentitySet las /** * Get the lastModifiedDateTime property: Date and time the item was last modified. Read-only. - * + * * @return the lastModifiedDateTime value. */ public OffsetDateTime lastModifiedDateTime() { @@ -310,7 +298,7 @@ public OffsetDateTime lastModifiedDateTime() { /** * Set the lastModifiedDateTime property: Date and time the item was last modified. Read-only. - * + * * @param lastModifiedDateTime the lastModifiedDateTime value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -321,7 +309,7 @@ public MicrosoftGraphRemoteItem withLastModifiedDateTime(OffsetDateTime lastModi /** * Get the name property: Optional. Filename of the remote item. Read-only. - * + * * @return the name value. */ public String name() { @@ -330,7 +318,7 @@ public String name() { /** * Set the name property: Optional. Filename of the remote item. Read-only. - * + * * @param name the name value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -341,7 +329,7 @@ public MicrosoftGraphRemoteItem withName(String name) { /** * Get the packageProperty property: package. - * + * * @return the packageProperty value. */ public MicrosoftGraphPackage packageProperty() { @@ -350,7 +338,7 @@ public MicrosoftGraphPackage packageProperty() { /** * Set the packageProperty property: package. - * + * * @param packageProperty the packageProperty value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -361,7 +349,7 @@ public MicrosoftGraphRemoteItem withPackageProperty(MicrosoftGraphPackage packag /** * Get the parentReference property: itemReference. - * + * * @return the parentReference value. */ public MicrosoftGraphItemReference parentReference() { @@ -370,7 +358,7 @@ public MicrosoftGraphItemReference parentReference() { /** * Set the parentReference property: itemReference. - * + * * @param parentReference the parentReference value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -381,7 +369,7 @@ public MicrosoftGraphRemoteItem withParentReference(MicrosoftGraphItemReference /** * Get the shared property: shared. - * + * * @return the shared value. */ public MicrosoftGraphShared shared() { @@ -390,7 +378,7 @@ public MicrosoftGraphShared shared() { /** * Set the shared property: shared. - * + * * @param shared the shared value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -401,7 +389,7 @@ public MicrosoftGraphRemoteItem withShared(MicrosoftGraphShared shared) { /** * Get the sharepointIds property: sharepointIds. - * + * * @return the sharepointIds value. */ public MicrosoftGraphSharepointIds sharepointIds() { @@ -410,7 +398,7 @@ public MicrosoftGraphSharepointIds sharepointIds() { /** * Set the sharepointIds property: sharepointIds. - * + * * @param sharepointIds the sharepointIds value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -421,7 +409,7 @@ public MicrosoftGraphRemoteItem withSharepointIds(MicrosoftGraphSharepointIds sh /** * Get the size property: Size of the remote item. Read-only. - * + * * @return the size value. */ public Long size() { @@ -430,7 +418,7 @@ public Long size() { /** * Set the size property: Size of the remote item. Read-only. - * + * * @param size the size value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -441,7 +429,7 @@ public MicrosoftGraphRemoteItem withSize(Long size) { /** * Get the specialFolder property: specialFolder. - * + * * @return the specialFolder value. */ public MicrosoftGraphSpecialFolder specialFolder() { @@ -450,7 +438,7 @@ public MicrosoftGraphSpecialFolder specialFolder() { /** * Set the specialFolder property: specialFolder. - * + * * @param specialFolder the specialFolder value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -461,7 +449,7 @@ public MicrosoftGraphRemoteItem withSpecialFolder(MicrosoftGraphSpecialFolder sp /** * Get the video property: video. - * + * * @return the video value. */ public MicrosoftGraphVideo video() { @@ -470,7 +458,7 @@ public MicrosoftGraphVideo video() { /** * Set the video property: video. - * + * * @param video the video value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -481,7 +469,7 @@ public MicrosoftGraphRemoteItem withVideo(MicrosoftGraphVideo video) { /** * Get the webDavUrl property: DAV compatible URL for the item. - * + * * @return the webDavUrl value. */ public String webDavUrl() { @@ -490,7 +478,7 @@ public String webDavUrl() { /** * Set the webDavUrl property: DAV compatible URL for the item. - * + * * @param webDavUrl the webDavUrl value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -501,7 +489,7 @@ public MicrosoftGraphRemoteItem withWebDavUrl(String webDavUrl) { /** * Get the webUrl property: URL that displays the resource in the browser. Read-only. - * + * * @return the webUrl value. */ public String webUrl() { @@ -510,7 +498,7 @@ public String webUrl() { /** * Set the webUrl property: URL that displays the resource in the browser. Read-only. - * + * * @param webUrl the webUrl value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -521,17 +509,16 @@ public MicrosoftGraphRemoteItem withWebUrl(String webUrl) { /** * Get the additionalProperties property: remoteItem. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: remoteItem. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphRemoteItem object itself. */ @@ -540,17 +527,9 @@ public MicrosoftGraphRemoteItem withAdditionalProperties(Map add return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -591,4 +570,111 @@ public void validate() { video().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("createdBy", this.createdBy); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeJsonField("file", this.file); + jsonWriter.writeJsonField("fileSystemInfo", this.fileSystemInfo); + jsonWriter.writeJsonField("folder", this.folder); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeJsonField("image", this.image); + jsonWriter.writeJsonField("lastModifiedBy", this.lastModifiedBy); + jsonWriter.writeStringField("lastModifiedDateTime", + this.lastModifiedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedDateTime)); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("package", this.packageProperty); + jsonWriter.writeJsonField("parentReference", this.parentReference); + jsonWriter.writeJsonField("shared", this.shared); + jsonWriter.writeJsonField("sharepointIds", this.sharepointIds); + jsonWriter.writeNumberField("size", this.size); + jsonWriter.writeJsonField("specialFolder", this.specialFolder); + jsonWriter.writeJsonField("video", this.video); + jsonWriter.writeStringField("webDavUrl", this.webDavUrl); + jsonWriter.writeStringField("webUrl", this.webUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphRemoteItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphRemoteItem 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 MicrosoftGraphRemoteItem. + */ + public static MicrosoftGraphRemoteItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphRemoteItem deserializedMicrosoftGraphRemoteItem = new MicrosoftGraphRemoteItem(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.createdBy = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("file".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.file = MicrosoftGraphFile.fromJson(reader); + } else if ("fileSystemInfo".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.fileSystemInfo = MicrosoftGraphFileSystemInfo.fromJson(reader); + } else if ("folder".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.folder = MicrosoftGraphFolder.fromJson(reader); + } else if ("id".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.id = reader.getString(); + } else if ("image".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.image = MicrosoftGraphImage.fromJson(reader); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.lastModifiedBy = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.lastModifiedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("name".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.name = reader.getString(); + } else if ("package".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.packageProperty = MicrosoftGraphPackage.fromJson(reader); + } else if ("parentReference".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.parentReference = MicrosoftGraphItemReference.fromJson(reader); + } else if ("shared".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.shared = MicrosoftGraphShared.fromJson(reader); + } else if ("sharepointIds".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.sharepointIds = MicrosoftGraphSharepointIds.fromJson(reader); + } else if ("size".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.size = reader.getNullable(JsonReader::getLong); + } else if ("specialFolder".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.specialFolder = MicrosoftGraphSpecialFolder.fromJson(reader); + } else if ("video".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.video = MicrosoftGraphVideo.fromJson(reader); + } else if ("webDavUrl".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.webDavUrl = reader.getString(); + } else if ("webUrl".equals(fieldName)) { + deserializedMicrosoftGraphRemoteItem.webUrl = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphRemoteItem.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphRemoteItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRequiredResourceAccess.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRequiredResourceAccess.java index 40b848b96ef80..b85c00c44e69b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRequiredResourceAccess.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphRequiredResourceAccess.java @@ -5,43 +5,47 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** requiredResourceAccess. */ +/** + * requiredResourceAccess. + */ @Fluent -public final class MicrosoftGraphRequiredResourceAccess { +public final class MicrosoftGraphRequiredResourceAccess + implements JsonSerializable { /* * The list of OAuth2.0 permission scopes and app roles that the application requires from the specified resource. */ - @JsonProperty(value = "resourceAccess") private List resourceAccess; /* - * The unique identifier for the resource that the application requires access to. This should be equal to the - * appId declared on the target resource application. + * The unique identifier for the resource that the application requires access to. This should be equal to the appId + * declared on the target resource application. */ - @JsonProperty(value = "resourceAppId") private String resourceAppId; /* * requiredResourceAccess */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphRequiredResourceAccess class. */ + /** + * Creates an instance of MicrosoftGraphRequiredResourceAccess class. + */ public MicrosoftGraphRequiredResourceAccess() { } /** * Get the resourceAccess property: The list of OAuth2.0 permission scopes and app roles that the application * requires from the specified resource. - * + * * @return the resourceAccess value. */ public List resourceAccess() { @@ -51,7 +55,7 @@ public List resourceAccess() { /** * Set the resourceAccess property: The list of OAuth2.0 permission scopes and app roles that the application * requires from the specified resource. - * + * * @param resourceAccess the resourceAccess value to set. * @return the MicrosoftGraphRequiredResourceAccess object itself. */ @@ -63,7 +67,7 @@ public MicrosoftGraphRequiredResourceAccess withResourceAccess(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: requiredResourceAccess. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphRequiredResourceAccess object itself. */ @@ -103,17 +106,9 @@ public MicrosoftGraphRequiredResourceAccess withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -121,4 +116,58 @@ public void validate() { resourceAccess().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourceAccess", this.resourceAccess, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("resourceAppId", this.resourceAppId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphRequiredResourceAccess from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphRequiredResourceAccess 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 MicrosoftGraphRequiredResourceAccess. + */ + public static MicrosoftGraphRequiredResourceAccess fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphRequiredResourceAccess deserializedMicrosoftGraphRequiredResourceAccess + = new MicrosoftGraphRequiredResourceAccess(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceAccess".equals(fieldName)) { + List resourceAccess + = reader.readArray(reader1 -> MicrosoftGraphResourceAccess.fromJson(reader1)); + deserializedMicrosoftGraphRequiredResourceAccess.resourceAccess = resourceAccess; + } else if ("resourceAppId".equals(fieldName)) { + deserializedMicrosoftGraphRequiredResourceAccess.resourceAppId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphRequiredResourceAccess.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphRequiredResourceAccess; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceAccess.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceAccess.java index a97da54a804fe..9f6bc244e7512 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceAccess.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceAccess.java @@ -5,44 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** resourceAccess. */ +/** + * resourceAccess. + */ @Fluent -public final class MicrosoftGraphResourceAccess { +public final class MicrosoftGraphResourceAccess implements JsonSerializable { /* * The unique identifier for one of the oauth2PermissionScopes or appRole instances that the resource application * exposes. */ - @JsonProperty(value = "id") private UUID id; /* * Specifies whether the id property references an oauth2PermissionScopes or an appRole. Possible values are Scope * or Role. */ - @JsonProperty(value = "type") private String type; /* * resourceAccess */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphResourceAccess class. */ + /** + * Creates an instance of MicrosoftGraphResourceAccess class. + */ public MicrosoftGraphResourceAccess() { } /** * Get the id property: The unique identifier for one of the oauth2PermissionScopes or appRole instances that the * resource application exposes. - * + * * @return the id value. */ public UUID id() { @@ -52,7 +56,7 @@ public UUID id() { /** * Set the id property: The unique identifier for one of the oauth2PermissionScopes or appRole instances that the * resource application exposes. - * + * * @param id the id value to set. * @return the MicrosoftGraphResourceAccess object itself. */ @@ -64,7 +68,7 @@ public MicrosoftGraphResourceAccess withId(UUID id) { /** * Get the type property: Specifies whether the id property references an oauth2PermissionScopes or an appRole. * Possible values are Scope or Role. - * + * * @return the type value. */ public String type() { @@ -74,7 +78,7 @@ public String type() { /** * Set the type property: Specifies whether the id property references an oauth2PermissionScopes or an appRole. * Possible values are Scope or Role. - * + * * @param type the type value to set. * @return the MicrosoftGraphResourceAccess object itself. */ @@ -85,17 +89,16 @@ public MicrosoftGraphResourceAccess withType(String type) { /** * Get the additionalProperties property: resourceAccess. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: resourceAccess. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphResourceAccess object itself. */ @@ -104,19 +107,62 @@ public MicrosoftGraphResourceAccess withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", Objects.toString(this.id, null)); + jsonWriter.writeStringField("type", this.type); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphResourceAccess from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphResourceAccess 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 MicrosoftGraphResourceAccess. + */ + public static MicrosoftGraphResourceAccess fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphResourceAccess deserializedMicrosoftGraphResourceAccess = new MicrosoftGraphResourceAccess(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphResourceAccess.id + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphResourceAccess.type = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphResourceAccess.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphResourceAccess; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceReference.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceReference.java index 75a0ec3e1c35f..6baecc443fac0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceReference.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceReference.java @@ -5,46 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** resourceReference. */ +/** + * resourceReference. + */ @Fluent -public final class MicrosoftGraphResourceReference { +public final class MicrosoftGraphResourceReference implements JsonSerializable { /* * The item's unique identifier. */ - @JsonProperty(value = "id") private String id; /* * A string value that can be used to classify the item, such as 'microsoft.graph.driveItem' */ - @JsonProperty(value = "type") private String type; /* * A URL leading to the referenced item. */ - @JsonProperty(value = "webUrl") private String webUrl; /* * resourceReference */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphResourceReference class. */ + /** + * Creates an instance of MicrosoftGraphResourceReference class. + */ public MicrosoftGraphResourceReference() { } /** * Get the id property: The item's unique identifier. - * + * * @return the id value. */ public String id() { @@ -53,7 +55,7 @@ public String id() { /** * Set the id property: The item's unique identifier. - * + * * @param id the id value to set. * @return the MicrosoftGraphResourceReference object itself. */ @@ -64,7 +66,7 @@ public MicrosoftGraphResourceReference withId(String id) { /** * Get the type property: A string value that can be used to classify the item, such as 'microsoft.graph.driveItem'. - * + * * @return the type value. */ public String type() { @@ -73,7 +75,7 @@ public String type() { /** * Set the type property: A string value that can be used to classify the item, such as 'microsoft.graph.driveItem'. - * + * * @param type the type value to set. * @return the MicrosoftGraphResourceReference object itself. */ @@ -84,7 +86,7 @@ public MicrosoftGraphResourceReference withType(String type) { /** * Get the webUrl property: A URL leading to the referenced item. - * + * * @return the webUrl value. */ public String webUrl() { @@ -93,7 +95,7 @@ public String webUrl() { /** * Set the webUrl property: A URL leading to the referenced item. - * + * * @param webUrl the webUrl value to set. * @return the MicrosoftGraphResourceReference object itself. */ @@ -104,17 +106,16 @@ public MicrosoftGraphResourceReference withWebUrl(String webUrl) { /** * Get the additionalProperties property: resourceReference. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: resourceReference. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphResourceReference object itself. */ @@ -123,19 +124,65 @@ public MicrosoftGraphResourceReference withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("webUrl", this.webUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphResourceReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphResourceReference 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 MicrosoftGraphResourceReference. + */ + public static MicrosoftGraphResourceReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphResourceReference deserializedMicrosoftGraphResourceReference + = new MicrosoftGraphResourceReference(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphResourceReference.id = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphResourceReference.type = reader.getString(); + } else if ("webUrl".equals(fieldName)) { + deserializedMicrosoftGraphResourceReference.webUrl = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphResourceReference.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphResourceReference; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceSpecificPermissionGrant.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceSpecificPermissionGrant.java index abe5d36ef9b05..d50b5f7825e49 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceSpecificPermissionGrant.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceSpecificPermissionGrant.java @@ -5,18 +5,20 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; /** * resourceSpecificPermissionGrant - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -24,46 +26,43 @@ public final class MicrosoftGraphResourceSpecificPermissionGrant extends Microso /* * The clientAppId property. */ - @JsonProperty(value = "clientAppId") private String clientAppId; /* * The clientId property. */ - @JsonProperty(value = "clientId") private String clientId; /* * The permission property. */ - @JsonProperty(value = "permission") private String permission; /* * The permissionType property. */ - @JsonProperty(value = "permissionType") private String permissionType; /* * The resourceAppId property. */ - @JsonProperty(value = "resourceAppId") private String resourceAppId; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphResourceSpecificPermissionGrant class. */ + /** + * Creates an instance of MicrosoftGraphResourceSpecificPermissionGrant class. + */ public MicrosoftGraphResourceSpecificPermissionGrant() { } /** * Get the clientAppId property: The clientAppId property. - * + * * @return the clientAppId value. */ public String clientAppId() { @@ -72,7 +71,7 @@ public String clientAppId() { /** * Set the clientAppId property: The clientAppId property. - * + * * @param clientAppId the clientAppId value to set. * @return the MicrosoftGraphResourceSpecificPermissionGrant object itself. */ @@ -83,7 +82,7 @@ public MicrosoftGraphResourceSpecificPermissionGrant withClientAppId(String clie /** * Get the clientId property: The clientId property. - * + * * @return the clientId value. */ public String clientId() { @@ -92,7 +91,7 @@ public String clientId() { /** * Set the clientId property: The clientId property. - * + * * @param clientId the clientId value to set. * @return the MicrosoftGraphResourceSpecificPermissionGrant object itself. */ @@ -103,7 +102,7 @@ public MicrosoftGraphResourceSpecificPermissionGrant withClientId(String clientI /** * Get the permission property: The permission property. - * + * * @return the permission value. */ public String permission() { @@ -112,7 +111,7 @@ public String permission() { /** * Set the permission property: The permission property. - * + * * @param permission the permission value to set. * @return the MicrosoftGraphResourceSpecificPermissionGrant object itself. */ @@ -123,7 +122,7 @@ public MicrosoftGraphResourceSpecificPermissionGrant withPermission(String permi /** * Get the permissionType property: The permissionType property. - * + * * @return the permissionType value. */ public String permissionType() { @@ -132,7 +131,7 @@ public String permissionType() { /** * Set the permissionType property: The permissionType property. - * + * * @param permissionType the permissionType value to set. * @return the MicrosoftGraphResourceSpecificPermissionGrant object itself. */ @@ -143,7 +142,7 @@ public MicrosoftGraphResourceSpecificPermissionGrant withPermissionType(String p /** * Get the resourceAppId property: The resourceAppId property. - * + * * @return the resourceAppId value. */ public String resourceAppId() { @@ -152,7 +151,7 @@ public String resourceAppId() { /** * Set the resourceAppId property: The resourceAppId property. - * + * * @param resourceAppId the resourceAppId value to set. * @return the MicrosoftGraphResourceSpecificPermissionGrant object itself. */ @@ -164,10 +163,9 @@ public MicrosoftGraphResourceSpecificPermissionGrant withResourceAppId(String re /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -175,32 +173,28 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphResourceSpecificPermissionGrant object itself. */ - public MicrosoftGraphResourceSpecificPermissionGrant withAdditionalProperties( - Map additionalProperties) { + public MicrosoftGraphResourceSpecificPermissionGrant + withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphResourceSpecificPermissionGrant withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphResourceSpecificPermissionGrant withId(String id) { super.withId(id); @@ -209,11 +203,79 @@ public MicrosoftGraphResourceSpecificPermissionGrant withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeStringField("clientAppId", this.clientAppId); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("permission", this.permission); + jsonWriter.writeStringField("permissionType", this.permissionType); + jsonWriter.writeStringField("resourceAppId", this.resourceAppId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphResourceSpecificPermissionGrant from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphResourceSpecificPermissionGrant 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 MicrosoftGraphResourceSpecificPermissionGrant. + */ + public static MicrosoftGraphResourceSpecificPermissionGrant fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphResourceSpecificPermissionGrant deserializedMicrosoftGraphResourceSpecificPermissionGrant + = new MicrosoftGraphResourceSpecificPermissionGrant(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphResourceSpecificPermissionGrant.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphResourceSpecificPermissionGrant.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("clientAppId".equals(fieldName)) { + deserializedMicrosoftGraphResourceSpecificPermissionGrant.clientAppId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedMicrosoftGraphResourceSpecificPermissionGrant.clientId = reader.getString(); + } else if ("permission".equals(fieldName)) { + deserializedMicrosoftGraphResourceSpecificPermissionGrant.permission = reader.getString(); + } else if ("permissionType".equals(fieldName)) { + deserializedMicrosoftGraphResourceSpecificPermissionGrant.permissionType = reader.getString(); + } else if ("resourceAppId".equals(fieldName)) { + deserializedMicrosoftGraphResourceSpecificPermissionGrant.resourceAppId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphResourceSpecificPermissionGrant.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphResourceSpecificPermissionGrant; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceVisualization.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceVisualization.java index 7acaff5f46845..be793b1db1650 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceVisualization.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResourceVisualization.java @@ -5,81 +5,78 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** resourceVisualization. */ +/** + * resourceVisualization. + */ @Fluent -public final class MicrosoftGraphResourceVisualization { +public final class MicrosoftGraphResourceVisualization + implements JsonSerializable { /* * A string describing where the item is stored. For example, the name of a SharePoint site or the user name * identifying the owner of the OneDrive storing the item. */ - @JsonProperty(value = "containerDisplayName") private String containerDisplayName; /* - * Can be used for filtering by the type of container in which the file is stored. Such as Site or - * OneDriveBusiness. + * Can be used for filtering by the type of container in which the file is stored. Such as Site or OneDriveBusiness. */ - @JsonProperty(value = "containerType") private String containerType; /* * A path leading to the folder in which the item is stored. */ - @JsonProperty(value = "containerWebUrl") private String containerWebUrl; /* * The item's media type. Can be used for filtering for a specific type of file based on supported IANA Media Mime * Types. Note that not all Media Mime Types are supported. */ - @JsonProperty(value = "mediaType") private String mediaType; /* * A URL leading to the preview image for the item. */ - @JsonProperty(value = "previewImageUrl") private String previewImageUrl; /* * A preview text for the item. */ - @JsonProperty(value = "previewText") private String previewText; /* * The item's title text. */ - @JsonProperty(value = "title") private String title; /* * The item's media type. Can be used for filtering for a specific file based on a specific type. See below for * supported types. */ - @JsonProperty(value = "type") private String type; /* * resourceVisualization */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphResourceVisualization class. */ + /** + * Creates an instance of MicrosoftGraphResourceVisualization class. + */ public MicrosoftGraphResourceVisualization() { } /** * Get the containerDisplayName property: A string describing where the item is stored. For example, the name of a * SharePoint site or the user name identifying the owner of the OneDrive storing the item. - * + * * @return the containerDisplayName value. */ public String containerDisplayName() { @@ -89,7 +86,7 @@ public String containerDisplayName() { /** * Set the containerDisplayName property: A string describing where the item is stored. For example, the name of a * SharePoint site or the user name identifying the owner of the OneDrive storing the item. - * + * * @param containerDisplayName the containerDisplayName value to set. * @return the MicrosoftGraphResourceVisualization object itself. */ @@ -101,7 +98,7 @@ public MicrosoftGraphResourceVisualization withContainerDisplayName(String conta /** * Get the containerType property: Can be used for filtering by the type of container in which the file is stored. * Such as Site or OneDriveBusiness. - * + * * @return the containerType value. */ public String containerType() { @@ -111,7 +108,7 @@ public String containerType() { /** * Set the containerType property: Can be used for filtering by the type of container in which the file is stored. * Such as Site or OneDriveBusiness. - * + * * @param containerType the containerType value to set. * @return the MicrosoftGraphResourceVisualization object itself. */ @@ -122,7 +119,7 @@ public MicrosoftGraphResourceVisualization withContainerType(String containerTyp /** * Get the containerWebUrl property: A path leading to the folder in which the item is stored. - * + * * @return the containerWebUrl value. */ public String containerWebUrl() { @@ -131,7 +128,7 @@ public String containerWebUrl() { /** * Set the containerWebUrl property: A path leading to the folder in which the item is stored. - * + * * @param containerWebUrl the containerWebUrl value to set. * @return the MicrosoftGraphResourceVisualization object itself. */ @@ -143,7 +140,7 @@ public MicrosoftGraphResourceVisualization withContainerWebUrl(String containerW /** * Get the mediaType property: The item's media type. Can be used for filtering for a specific type of file based on * supported IANA Media Mime Types. Note that not all Media Mime Types are supported. - * + * * @return the mediaType value. */ public String mediaType() { @@ -153,7 +150,7 @@ public String mediaType() { /** * Set the mediaType property: The item's media type. Can be used for filtering for a specific type of file based on * supported IANA Media Mime Types. Note that not all Media Mime Types are supported. - * + * * @param mediaType the mediaType value to set. * @return the MicrosoftGraphResourceVisualization object itself. */ @@ -164,7 +161,7 @@ public MicrosoftGraphResourceVisualization withMediaType(String mediaType) { /** * Get the previewImageUrl property: A URL leading to the preview image for the item. - * + * * @return the previewImageUrl value. */ public String previewImageUrl() { @@ -173,7 +170,7 @@ public String previewImageUrl() { /** * Set the previewImageUrl property: A URL leading to the preview image for the item. - * + * * @param previewImageUrl the previewImageUrl value to set. * @return the MicrosoftGraphResourceVisualization object itself. */ @@ -184,7 +181,7 @@ public MicrosoftGraphResourceVisualization withPreviewImageUrl(String previewIma /** * Get the previewText property: A preview text for the item. - * + * * @return the previewText value. */ public String previewText() { @@ -193,7 +190,7 @@ public String previewText() { /** * Set the previewText property: A preview text for the item. - * + * * @param previewText the previewText value to set. * @return the MicrosoftGraphResourceVisualization object itself. */ @@ -204,7 +201,7 @@ public MicrosoftGraphResourceVisualization withPreviewText(String previewText) { /** * Get the title property: The item's title text. - * + * * @return the title value. */ public String title() { @@ -213,7 +210,7 @@ public String title() { /** * Set the title property: The item's title text. - * + * * @param title the title value to set. * @return the MicrosoftGraphResourceVisualization object itself. */ @@ -225,7 +222,7 @@ public MicrosoftGraphResourceVisualization withTitle(String title) { /** * Get the type property: The item's media type. Can be used for filtering for a specific file based on a specific * type. See below for supported types. - * + * * @return the type value. */ public String type() { @@ -235,7 +232,7 @@ public String type() { /** * Set the type property: The item's media type. Can be used for filtering for a specific file based on a specific * type. See below for supported types. - * + * * @param type the type value to set. * @return the MicrosoftGraphResourceVisualization object itself. */ @@ -246,17 +243,16 @@ public MicrosoftGraphResourceVisualization withType(String type) { /** * Get the additionalProperties property: resourceVisualization. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: resourceVisualization. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphResourceVisualization object itself. */ @@ -265,19 +261,80 @@ public MicrosoftGraphResourceVisualization withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerDisplayName", this.containerDisplayName); + jsonWriter.writeStringField("containerType", this.containerType); + jsonWriter.writeStringField("containerWebUrl", this.containerWebUrl); + jsonWriter.writeStringField("mediaType", this.mediaType); + jsonWriter.writeStringField("previewImageUrl", this.previewImageUrl); + jsonWriter.writeStringField("previewText", this.previewText); + jsonWriter.writeStringField("title", this.title); + jsonWriter.writeStringField("type", this.type); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphResourceVisualization from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphResourceVisualization 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 MicrosoftGraphResourceVisualization. + */ + public static MicrosoftGraphResourceVisualization fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphResourceVisualization deserializedMicrosoftGraphResourceVisualization + = new MicrosoftGraphResourceVisualization(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphResourceVisualization.containerDisplayName = reader.getString(); + } else if ("containerType".equals(fieldName)) { + deserializedMicrosoftGraphResourceVisualization.containerType = reader.getString(); + } else if ("containerWebUrl".equals(fieldName)) { + deserializedMicrosoftGraphResourceVisualization.containerWebUrl = reader.getString(); + } else if ("mediaType".equals(fieldName)) { + deserializedMicrosoftGraphResourceVisualization.mediaType = reader.getString(); + } else if ("previewImageUrl".equals(fieldName)) { + deserializedMicrosoftGraphResourceVisualization.previewImageUrl = reader.getString(); + } else if ("previewText".equals(fieldName)) { + deserializedMicrosoftGraphResourceVisualization.previewText = reader.getString(); + } else if ("title".equals(fieldName)) { + deserializedMicrosoftGraphResourceVisualization.title = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMicrosoftGraphResourceVisualization.type = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphResourceVisualization.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphResourceVisualization; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResponseStatus.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResponseStatus.java index deeecd7582cc8..e0505536e4c9c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResponseStatus.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResponseStatus.java @@ -5,42 +5,47 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** responseStatus. */ +/** + * responseStatus. + */ @Fluent -public final class MicrosoftGraphResponseStatus { +public final class MicrosoftGraphResponseStatus implements JsonSerializable { /* * responseType */ - @JsonProperty(value = "response") private MicrosoftGraphResponseType response; /* - * The date and time that the response was returned. It uses ISO 8601 format and is always in UTC time. For - * example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' + * The date and time that the response was returned. It uses ISO 8601 format and is always in UTC time. For example, + * midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z' */ - @JsonProperty(value = "time") private OffsetDateTime time; /* * responseStatus */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphResponseStatus class. */ + /** + * Creates an instance of MicrosoftGraphResponseStatus class. + */ public MicrosoftGraphResponseStatus() { } /** * Get the response property: responseType. - * + * * @return the response value. */ public MicrosoftGraphResponseType response() { @@ -49,7 +54,7 @@ public MicrosoftGraphResponseType response() { /** * Set the response property: responseType. - * + * * @param response the response value to set. * @return the MicrosoftGraphResponseStatus object itself. */ @@ -61,7 +66,7 @@ public MicrosoftGraphResponseStatus withResponse(MicrosoftGraphResponseType resp /** * Get the time property: The date and time that the response was returned. It uses ISO 8601 format and is always in * UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @return the time value. */ public OffsetDateTime time() { @@ -71,7 +76,7 @@ public OffsetDateTime time() { /** * Set the time property: The date and time that the response was returned. It uses ISO 8601 format and is always in * UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. - * + * * @param time the time value to set. * @return the MicrosoftGraphResponseStatus object itself. */ @@ -82,17 +87,16 @@ public MicrosoftGraphResponseStatus withTime(OffsetDateTime time) { /** * Get the additionalProperties property: responseStatus. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: responseStatus. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphResponseStatus object itself. */ @@ -101,19 +105,64 @@ public MicrosoftGraphResponseStatus withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("response", this.response == null ? null : this.response.toString()); + jsonWriter.writeStringField("time", + this.time == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.time)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphResponseStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphResponseStatus 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 MicrosoftGraphResponseStatus. + */ + public static MicrosoftGraphResponseStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphResponseStatus deserializedMicrosoftGraphResponseStatus = new MicrosoftGraphResponseStatus(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("response".equals(fieldName)) { + deserializedMicrosoftGraphResponseStatus.response + = MicrosoftGraphResponseType.fromString(reader.getString()); + } else if ("time".equals(fieldName)) { + deserializedMicrosoftGraphResponseStatus.time = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphResponseStatus.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphResponseStatus; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResponseType.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResponseType.java index 76cb21992e958..00c6cab862749 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResponseType.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphResponseType.java @@ -5,32 +5,45 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** responseType. */ +/** + * responseType. + */ public final class MicrosoftGraphResponseType extends ExpandableStringEnum { - /** Static value none for MicrosoftGraphResponseType. */ + /** + * Static value none for MicrosoftGraphResponseType. + */ public static final MicrosoftGraphResponseType NONE = fromString("none"); - /** Static value organizer for MicrosoftGraphResponseType. */ + /** + * Static value organizer for MicrosoftGraphResponseType. + */ public static final MicrosoftGraphResponseType ORGANIZER = fromString("organizer"); - /** Static value tentativelyAccepted for MicrosoftGraphResponseType. */ + /** + * Static value tentativelyAccepted for MicrosoftGraphResponseType. + */ public static final MicrosoftGraphResponseType TENTATIVELY_ACCEPTED = fromString("tentativelyAccepted"); - /** Static value accepted for MicrosoftGraphResponseType. */ + /** + * Static value accepted for MicrosoftGraphResponseType. + */ public static final MicrosoftGraphResponseType ACCEPTED = fromString("accepted"); - /** Static value declined for MicrosoftGraphResponseType. */ + /** + * Static value declined for MicrosoftGraphResponseType. + */ public static final MicrosoftGraphResponseType DECLINED = fromString("declined"); - /** Static value notResponded for MicrosoftGraphResponseType. */ + /** + * Static value notResponded for MicrosoftGraphResponseType. + */ public static final MicrosoftGraphResponseType NOT_RESPONDED = fromString("notResponded"); /** * Creates a new instance of MicrosoftGraphResponseType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -39,18 +52,17 @@ public MicrosoftGraphResponseType() { /** * Creates or finds a MicrosoftGraphResponseType from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphResponseType. */ - @JsonCreator public static MicrosoftGraphResponseType fromString(String name) { return fromString(name, MicrosoftGraphResponseType.class); } /** * Gets known MicrosoftGraphResponseType values. - * + * * @return known MicrosoftGraphResponseType values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSamlSingleSignOnSettings.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSamlSingleSignOnSettings.java index d95f5f390d225..dfafd67550336 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSamlSingleSignOnSettings.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSamlSingleSignOnSettings.java @@ -5,35 +5,40 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** samlSingleSignOnSettings. */ +/** + * samlSingleSignOnSettings. + */ @Fluent -public final class MicrosoftGraphSamlSingleSignOnSettings { +public final class MicrosoftGraphSamlSingleSignOnSettings + implements JsonSerializable { /* * The relative URI the service provider would redirect to after completion of the single sign-on flow. */ - @JsonProperty(value = "relayState") private String relayState; /* * samlSingleSignOnSettings */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSamlSingleSignOnSettings class. */ + /** + * Creates an instance of MicrosoftGraphSamlSingleSignOnSettings class. + */ public MicrosoftGraphSamlSingleSignOnSettings() { } /** * Get the relayState property: The relative URI the service provider would redirect to after completion of the * single sign-on flow. - * + * * @return the relayState value. */ public String relayState() { @@ -43,7 +48,7 @@ public String relayState() { /** * Set the relayState property: The relative URI the service provider would redirect to after completion of the * single sign-on flow. - * + * * @param relayState the relayState value to set. * @return the MicrosoftGraphSamlSingleSignOnSettings object itself. */ @@ -54,17 +59,16 @@ public MicrosoftGraphSamlSingleSignOnSettings withRelayState(String relayState) /** * Get the additionalProperties property: samlSingleSignOnSettings. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: samlSingleSignOnSettings. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSamlSingleSignOnSettings object itself. */ @@ -73,19 +77,59 @@ public MicrosoftGraphSamlSingleSignOnSettings withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("relayState", this.relayState); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSamlSingleSignOnSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSamlSingleSignOnSettings 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 MicrosoftGraphSamlSingleSignOnSettings. + */ + public static MicrosoftGraphSamlSingleSignOnSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSamlSingleSignOnSettings deserializedMicrosoftGraphSamlSingleSignOnSettings + = new MicrosoftGraphSamlSingleSignOnSettings(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("relayState".equals(fieldName)) { + deserializedMicrosoftGraphSamlSingleSignOnSettings.relayState = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSamlSingleSignOnSettings.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSamlSingleSignOnSettings; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSchedule.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSchedule.java index 456042ec7826f..4bce0aa1ffe74 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSchedule.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSchedule.java @@ -5,143 +5,128 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** schedule. */ +/** + * schedule. + */ @Fluent public final class MicrosoftGraphSchedule extends MicrosoftGraphEntity { /* * Indicates whether the schedule is enabled for the team. Required. */ - @JsonProperty(value = "enabled") private Boolean enabled; /* * Indicates whether offer shift requests are enabled for the schedule. */ - @JsonProperty(value = "offerShiftRequestsEnabled") private Boolean offerShiftRequestsEnabled; /* * Indicates whether open shifts are enabled for the schedule. */ - @JsonProperty(value = "openShiftsEnabled") private Boolean openShiftsEnabled; /* * operationStatus */ - @JsonProperty(value = "provisionStatus") private MicrosoftGraphOperationStatus provisionStatus; /* * Additional information about why schedule provisioning failed. */ - @JsonProperty(value = "provisionStatusCode") private String provisionStatusCode; /* * Indicates whether swap shifts requests are enabled for the schedule. */ - @JsonProperty(value = "swapShiftsRequestsEnabled") private Boolean swapShiftsRequestsEnabled; /* * Indicates whether time clock is enabled for the schedule. */ - @JsonProperty(value = "timeClockEnabled") private Boolean timeClockEnabled; /* * Indicates whether time off requests are enabled for the schedule. */ - @JsonProperty(value = "timeOffRequestsEnabled") private Boolean timeOffRequestsEnabled; /* * Indicates the time zone of the schedule team using tz database format. Required. */ - @JsonProperty(value = "timeZone") private String timeZone; /* * The workforceIntegrationIds property. */ - @JsonProperty(value = "workforceIntegrationIds") private List workforceIntegrationIds; /* * The offerShiftRequests property. */ - @JsonProperty(value = "offerShiftRequests") private List offerShiftRequests; /* * The openShiftChangeRequests property. */ - @JsonProperty(value = "openShiftChangeRequests") private List openShiftChangeRequests; /* * The openShifts property. */ - @JsonProperty(value = "openShifts") private List openShifts; /* * The logical grouping of users in the schedule (usually by role). */ - @JsonProperty(value = "schedulingGroups") private List schedulingGroups; /* * The shifts in the schedule. */ - @JsonProperty(value = "shifts") private List shifts; /* * The swapShiftsChangeRequests property. */ - @JsonProperty(value = "swapShiftsChangeRequests") private List swapShiftsChangeRequests; /* * The set of reasons for a time off in the schedule. */ - @JsonProperty(value = "timeOffReasons") private List timeOffReasons; /* * The timeOffRequests property. */ - @JsonProperty(value = "timeOffRequests") private List timeOffRequests; /* * The instances of times off in the schedule. */ - @JsonProperty(value = "timesOff") private List timesOff; /* * schedule */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSchedule class. */ + /** + * Creates an instance of MicrosoftGraphSchedule class. + */ public MicrosoftGraphSchedule() { } /** * Get the enabled property: Indicates whether the schedule is enabled for the team. Required. - * + * * @return the enabled value. */ public Boolean enabled() { @@ -150,7 +135,7 @@ public Boolean enabled() { /** * Set the enabled property: Indicates whether the schedule is enabled for the team. Required. - * + * * @param enabled the enabled value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -161,7 +146,7 @@ public MicrosoftGraphSchedule withEnabled(Boolean enabled) { /** * Get the offerShiftRequestsEnabled property: Indicates whether offer shift requests are enabled for the schedule. - * + * * @return the offerShiftRequestsEnabled value. */ public Boolean offerShiftRequestsEnabled() { @@ -170,7 +155,7 @@ public Boolean offerShiftRequestsEnabled() { /** * Set the offerShiftRequestsEnabled property: Indicates whether offer shift requests are enabled for the schedule. - * + * * @param offerShiftRequestsEnabled the offerShiftRequestsEnabled value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -181,7 +166,7 @@ public MicrosoftGraphSchedule withOfferShiftRequestsEnabled(Boolean offerShiftRe /** * Get the openShiftsEnabled property: Indicates whether open shifts are enabled for the schedule. - * + * * @return the openShiftsEnabled value. */ public Boolean openShiftsEnabled() { @@ -190,7 +175,7 @@ public Boolean openShiftsEnabled() { /** * Set the openShiftsEnabled property: Indicates whether open shifts are enabled for the schedule. - * + * * @param openShiftsEnabled the openShiftsEnabled value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -201,7 +186,7 @@ public MicrosoftGraphSchedule withOpenShiftsEnabled(Boolean openShiftsEnabled) { /** * Get the provisionStatus property: operationStatus. - * + * * @return the provisionStatus value. */ public MicrosoftGraphOperationStatus provisionStatus() { @@ -210,7 +195,7 @@ public MicrosoftGraphOperationStatus provisionStatus() { /** * Set the provisionStatus property: operationStatus. - * + * * @param provisionStatus the provisionStatus value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -221,7 +206,7 @@ public MicrosoftGraphSchedule withProvisionStatus(MicrosoftGraphOperationStatus /** * Get the provisionStatusCode property: Additional information about why schedule provisioning failed. - * + * * @return the provisionStatusCode value. */ public String provisionStatusCode() { @@ -230,7 +215,7 @@ public String provisionStatusCode() { /** * Set the provisionStatusCode property: Additional information about why schedule provisioning failed. - * + * * @param provisionStatusCode the provisionStatusCode value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -241,7 +226,7 @@ public MicrosoftGraphSchedule withProvisionStatusCode(String provisionStatusCode /** * Get the swapShiftsRequestsEnabled property: Indicates whether swap shifts requests are enabled for the schedule. - * + * * @return the swapShiftsRequestsEnabled value. */ public Boolean swapShiftsRequestsEnabled() { @@ -250,7 +235,7 @@ public Boolean swapShiftsRequestsEnabled() { /** * Set the swapShiftsRequestsEnabled property: Indicates whether swap shifts requests are enabled for the schedule. - * + * * @param swapShiftsRequestsEnabled the swapShiftsRequestsEnabled value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -261,7 +246,7 @@ public MicrosoftGraphSchedule withSwapShiftsRequestsEnabled(Boolean swapShiftsRe /** * Get the timeClockEnabled property: Indicates whether time clock is enabled for the schedule. - * + * * @return the timeClockEnabled value. */ public Boolean timeClockEnabled() { @@ -270,7 +255,7 @@ public Boolean timeClockEnabled() { /** * Set the timeClockEnabled property: Indicates whether time clock is enabled for the schedule. - * + * * @param timeClockEnabled the timeClockEnabled value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -281,7 +266,7 @@ public MicrosoftGraphSchedule withTimeClockEnabled(Boolean timeClockEnabled) { /** * Get the timeOffRequestsEnabled property: Indicates whether time off requests are enabled for the schedule. - * + * * @return the timeOffRequestsEnabled value. */ public Boolean timeOffRequestsEnabled() { @@ -290,7 +275,7 @@ public Boolean timeOffRequestsEnabled() { /** * Set the timeOffRequestsEnabled property: Indicates whether time off requests are enabled for the schedule. - * + * * @param timeOffRequestsEnabled the timeOffRequestsEnabled value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -301,7 +286,7 @@ public MicrosoftGraphSchedule withTimeOffRequestsEnabled(Boolean timeOffRequests /** * Get the timeZone property: Indicates the time zone of the schedule team using tz database format. Required. - * + * * @return the timeZone value. */ public String timeZone() { @@ -310,7 +295,7 @@ public String timeZone() { /** * Set the timeZone property: Indicates the time zone of the schedule team using tz database format. Required. - * + * * @param timeZone the timeZone value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -321,7 +306,7 @@ public MicrosoftGraphSchedule withTimeZone(String timeZone) { /** * Get the workforceIntegrationIds property: The workforceIntegrationIds property. - * + * * @return the workforceIntegrationIds value. */ public List workforceIntegrationIds() { @@ -330,7 +315,7 @@ public List workforceIntegrationIds() { /** * Set the workforceIntegrationIds property: The workforceIntegrationIds property. - * + * * @param workforceIntegrationIds the workforceIntegrationIds value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -341,7 +326,7 @@ public MicrosoftGraphSchedule withWorkforceIntegrationIds(List workforce /** * Get the offerShiftRequests property: The offerShiftRequests property. - * + * * @return the offerShiftRequests value. */ public List offerShiftRequests() { @@ -350,7 +335,7 @@ public List offerShiftRequests() { /** * Set the offerShiftRequests property: The offerShiftRequests property. - * + * * @param offerShiftRequests the offerShiftRequests value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -361,7 +346,7 @@ public MicrosoftGraphSchedule withOfferShiftRequests(List openShiftChangeRequests() { @@ -370,19 +355,19 @@ public List openShiftChangeRequests() { /** * Set the openShiftChangeRequests property: The openShiftChangeRequests property. - * + * * @param openShiftChangeRequests the openShiftChangeRequests value to set. * @return the MicrosoftGraphSchedule object itself. */ - public MicrosoftGraphSchedule withOpenShiftChangeRequests( - List openShiftChangeRequests) { + public MicrosoftGraphSchedule + withOpenShiftChangeRequests(List openShiftChangeRequests) { this.openShiftChangeRequests = openShiftChangeRequests; return this; } /** * Get the openShifts property: The openShifts property. - * + * * @return the openShifts value. */ public List openShifts() { @@ -391,7 +376,7 @@ public List openShifts() { /** * Set the openShifts property: The openShifts property. - * + * * @param openShifts the openShifts value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -402,7 +387,7 @@ public MicrosoftGraphSchedule withOpenShifts(List openS /** * Get the schedulingGroups property: The logical grouping of users in the schedule (usually by role). - * + * * @return the schedulingGroups value. */ public List schedulingGroups() { @@ -411,7 +396,7 @@ public List schedulingGroups() { /** * Set the schedulingGroups property: The logical grouping of users in the schedule (usually by role). - * + * * @param schedulingGroups the schedulingGroups value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -422,7 +407,7 @@ public MicrosoftGraphSchedule withSchedulingGroups(List shifts() { @@ -431,7 +416,7 @@ public List shifts() { /** * Set the shifts property: The shifts in the schedule. - * + * * @param shifts the shifts value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -442,7 +427,7 @@ public MicrosoftGraphSchedule withShifts(List shifts) { /** * Get the swapShiftsChangeRequests property: The swapShiftsChangeRequests property. - * + * * @return the swapShiftsChangeRequests value. */ public List swapShiftsChangeRequests() { @@ -451,19 +436,19 @@ public List swapShiftsChangeRequests() { /** * Set the swapShiftsChangeRequests property: The swapShiftsChangeRequests property. - * + * * @param swapShiftsChangeRequests the swapShiftsChangeRequests value to set. * @return the MicrosoftGraphSchedule object itself. */ - public MicrosoftGraphSchedule withSwapShiftsChangeRequests( - List swapShiftsChangeRequests) { + public MicrosoftGraphSchedule + withSwapShiftsChangeRequests(List swapShiftsChangeRequests) { this.swapShiftsChangeRequests = swapShiftsChangeRequests; return this; } /** * Get the timeOffReasons property: The set of reasons for a time off in the schedule. - * + * * @return the timeOffReasons value. */ public List timeOffReasons() { @@ -472,7 +457,7 @@ public List timeOffReasons() { /** * Set the timeOffReasons property: The set of reasons for a time off in the schedule. - * + * * @param timeOffReasons the timeOffReasons value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -483,7 +468,7 @@ public MicrosoftGraphSchedule withTimeOffReasons(List timeOffRequests() { @@ -492,7 +477,7 @@ public List timeOffRequests() { /** * Set the timeOffRequests property: The timeOffRequests property. - * + * * @param timeOffRequests the timeOffRequests value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -503,7 +488,7 @@ public MicrosoftGraphSchedule withTimeOffRequests(List timesOff() { @@ -512,7 +497,7 @@ public List timesOff() { /** * Set the timesOff property: The instances of times off in the schedule. - * + * * @param timesOff the timesOff value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -523,17 +508,16 @@ public MicrosoftGraphSchedule withTimesOff(List timesOff) /** * Get the additionalProperties property: schedule. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: schedule. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSchedule object itself. */ @@ -542,15 +526,9 @@ public MicrosoftGraphSchedule withAdditionalProperties(Map addit return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSchedule withId(String id) { super.withId(id); @@ -559,7 +537,7 @@ public MicrosoftGraphSchedule withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -593,4 +571,139 @@ public void validate() { timesOff().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeBooleanField("offerShiftRequestsEnabled", this.offerShiftRequestsEnabled); + jsonWriter.writeBooleanField("openShiftsEnabled", this.openShiftsEnabled); + jsonWriter.writeStringField("provisionStatus", + this.provisionStatus == null ? null : this.provisionStatus.toString()); + jsonWriter.writeStringField("provisionStatusCode", this.provisionStatusCode); + jsonWriter.writeBooleanField("swapShiftsRequestsEnabled", this.swapShiftsRequestsEnabled); + jsonWriter.writeBooleanField("timeClockEnabled", this.timeClockEnabled); + jsonWriter.writeBooleanField("timeOffRequestsEnabled", this.timeOffRequestsEnabled); + jsonWriter.writeStringField("timeZone", this.timeZone); + jsonWriter.writeArrayField("workforceIntegrationIds", this.workforceIntegrationIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("offerShiftRequests", this.offerShiftRequests, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("openShiftChangeRequests", this.openShiftChangeRequests, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("openShifts", this.openShifts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("schedulingGroups", this.schedulingGroups, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("shifts", this.shifts, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("swapShiftsChangeRequests", this.swapShiftsChangeRequests, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("timeOffReasons", this.timeOffReasons, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("timeOffRequests", this.timeOffRequests, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("timesOff", this.timesOff, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSchedule 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 MicrosoftGraphSchedule. + */ + public static MicrosoftGraphSchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSchedule deserializedMicrosoftGraphSchedule = new MicrosoftGraphSchedule(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphSchedule.withId(reader.getString()); + } else if ("enabled".equals(fieldName)) { + deserializedMicrosoftGraphSchedule.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("offerShiftRequestsEnabled".equals(fieldName)) { + deserializedMicrosoftGraphSchedule.offerShiftRequestsEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("openShiftsEnabled".equals(fieldName)) { + deserializedMicrosoftGraphSchedule.openShiftsEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("provisionStatus".equals(fieldName)) { + deserializedMicrosoftGraphSchedule.provisionStatus + = MicrosoftGraphOperationStatus.fromString(reader.getString()); + } else if ("provisionStatusCode".equals(fieldName)) { + deserializedMicrosoftGraphSchedule.provisionStatusCode = reader.getString(); + } else if ("swapShiftsRequestsEnabled".equals(fieldName)) { + deserializedMicrosoftGraphSchedule.swapShiftsRequestsEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("timeClockEnabled".equals(fieldName)) { + deserializedMicrosoftGraphSchedule.timeClockEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("timeOffRequestsEnabled".equals(fieldName)) { + deserializedMicrosoftGraphSchedule.timeOffRequestsEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("timeZone".equals(fieldName)) { + deserializedMicrosoftGraphSchedule.timeZone = reader.getString(); + } else if ("workforceIntegrationIds".equals(fieldName)) { + List workforceIntegrationIds = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphSchedule.workforceIntegrationIds = workforceIntegrationIds; + } else if ("offerShiftRequests".equals(fieldName)) { + List offerShiftRequests + = reader.readArray(reader1 -> MicrosoftGraphOfferShiftRequest.fromJson(reader1)); + deserializedMicrosoftGraphSchedule.offerShiftRequests = offerShiftRequests; + } else if ("openShiftChangeRequests".equals(fieldName)) { + List openShiftChangeRequests + = reader.readArray(reader1 -> MicrosoftGraphOpenShiftChangeRequest.fromJson(reader1)); + deserializedMicrosoftGraphSchedule.openShiftChangeRequests = openShiftChangeRequests; + } else if ("openShifts".equals(fieldName)) { + List openShifts + = reader.readArray(reader1 -> MicrosoftGraphOpenShift.fromJson(reader1)); + deserializedMicrosoftGraphSchedule.openShifts = openShifts; + } else if ("schedulingGroups".equals(fieldName)) { + List schedulingGroups + = reader.readArray(reader1 -> MicrosoftGraphSchedulingGroup.fromJson(reader1)); + deserializedMicrosoftGraphSchedule.schedulingGroups = schedulingGroups; + } else if ("shifts".equals(fieldName)) { + List shifts + = reader.readArray(reader1 -> MicrosoftGraphShift.fromJson(reader1)); + deserializedMicrosoftGraphSchedule.shifts = shifts; + } else if ("swapShiftsChangeRequests".equals(fieldName)) { + List swapShiftsChangeRequests + = reader.readArray(reader1 -> MicrosoftGraphSwapShiftsChangeRequest.fromJson(reader1)); + deserializedMicrosoftGraphSchedule.swapShiftsChangeRequests = swapShiftsChangeRequests; + } else if ("timeOffReasons".equals(fieldName)) { + List timeOffReasons + = reader.readArray(reader1 -> MicrosoftGraphTimeOffReason.fromJson(reader1)); + deserializedMicrosoftGraphSchedule.timeOffReasons = timeOffReasons; + } else if ("timeOffRequests".equals(fieldName)) { + List timeOffRequests + = reader.readArray(reader1 -> MicrosoftGraphTimeOffRequest.fromJson(reader1)); + deserializedMicrosoftGraphSchedule.timeOffRequests = timeOffRequests; + } else if ("timesOff".equals(fieldName)) { + List timesOff + = reader.readArray(reader1 -> MicrosoftGraphTimeOff.fromJson(reader1)); + deserializedMicrosoftGraphSchedule.timesOff = timesOff; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSchedule.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSchedule; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeRequest.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeRequest.java index 896f9a78ceba0..dc0987768fe90 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeRequest.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeRequest.java @@ -5,77 +5,75 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** scheduleChangeRequest. */ +/** + * scheduleChangeRequest. + */ @Fluent public class MicrosoftGraphScheduleChangeRequest extends MicrosoftGraphChangeTrackedEntity { /* * scheduleChangeRequestActor */ - @JsonProperty(value = "assignedTo") private MicrosoftGraphScheduleChangeRequestActor assignedTo; /* * The managerActionDateTime property. */ - @JsonProperty(value = "managerActionDateTime") private OffsetDateTime managerActionDateTime; /* * The managerActionMessage property. */ - @JsonProperty(value = "managerActionMessage") private String managerActionMessage; /* * The managerUserId property. */ - @JsonProperty(value = "managerUserId") private String managerUserId; /* * The senderDateTime property. */ - @JsonProperty(value = "senderDateTime") private OffsetDateTime senderDateTime; /* * The senderMessage property. */ - @JsonProperty(value = "senderMessage") private String senderMessage; /* * The senderUserId property. */ - @JsonProperty(value = "senderUserId") private String senderUserId; /* * scheduleChangeState */ - @JsonProperty(value = "state") private MicrosoftGraphScheduleChangeState state; /* * scheduleChangeRequest */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphScheduleChangeRequest class. */ + /** + * Creates an instance of MicrosoftGraphScheduleChangeRequest class. + */ public MicrosoftGraphScheduleChangeRequest() { } /** * Get the assignedTo property: scheduleChangeRequestActor. - * + * * @return the assignedTo value. */ public MicrosoftGraphScheduleChangeRequestActor assignedTo() { @@ -84,7 +82,7 @@ public MicrosoftGraphScheduleChangeRequestActor assignedTo() { /** * Set the assignedTo property: scheduleChangeRequestActor. - * + * * @param assignedTo the assignedTo value to set. * @return the MicrosoftGraphScheduleChangeRequest object itself. */ @@ -95,7 +93,7 @@ public MicrosoftGraphScheduleChangeRequest withAssignedTo(MicrosoftGraphSchedule /** * Get the managerActionDateTime property: The managerActionDateTime property. - * + * * @return the managerActionDateTime value. */ public OffsetDateTime managerActionDateTime() { @@ -104,7 +102,7 @@ public OffsetDateTime managerActionDateTime() { /** * Set the managerActionDateTime property: The managerActionDateTime property. - * + * * @param managerActionDateTime the managerActionDateTime value to set. * @return the MicrosoftGraphScheduleChangeRequest object itself. */ @@ -115,7 +113,7 @@ public MicrosoftGraphScheduleChangeRequest withManagerActionDateTime(OffsetDateT /** * Get the managerActionMessage property: The managerActionMessage property. - * + * * @return the managerActionMessage value. */ public String managerActionMessage() { @@ -124,7 +122,7 @@ public String managerActionMessage() { /** * Set the managerActionMessage property: The managerActionMessage property. - * + * * @param managerActionMessage the managerActionMessage value to set. * @return the MicrosoftGraphScheduleChangeRequest object itself. */ @@ -135,7 +133,7 @@ public MicrosoftGraphScheduleChangeRequest withManagerActionMessage(String manag /** * Get the managerUserId property: The managerUserId property. - * + * * @return the managerUserId value. */ public String managerUserId() { @@ -144,7 +142,7 @@ public String managerUserId() { /** * Set the managerUserId property: The managerUserId property. - * + * * @param managerUserId the managerUserId value to set. * @return the MicrosoftGraphScheduleChangeRequest object itself. */ @@ -155,7 +153,7 @@ public MicrosoftGraphScheduleChangeRequest withManagerUserId(String managerUserI /** * Get the senderDateTime property: The senderDateTime property. - * + * * @return the senderDateTime value. */ public OffsetDateTime senderDateTime() { @@ -164,7 +162,7 @@ public OffsetDateTime senderDateTime() { /** * Set the senderDateTime property: The senderDateTime property. - * + * * @param senderDateTime the senderDateTime value to set. * @return the MicrosoftGraphScheduleChangeRequest object itself. */ @@ -175,7 +173,7 @@ public MicrosoftGraphScheduleChangeRequest withSenderDateTime(OffsetDateTime sen /** * Get the senderMessage property: The senderMessage property. - * + * * @return the senderMessage value. */ public String senderMessage() { @@ -184,7 +182,7 @@ public String senderMessage() { /** * Set the senderMessage property: The senderMessage property. - * + * * @param senderMessage the senderMessage value to set. * @return the MicrosoftGraphScheduleChangeRequest object itself. */ @@ -195,7 +193,7 @@ public MicrosoftGraphScheduleChangeRequest withSenderMessage(String senderMessag /** * Get the senderUserId property: The senderUserId property. - * + * * @return the senderUserId value. */ public String senderUserId() { @@ -204,7 +202,7 @@ public String senderUserId() { /** * Set the senderUserId property: The senderUserId property. - * + * * @param senderUserId the senderUserId value to set. * @return the MicrosoftGraphScheduleChangeRequest object itself. */ @@ -215,7 +213,7 @@ public MicrosoftGraphScheduleChangeRequest withSenderUserId(String senderUserId) /** * Get the state property: scheduleChangeState. - * + * * @return the state value. */ public MicrosoftGraphScheduleChangeState state() { @@ -224,7 +222,7 @@ public MicrosoftGraphScheduleChangeState state() { /** * Set the state property: scheduleChangeState. - * + * * @param state the state value to set. * @return the MicrosoftGraphScheduleChangeRequest object itself. */ @@ -235,17 +233,16 @@ public MicrosoftGraphScheduleChangeRequest withState(MicrosoftGraphScheduleChang /** * Get the additionalProperties property: scheduleChangeRequest. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: scheduleChangeRequest. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphScheduleChangeRequest object itself. */ @@ -254,36 +251,36 @@ public MicrosoftGraphScheduleChangeRequest withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphScheduleChangeRequest withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphScheduleChangeRequest withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphScheduleChangeRequest withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphScheduleChangeRequest withId(String id) { super.withId(id); @@ -292,11 +289,107 @@ public MicrosoftGraphScheduleChangeRequest withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeStringField("assignedTo", this.assignedTo == null ? null : this.assignedTo.toString()); + jsonWriter.writeStringField("managerActionDateTime", + this.managerActionDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.managerActionDateTime)); + jsonWriter.writeStringField("managerActionMessage", this.managerActionMessage); + jsonWriter.writeStringField("managerUserId", this.managerUserId); + jsonWriter.writeStringField("senderDateTime", + this.senderDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.senderDateTime)); + jsonWriter.writeStringField("senderMessage", this.senderMessage); + jsonWriter.writeStringField("senderUserId", this.senderUserId); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphScheduleChangeRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphScheduleChangeRequest 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 MicrosoftGraphScheduleChangeRequest. + */ + public static MicrosoftGraphScheduleChangeRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphScheduleChangeRequest deserializedMicrosoftGraphScheduleChangeRequest + = new MicrosoftGraphScheduleChangeRequest(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.withId(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest + .withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("assignedTo".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.assignedTo + = MicrosoftGraphScheduleChangeRequestActor.fromString(reader.getString()); + } else if ("managerActionDateTime".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.managerActionDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("managerActionMessage".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.managerActionMessage = reader.getString(); + } else if ("managerUserId".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.managerUserId = reader.getString(); + } else if ("senderDateTime".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.senderDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("senderMessage".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.senderMessage = reader.getString(); + } else if ("senderUserId".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.senderUserId = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedMicrosoftGraphScheduleChangeRequest.state + = MicrosoftGraphScheduleChangeState.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphScheduleChangeRequest.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphScheduleChangeRequest; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeRequestActor.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeRequestActor.java index 2b6768a39f687..8233cfbb5be69 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeRequestActor.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeRequestActor.java @@ -5,31 +5,42 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** scheduleChangeRequestActor. */ +/** + * scheduleChangeRequestActor. + */ public final class MicrosoftGraphScheduleChangeRequestActor extends ExpandableStringEnum { - /** Static value sender for MicrosoftGraphScheduleChangeRequestActor. */ + /** + * Static value sender for MicrosoftGraphScheduleChangeRequestActor. + */ public static final MicrosoftGraphScheduleChangeRequestActor SENDER = fromString("sender"); - /** Static value recipient for MicrosoftGraphScheduleChangeRequestActor. */ + /** + * Static value recipient for MicrosoftGraphScheduleChangeRequestActor. + */ public static final MicrosoftGraphScheduleChangeRequestActor RECIPIENT = fromString("recipient"); - /** Static value manager for MicrosoftGraphScheduleChangeRequestActor. */ + /** + * Static value manager for MicrosoftGraphScheduleChangeRequestActor. + */ public static final MicrosoftGraphScheduleChangeRequestActor MANAGER = fromString("manager"); - /** Static value system for MicrosoftGraphScheduleChangeRequestActor. */ + /** + * Static value system for MicrosoftGraphScheduleChangeRequestActor. + */ public static final MicrosoftGraphScheduleChangeRequestActor SYSTEM = fromString("system"); - /** Static value unknownFutureValue for MicrosoftGraphScheduleChangeRequestActor. */ - public static final MicrosoftGraphScheduleChangeRequestActor UNKNOWN_FUTURE_VALUE = - fromString("unknownFutureValue"); + /** + * Static value unknownFutureValue for MicrosoftGraphScheduleChangeRequestActor. + */ + public static final MicrosoftGraphScheduleChangeRequestActor UNKNOWN_FUTURE_VALUE + = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphScheduleChangeRequestActor value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -38,18 +49,17 @@ public MicrosoftGraphScheduleChangeRequestActor() { /** * Creates or finds a MicrosoftGraphScheduleChangeRequestActor from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphScheduleChangeRequestActor. */ - @JsonCreator public static MicrosoftGraphScheduleChangeRequestActor fromString(String name) { return fromString(name, MicrosoftGraphScheduleChangeRequestActor.class); } /** * Gets known MicrosoftGraphScheduleChangeRequestActor values. - * + * * @return known MicrosoftGraphScheduleChangeRequestActor values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeState.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeState.java index 2b0e26c8769f8..6686dfa61c9ba 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeState.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleChangeState.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** scheduleChangeState. */ +/** + * scheduleChangeState. + */ public final class MicrosoftGraphScheduleChangeState extends ExpandableStringEnum { - /** Static value pending for MicrosoftGraphScheduleChangeState. */ + /** + * Static value pending for MicrosoftGraphScheduleChangeState. + */ public static final MicrosoftGraphScheduleChangeState PENDING = fromString("pending"); - /** Static value approved for MicrosoftGraphScheduleChangeState. */ + /** + * Static value approved for MicrosoftGraphScheduleChangeState. + */ public static final MicrosoftGraphScheduleChangeState APPROVED = fromString("approved"); - /** Static value declined for MicrosoftGraphScheduleChangeState. */ + /** + * Static value declined for MicrosoftGraphScheduleChangeState. + */ public static final MicrosoftGraphScheduleChangeState DECLINED = fromString("declined"); - /** Static value unknownFutureValue for MicrosoftGraphScheduleChangeState. */ + /** + * Static value unknownFutureValue for MicrosoftGraphScheduleChangeState. + */ public static final MicrosoftGraphScheduleChangeState UNKNOWN_FUTURE_VALUE = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphScheduleChangeState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public MicrosoftGraphScheduleChangeState() { /** * Creates or finds a MicrosoftGraphScheduleChangeState from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphScheduleChangeState. */ - @JsonCreator public static MicrosoftGraphScheduleChangeState fromString(String name) { return fromString(name, MicrosoftGraphScheduleChangeState.class); } /** * Gets known MicrosoftGraphScheduleChangeState values. - * + * * @return known MicrosoftGraphScheduleChangeState values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleEntity.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleEntity.java index 129b60cc7b85a..1b83c06c05d12 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleEntity.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleEntity.java @@ -5,47 +5,51 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** scheduleEntity. */ +/** + * scheduleEntity. + */ @Fluent -public class MicrosoftGraphScheduleEntity { +public class MicrosoftGraphScheduleEntity implements JsonSerializable { /* * The endDateTime property. */ - @JsonProperty(value = "endDateTime") private OffsetDateTime endDateTime; /* * The startDateTime property. */ - @JsonProperty(value = "startDateTime") private OffsetDateTime startDateTime; /* * scheduleEntityTheme */ - @JsonProperty(value = "theme") private MicrosoftGraphScheduleEntityTheme theme; /* * scheduleEntity */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphScheduleEntity class. */ + /** + * Creates an instance of MicrosoftGraphScheduleEntity class. + */ public MicrosoftGraphScheduleEntity() { } /** * Get the endDateTime property: The endDateTime property. - * + * * @return the endDateTime value. */ public OffsetDateTime endDateTime() { @@ -54,7 +58,7 @@ public OffsetDateTime endDateTime() { /** * Set the endDateTime property: The endDateTime property. - * + * * @param endDateTime the endDateTime value to set. * @return the MicrosoftGraphScheduleEntity object itself. */ @@ -65,7 +69,7 @@ public MicrosoftGraphScheduleEntity withEndDateTime(OffsetDateTime endDateTime) /** * Get the startDateTime property: The startDateTime property. - * + * * @return the startDateTime value. */ public OffsetDateTime startDateTime() { @@ -74,7 +78,7 @@ public OffsetDateTime startDateTime() { /** * Set the startDateTime property: The startDateTime property. - * + * * @param startDateTime the startDateTime value to set. * @return the MicrosoftGraphScheduleEntity object itself. */ @@ -85,7 +89,7 @@ public MicrosoftGraphScheduleEntity withStartDateTime(OffsetDateTime startDateTi /** * Get the theme property: scheduleEntityTheme. - * + * * @return the theme value. */ public MicrosoftGraphScheduleEntityTheme theme() { @@ -94,7 +98,7 @@ public MicrosoftGraphScheduleEntityTheme theme() { /** * Set the theme property: scheduleEntityTheme. - * + * * @param theme the theme value to set. * @return the MicrosoftGraphScheduleEntity object itself. */ @@ -105,17 +109,16 @@ public MicrosoftGraphScheduleEntity withTheme(MicrosoftGraphScheduleEntityTheme /** * Get the additionalProperties property: scheduleEntity. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: scheduleEntity. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphScheduleEntity object itself. */ @@ -124,19 +127,69 @@ public MicrosoftGraphScheduleEntity withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endDateTime", + this.endDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endDateTime)); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + jsonWriter.writeStringField("theme", this.theme == null ? null : this.theme.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphScheduleEntity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphScheduleEntity 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 MicrosoftGraphScheduleEntity. + */ + public static MicrosoftGraphScheduleEntity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphScheduleEntity deserializedMicrosoftGraphScheduleEntity = new MicrosoftGraphScheduleEntity(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endDateTime".equals(fieldName)) { + deserializedMicrosoftGraphScheduleEntity.endDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("startDateTime".equals(fieldName)) { + deserializedMicrosoftGraphScheduleEntity.startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("theme".equals(fieldName)) { + deserializedMicrosoftGraphScheduleEntity.theme + = MicrosoftGraphScheduleEntityTheme.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphScheduleEntity.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphScheduleEntity; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleEntityTheme.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleEntityTheme.java index bd8c89f3954a7..6e2e5431d5da7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleEntityTheme.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleEntityTheme.java @@ -5,53 +5,80 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** scheduleEntityTheme. */ +/** + * scheduleEntityTheme. + */ public final class MicrosoftGraphScheduleEntityTheme extends ExpandableStringEnum { - /** Static value white for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value white for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme WHITE = fromString("white"); - /** Static value blue for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value blue for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme BLUE = fromString("blue"); - /** Static value green for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value green for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme GREEN = fromString("green"); - /** Static value purple for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value purple for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme PURPLE = fromString("purple"); - /** Static value pink for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value pink for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme PINK = fromString("pink"); - /** Static value yellow for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value yellow for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme YELLOW = fromString("yellow"); - /** Static value gray for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value gray for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme GRAY = fromString("gray"); - /** Static value darkBlue for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value darkBlue for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme DARK_BLUE = fromString("darkBlue"); - /** Static value darkGreen for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value darkGreen for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme DARK_GREEN = fromString("darkGreen"); - /** Static value darkPurple for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value darkPurple for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme DARK_PURPLE = fromString("darkPurple"); - /** Static value darkPink for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value darkPink for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme DARK_PINK = fromString("darkPink"); - /** Static value darkYellow for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value darkYellow for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme DARK_YELLOW = fromString("darkYellow"); - /** Static value unknownFutureValue for MicrosoftGraphScheduleEntityTheme. */ + /** + * Static value unknownFutureValue for MicrosoftGraphScheduleEntityTheme. + */ public static final MicrosoftGraphScheduleEntityTheme UNKNOWN_FUTURE_VALUE = fromString("unknownFutureValue"); /** * Creates a new instance of MicrosoftGraphScheduleEntityTheme value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -60,18 +87,17 @@ public MicrosoftGraphScheduleEntityTheme() { /** * Creates or finds a MicrosoftGraphScheduleEntityTheme from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphScheduleEntityTheme. */ - @JsonCreator public static MicrosoftGraphScheduleEntityTheme fromString(String name) { return fromString(name, MicrosoftGraphScheduleEntityTheme.class); } /** * Gets known MicrosoftGraphScheduleEntityTheme values. - * + * * @return known MicrosoftGraphScheduleEntityTheme values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleInformation.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleInformation.java index 777a745b6deec..ae528390637c2 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleInformation.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleInformation.java @@ -5,55 +5,55 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** scheduleInformation. */ +/** + * scheduleInformation. + */ @Fluent -public final class MicrosoftGraphScheduleInformation { +public final class MicrosoftGraphScheduleInformation implements JsonSerializable { /* * Represents a merged view of availability of all the items in scheduleItems. The view consists of time slots. * Availability during each time slot is indicated with: 0= free, 1= tentative, 2= busy, 3= out of office, 4= * working elsewhere. */ - @JsonProperty(value = "availabilityView") private String availabilityView; /* * freeBusyError */ - @JsonProperty(value = "error") private MicrosoftGraphFreeBusyError error; /* * An SMTP address of the user, distribution list, or resource, identifying an instance of scheduleInformation. */ - @JsonProperty(value = "scheduleId") private String scheduleId; /* * Contains the items that describe the availability of the user or resource. */ - @JsonProperty(value = "scheduleItems") private List scheduleItems; /* * workingHours */ - @JsonProperty(value = "workingHours") private MicrosoftGraphWorkingHours workingHours; /* * scheduleInformation */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphScheduleInformation class. */ + /** + * Creates an instance of MicrosoftGraphScheduleInformation class. + */ public MicrosoftGraphScheduleInformation() { } @@ -61,7 +61,7 @@ public MicrosoftGraphScheduleInformation() { * Get the availabilityView property: Represents a merged view of availability of all the items in scheduleItems. * The view consists of time slots. Availability during each time slot is indicated with: 0= free, 1= tentative, 2= * busy, 3= out of office, 4= working elsewhere. - * + * * @return the availabilityView value. */ public String availabilityView() { @@ -72,7 +72,7 @@ public String availabilityView() { * Set the availabilityView property: Represents a merged view of availability of all the items in scheduleItems. * The view consists of time slots. Availability during each time slot is indicated with: 0= free, 1= tentative, 2= * busy, 3= out of office, 4= working elsewhere. - * + * * @param availabilityView the availabilityView value to set. * @return the MicrosoftGraphScheduleInformation object itself. */ @@ -83,7 +83,7 @@ public MicrosoftGraphScheduleInformation withAvailabilityView(String availabilit /** * Get the error property: freeBusyError. - * + * * @return the error value. */ public MicrosoftGraphFreeBusyError error() { @@ -92,7 +92,7 @@ public MicrosoftGraphFreeBusyError error() { /** * Set the error property: freeBusyError. - * + * * @param error the error value to set. * @return the MicrosoftGraphScheduleInformation object itself. */ @@ -104,7 +104,7 @@ public MicrosoftGraphScheduleInformation withError(MicrosoftGraphFreeBusyError e /** * Get the scheduleId property: An SMTP address of the user, distribution list, or resource, identifying an instance * of scheduleInformation. - * + * * @return the scheduleId value. */ public String scheduleId() { @@ -114,7 +114,7 @@ public String scheduleId() { /** * Set the scheduleId property: An SMTP address of the user, distribution list, or resource, identifying an instance * of scheduleInformation. - * + * * @param scheduleId the scheduleId value to set. * @return the MicrosoftGraphScheduleInformation object itself. */ @@ -125,7 +125,7 @@ public MicrosoftGraphScheduleInformation withScheduleId(String scheduleId) { /** * Get the scheduleItems property: Contains the items that describe the availability of the user or resource. - * + * * @return the scheduleItems value. */ public List scheduleItems() { @@ -134,7 +134,7 @@ public List scheduleItems() { /** * Set the scheduleItems property: Contains the items that describe the availability of the user or resource. - * + * * @param scheduleItems the scheduleItems value to set. * @return the MicrosoftGraphScheduleInformation object itself. */ @@ -145,7 +145,7 @@ public MicrosoftGraphScheduleInformation withScheduleItems(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: scheduleInformation. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphScheduleInformation object itself. */ @@ -184,17 +183,9 @@ public MicrosoftGraphScheduleInformation withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -208,4 +199,67 @@ public void validate() { workingHours().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("availabilityView", this.availabilityView); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeStringField("scheduleId", this.scheduleId); + jsonWriter.writeArrayField("scheduleItems", this.scheduleItems, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("workingHours", this.workingHours); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphScheduleInformation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphScheduleInformation 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 MicrosoftGraphScheduleInformation. + */ + public static MicrosoftGraphScheduleInformation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphScheduleInformation deserializedMicrosoftGraphScheduleInformation + = new MicrosoftGraphScheduleInformation(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("availabilityView".equals(fieldName)) { + deserializedMicrosoftGraphScheduleInformation.availabilityView = reader.getString(); + } else if ("error".equals(fieldName)) { + deserializedMicrosoftGraphScheduleInformation.error = MicrosoftGraphFreeBusyError.fromJson(reader); + } else if ("scheduleId".equals(fieldName)) { + deserializedMicrosoftGraphScheduleInformation.scheduleId = reader.getString(); + } else if ("scheduleItems".equals(fieldName)) { + List scheduleItems + = reader.readArray(reader1 -> MicrosoftGraphScheduleItem.fromJson(reader1)); + deserializedMicrosoftGraphScheduleInformation.scheduleItems = scheduleItems; + } else if ("workingHours".equals(fieldName)) { + deserializedMicrosoftGraphScheduleInformation.workingHours + = MicrosoftGraphWorkingHours.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphScheduleInformation.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphScheduleInformation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleItem.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleItem.java index 9c77851ac8455..73b04d6e3cd3a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleItem.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScheduleItem.java @@ -5,64 +5,63 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** scheduleItem. */ +/** + * scheduleItem. + */ @Fluent -public final class MicrosoftGraphScheduleItem { +public final class MicrosoftGraphScheduleItem implements JsonSerializable { /* * dateTimeTimeZone */ - @JsonProperty(value = "end") private MicrosoftGraphDateTimeZone end; /* * The sensitivity of the corresponding event. True if the event is marked private, false otherwise. Optional. */ - @JsonProperty(value = "isPrivate") private Boolean isPrivate; /* * The location where the corresponding event is held or attended from. Optional. */ - @JsonProperty(value = "location") private String location; /* * dateTimeTimeZone */ - @JsonProperty(value = "start") private MicrosoftGraphDateTimeZone start; /* * freeBusyStatus */ - @JsonProperty(value = "status") private MicrosoftGraphFreeBusyStatus status; /* * The corresponding event's subject line. Optional. */ - @JsonProperty(value = "subject") private String subject; /* * scheduleItem */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphScheduleItem class. */ + /** + * Creates an instance of MicrosoftGraphScheduleItem class. + */ public MicrosoftGraphScheduleItem() { } /** * Get the end property: dateTimeTimeZone. - * + * * @return the end value. */ public MicrosoftGraphDateTimeZone end() { @@ -71,7 +70,7 @@ public MicrosoftGraphDateTimeZone end() { /** * Set the end property: dateTimeTimeZone. - * + * * @param end the end value to set. * @return the MicrosoftGraphScheduleItem object itself. */ @@ -83,7 +82,7 @@ public MicrosoftGraphScheduleItem withEnd(MicrosoftGraphDateTimeZone end) { /** * Get the isPrivate property: The sensitivity of the corresponding event. True if the event is marked private, * false otherwise. Optional. - * + * * @return the isPrivate value. */ public Boolean isPrivate() { @@ -93,7 +92,7 @@ public Boolean isPrivate() { /** * Set the isPrivate property: The sensitivity of the corresponding event. True if the event is marked private, * false otherwise. Optional. - * + * * @param isPrivate the isPrivate value to set. * @return the MicrosoftGraphScheduleItem object itself. */ @@ -104,7 +103,7 @@ public MicrosoftGraphScheduleItem withIsPrivate(Boolean isPrivate) { /** * Get the location property: The location where the corresponding event is held or attended from. Optional. - * + * * @return the location value. */ public String location() { @@ -113,7 +112,7 @@ public String location() { /** * Set the location property: The location where the corresponding event is held or attended from. Optional. - * + * * @param location the location value to set. * @return the MicrosoftGraphScheduleItem object itself. */ @@ -124,7 +123,7 @@ public MicrosoftGraphScheduleItem withLocation(String location) { /** * Get the start property: dateTimeTimeZone. - * + * * @return the start value. */ public MicrosoftGraphDateTimeZone start() { @@ -133,7 +132,7 @@ public MicrosoftGraphDateTimeZone start() { /** * Set the start property: dateTimeTimeZone. - * + * * @param start the start value to set. * @return the MicrosoftGraphScheduleItem object itself. */ @@ -144,7 +143,7 @@ public MicrosoftGraphScheduleItem withStart(MicrosoftGraphDateTimeZone start) { /** * Get the status property: freeBusyStatus. - * + * * @return the status value. */ public MicrosoftGraphFreeBusyStatus status() { @@ -153,7 +152,7 @@ public MicrosoftGraphFreeBusyStatus status() { /** * Set the status property: freeBusyStatus. - * + * * @param status the status value to set. * @return the MicrosoftGraphScheduleItem object itself. */ @@ -164,7 +163,7 @@ public MicrosoftGraphScheduleItem withStatus(MicrosoftGraphFreeBusyStatus status /** * Get the subject property: The corresponding event's subject line. Optional. - * + * * @return the subject value. */ public String subject() { @@ -173,7 +172,7 @@ public String subject() { /** * Set the subject property: The corresponding event's subject line. Optional. - * + * * @param subject the subject value to set. * @return the MicrosoftGraphScheduleItem object itself. */ @@ -184,17 +183,16 @@ public MicrosoftGraphScheduleItem withSubject(String subject) { /** * Get the additionalProperties property: scheduleItem. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: scheduleItem. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphScheduleItem object itself. */ @@ -203,17 +201,9 @@ public MicrosoftGraphScheduleItem withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -224,4 +214,67 @@ public void validate() { start().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("end", this.end); + jsonWriter.writeBooleanField("isPrivate", this.isPrivate); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("start", this.start); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("subject", this.subject); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphScheduleItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphScheduleItem 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 MicrosoftGraphScheduleItem. + */ + public static MicrosoftGraphScheduleItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphScheduleItem deserializedMicrosoftGraphScheduleItem = new MicrosoftGraphScheduleItem(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("end".equals(fieldName)) { + deserializedMicrosoftGraphScheduleItem.end = MicrosoftGraphDateTimeZone.fromJson(reader); + } else if ("isPrivate".equals(fieldName)) { + deserializedMicrosoftGraphScheduleItem.isPrivate = reader.getNullable(JsonReader::getBoolean); + } else if ("location".equals(fieldName)) { + deserializedMicrosoftGraphScheduleItem.location = reader.getString(); + } else if ("start".equals(fieldName)) { + deserializedMicrosoftGraphScheduleItem.start = MicrosoftGraphDateTimeZone.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedMicrosoftGraphScheduleItem.status + = MicrosoftGraphFreeBusyStatus.fromString(reader.getString()); + } else if ("subject".equals(fieldName)) { + deserializedMicrosoftGraphScheduleItem.subject = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphScheduleItem.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphScheduleItem; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSchedulingGroup.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSchedulingGroup.java index 3c8a2273018dd..7059a7c9983b8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSchedulingGroup.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSchedulingGroup.java @@ -5,49 +5,51 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** schedulingGroup. */ +/** + * schedulingGroup. + */ @Fluent public final class MicrosoftGraphSchedulingGroup extends MicrosoftGraphChangeTrackedEntity { /* * The display name for the schedulingGroup. Required. */ - @JsonProperty(value = "displayName") private String displayName; /* - * Indicates whether the schedulingGroup can be used when creating new entities or updating existing ones. - * Required. + * Indicates whether the schedulingGroup can be used when creating new entities or updating existing ones. Required. */ - @JsonProperty(value = "isActive") private Boolean isActive; /* * The list of user IDs that are a member of the schedulingGroup. Required. */ - @JsonProperty(value = "userIds") private List userIds; /* * schedulingGroup */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSchedulingGroup class. */ + /** + * Creates an instance of MicrosoftGraphSchedulingGroup class. + */ public MicrosoftGraphSchedulingGroup() { } /** * Get the displayName property: The display name for the schedulingGroup. Required. - * + * * @return the displayName value. */ public String displayName() { @@ -56,7 +58,7 @@ public String displayName() { /** * Set the displayName property: The display name for the schedulingGroup. Required. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphSchedulingGroup object itself. */ @@ -68,7 +70,7 @@ public MicrosoftGraphSchedulingGroup withDisplayName(String displayName) { /** * Get the isActive property: Indicates whether the schedulingGroup can be used when creating new entities or * updating existing ones. Required. - * + * * @return the isActive value. */ public Boolean isActive() { @@ -78,7 +80,7 @@ public Boolean isActive() { /** * Set the isActive property: Indicates whether the schedulingGroup can be used when creating new entities or * updating existing ones. Required. - * + * * @param isActive the isActive value to set. * @return the MicrosoftGraphSchedulingGroup object itself. */ @@ -89,7 +91,7 @@ public MicrosoftGraphSchedulingGroup withIsActive(Boolean isActive) { /** * Get the userIds property: The list of user IDs that are a member of the schedulingGroup. Required. - * + * * @return the userIds value. */ public List userIds() { @@ -98,7 +100,7 @@ public List userIds() { /** * Set the userIds property: The list of user IDs that are a member of the schedulingGroup. Required. - * + * * @param userIds the userIds value to set. * @return the MicrosoftGraphSchedulingGroup object itself. */ @@ -109,17 +111,16 @@ public MicrosoftGraphSchedulingGroup withUserIds(List userIds) { /** * Get the additionalProperties property: schedulingGroup. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: schedulingGroup. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSchedulingGroup object itself. */ @@ -128,36 +129,36 @@ public MicrosoftGraphSchedulingGroup withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSchedulingGroup withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSchedulingGroup withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSchedulingGroup withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSchedulingGroup withId(String id) { super.withId(id); @@ -166,11 +167,85 @@ public MicrosoftGraphSchedulingGroup withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeBooleanField("isActive", this.isActive); + jsonWriter.writeArrayField("userIds", this.userIds, (writer, element) -> writer.writeString(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSchedulingGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSchedulingGroup 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 MicrosoftGraphSchedulingGroup. + */ + public static MicrosoftGraphSchedulingGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSchedulingGroup deserializedMicrosoftGraphSchedulingGroup + = new MicrosoftGraphSchedulingGroup(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphSchedulingGroup.withId(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphSchedulingGroup.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphSchedulingGroup + .withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphSchedulingGroup.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphSchedulingGroup.displayName = reader.getString(); + } else if ("isActive".equals(fieldName)) { + deserializedMicrosoftGraphSchedulingGroup.isActive = reader.getNullable(JsonReader::getBoolean); + } else if ("userIds".equals(fieldName)) { + List userIds = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphSchedulingGroup.userIds = userIds; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSchedulingGroup.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSchedulingGroup; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScopedRoleMembership.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScopedRoleMembership.java index 2b341ee6fd18b..ced8565f993eb 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScopedRoleMembership.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScopedRoleMembership.java @@ -5,47 +5,48 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** scopedRoleMembership. */ +/** + * scopedRoleMembership. + */ @Fluent public final class MicrosoftGraphScopedRoleMembership extends MicrosoftGraphEntity { /* * Unique identifier for the administrative unit that the directory role is scoped to */ - @JsonProperty(value = "administrativeUnitId") private String administrativeUnitId; /* * Unique identifier for the directory role that the member is in. */ - @JsonProperty(value = "roleId") private String roleId; /* * identity */ - @JsonProperty(value = "roleMemberInfo") private MicrosoftGraphIdentity roleMemberInfo; /* * scopedRoleMembership */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphScopedRoleMembership class. */ + /** + * Creates an instance of MicrosoftGraphScopedRoleMembership class. + */ public MicrosoftGraphScopedRoleMembership() { } /** * Get the administrativeUnitId property: Unique identifier for the administrative unit that the directory role is * scoped to. - * + * * @return the administrativeUnitId value. */ public String administrativeUnitId() { @@ -55,7 +56,7 @@ public String administrativeUnitId() { /** * Set the administrativeUnitId property: Unique identifier for the administrative unit that the directory role is * scoped to. - * + * * @param administrativeUnitId the administrativeUnitId value to set. * @return the MicrosoftGraphScopedRoleMembership object itself. */ @@ -66,7 +67,7 @@ public MicrosoftGraphScopedRoleMembership withAdministrativeUnitId(String admini /** * Get the roleId property: Unique identifier for the directory role that the member is in. - * + * * @return the roleId value. */ public String roleId() { @@ -75,7 +76,7 @@ public String roleId() { /** * Set the roleId property: Unique identifier for the directory role that the member is in. - * + * * @param roleId the roleId value to set. * @return the MicrosoftGraphScopedRoleMembership object itself. */ @@ -86,7 +87,7 @@ public MicrosoftGraphScopedRoleMembership withRoleId(String roleId) { /** * Get the roleMemberInfo property: identity. - * + * * @return the roleMemberInfo value. */ public MicrosoftGraphIdentity roleMemberInfo() { @@ -95,7 +96,7 @@ public MicrosoftGraphIdentity roleMemberInfo() { /** * Set the roleMemberInfo property: identity. - * + * * @param roleMemberInfo the roleMemberInfo value to set. * @return the MicrosoftGraphScopedRoleMembership object itself. */ @@ -106,17 +107,16 @@ public MicrosoftGraphScopedRoleMembership withRoleMemberInfo(MicrosoftGraphIdent /** * Get the additionalProperties property: scopedRoleMembership. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: scopedRoleMembership. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphScopedRoleMembership object itself. */ @@ -125,15 +125,9 @@ public MicrosoftGraphScopedRoleMembership withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphScopedRoleMembership withId(String id) { super.withId(id); @@ -142,7 +136,7 @@ public MicrosoftGraphScopedRoleMembership withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -152,4 +146,62 @@ public void validate() { roleMemberInfo().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("administrativeUnitId", this.administrativeUnitId); + jsonWriter.writeStringField("roleId", this.roleId); + jsonWriter.writeJsonField("roleMemberInfo", this.roleMemberInfo); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphScopedRoleMembership from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphScopedRoleMembership 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 MicrosoftGraphScopedRoleMembership. + */ + public static MicrosoftGraphScopedRoleMembership fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphScopedRoleMembership deserializedMicrosoftGraphScopedRoleMembership + = new MicrosoftGraphScopedRoleMembership(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphScopedRoleMembership.withId(reader.getString()); + } else if ("administrativeUnitId".equals(fieldName)) { + deserializedMicrosoftGraphScopedRoleMembership.administrativeUnitId = reader.getString(); + } else if ("roleId".equals(fieldName)) { + deserializedMicrosoftGraphScopedRoleMembership.roleId = reader.getString(); + } else if ("roleMemberInfo".equals(fieldName)) { + deserializedMicrosoftGraphScopedRoleMembership.roleMemberInfo + = MicrosoftGraphIdentity.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphScopedRoleMembership.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphScopedRoleMembership; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScoredEmailAddress.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScoredEmailAddress.java index 30727a72eb6c8..ca14d6612d46a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScoredEmailAddress.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphScoredEmailAddress.java @@ -5,26 +5,27 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** scoredEmailAddress. */ +/** + * scoredEmailAddress. + */ @Fluent -public final class MicrosoftGraphScoredEmailAddress { +public final class MicrosoftGraphScoredEmailAddress implements JsonSerializable { /* * The email address. */ - @JsonProperty(value = "address") private String address; /* * The itemId property. */ - @JsonProperty(value = "itemId") private String itemId; /* @@ -32,27 +33,27 @@ public final class MicrosoftGraphScoredEmailAddress { * returned results. A higher relevance score value corresponds to a more relevant result. Relevance is determined * by the user’s communication and collaboration patterns and business relationships. */ - @JsonProperty(value = "relevanceScore") private Double relevanceScore; /* * selectionLikelihoodInfo */ - @JsonProperty(value = "selectionLikelihood") private MicrosoftGraphSelectionLikelihoodInfo selectionLikelihood; /* * scoredEmailAddress */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphScoredEmailAddress class. */ + /** + * Creates an instance of MicrosoftGraphScoredEmailAddress class. + */ public MicrosoftGraphScoredEmailAddress() { } /** * Get the address property: The email address. - * + * * @return the address value. */ public String address() { @@ -61,7 +62,7 @@ public String address() { /** * Set the address property: The email address. - * + * * @param address the address value to set. * @return the MicrosoftGraphScoredEmailAddress object itself. */ @@ -72,7 +73,7 @@ public MicrosoftGraphScoredEmailAddress withAddress(String address) { /** * Get the itemId property: The itemId property. - * + * * @return the itemId value. */ public String itemId() { @@ -81,7 +82,7 @@ public String itemId() { /** * Set the itemId property: The itemId property. - * + * * @param itemId the itemId value to set. * @return the MicrosoftGraphScoredEmailAddress object itself. */ @@ -95,7 +96,7 @@ public MicrosoftGraphScoredEmailAddress withItemId(String itemId) { * key, in relation to the other returned results. A higher relevance score value corresponds to a more relevant * result. Relevance is determined by the user’s communication and collaboration patterns and business * relationships. - * + * * @return the relevanceScore value. */ public Double relevanceScore() { @@ -107,7 +108,7 @@ public Double relevanceScore() { * key, in relation to the other returned results. A higher relevance score value corresponds to a more relevant * result. Relevance is determined by the user’s communication and collaboration patterns and business * relationships. - * + * * @param relevanceScore the relevanceScore value to set. * @return the MicrosoftGraphScoredEmailAddress object itself. */ @@ -118,7 +119,7 @@ public MicrosoftGraphScoredEmailAddress withRelevanceScore(Double relevanceScore /** * Get the selectionLikelihood property: selectionLikelihoodInfo. - * + * * @return the selectionLikelihood value. */ public MicrosoftGraphSelectionLikelihoodInfo selectionLikelihood() { @@ -127,29 +128,28 @@ public MicrosoftGraphSelectionLikelihoodInfo selectionLikelihood() { /** * Set the selectionLikelihood property: selectionLikelihoodInfo. - * + * * @param selectionLikelihood the selectionLikelihood value to set. * @return the MicrosoftGraphScoredEmailAddress object itself. */ - public MicrosoftGraphScoredEmailAddress withSelectionLikelihood( - MicrosoftGraphSelectionLikelihoodInfo selectionLikelihood) { + public MicrosoftGraphScoredEmailAddress + withSelectionLikelihood(MicrosoftGraphSelectionLikelihoodInfo selectionLikelihood) { this.selectionLikelihood = selectionLikelihood; return this; } /** * Get the additionalProperties property: scoredEmailAddress. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: scoredEmailAddress. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphScoredEmailAddress object itself. */ @@ -158,19 +158,71 @@ public MicrosoftGraphScoredEmailAddress withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("address", this.address); + jsonWriter.writeStringField("itemId", this.itemId); + jsonWriter.writeNumberField("relevanceScore", this.relevanceScore); + jsonWriter.writeStringField("selectionLikelihood", + this.selectionLikelihood == null ? null : this.selectionLikelihood.toString()); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphScoredEmailAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphScoredEmailAddress 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 MicrosoftGraphScoredEmailAddress. + */ + public static MicrosoftGraphScoredEmailAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphScoredEmailAddress deserializedMicrosoftGraphScoredEmailAddress + = new MicrosoftGraphScoredEmailAddress(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("address".equals(fieldName)) { + deserializedMicrosoftGraphScoredEmailAddress.address = reader.getString(); + } else if ("itemId".equals(fieldName)) { + deserializedMicrosoftGraphScoredEmailAddress.itemId = reader.getString(); + } else if ("relevanceScore".equals(fieldName)) { + deserializedMicrosoftGraphScoredEmailAddress.relevanceScore + = reader.getNullable(JsonReader::getDouble); + } else if ("selectionLikelihood".equals(fieldName)) { + deserializedMicrosoftGraphScoredEmailAddress.selectionLikelihood + = MicrosoftGraphSelectionLikelihoodInfo.fromString(reader.getString()); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphScoredEmailAddress.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphScoredEmailAddress; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSearchResult.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSearchResult.java index 57bfb63073feb..292c0ab1191d5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSearchResult.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSearchResult.java @@ -5,29 +5,33 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** searchResult. */ +/** + * searchResult. + */ @Fluent -public final class MicrosoftGraphSearchResult { +public final class MicrosoftGraphSearchResult implements JsonSerializable { /* * A callback URL that can be used to record telemetry information. The application should issue a GET on this URL * if the user interacts with this item to improve the quality of results. */ - @JsonProperty(value = "onClickTelemetryUrl") private String onClickTelemetryUrl; /* * searchResult */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSearchResult class. */ + /** + * Creates an instance of MicrosoftGraphSearchResult class. + */ public MicrosoftGraphSearchResult() { } @@ -35,7 +39,7 @@ public MicrosoftGraphSearchResult() { * Get the onClickTelemetryUrl property: A callback URL that can be used to record telemetry information. The * application should issue a GET on this URL if the user interacts with this item to improve the quality of * results. - * + * * @return the onClickTelemetryUrl value. */ public String onClickTelemetryUrl() { @@ -46,7 +50,7 @@ public String onClickTelemetryUrl() { * Set the onClickTelemetryUrl property: A callback URL that can be used to record telemetry information. The * application should issue a GET on this URL if the user interacts with this item to improve the quality of * results. - * + * * @param onClickTelemetryUrl the onClickTelemetryUrl value to set. * @return the MicrosoftGraphSearchResult object itself. */ @@ -57,17 +61,16 @@ public MicrosoftGraphSearchResult withOnClickTelemetryUrl(String onClickTelemetr /** * Get the additionalProperties property: searchResult. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: searchResult. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSearchResult object itself. */ @@ -76,19 +79,58 @@ public MicrosoftGraphSearchResult withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("onClickTelemetryUrl", this.onClickTelemetryUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSearchResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSearchResult 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 MicrosoftGraphSearchResult. + */ + public static MicrosoftGraphSearchResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSearchResult deserializedMicrosoftGraphSearchResult = new MicrosoftGraphSearchResult(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("onClickTelemetryUrl".equals(fieldName)) { + deserializedMicrosoftGraphSearchResult.onClickTelemetryUrl = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSearchResult.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSearchResult; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSectionGroup.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSectionGroup.java index 3e20e0a3fd723..391123dd284a8 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSectionGroup.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSectionGroup.java @@ -5,68 +5,68 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** sectionGroup. */ +/** + * sectionGroup. + */ @Fluent public final class MicrosoftGraphSectionGroup extends MicrosoftGraphOnenoteEntityHierarchyModel { /* * The URL for the sectionGroups navigation property, which returns all the section groups in the section group. * Read-only. */ - @JsonProperty(value = "sectionGroupsUrl") private String sectionGroupsUrl; /* * The URL for the sections navigation property, which returns all the sections in the section group. Read-only. */ - @JsonProperty(value = "sectionsUrl") private String sectionsUrl; /* * notebook */ - @JsonProperty(value = "parentNotebook") private MicrosoftGraphNotebook parentNotebook; /* * sectionGroup */ - @JsonProperty(value = "parentSectionGroup") private MicrosoftGraphSectionGroup parentSectionGroup; /* * The section groups in the section. Read-only. Nullable. */ - @JsonProperty(value = "sectionGroups") private List sectionGroups; /* * The sections in the section group. Read-only. Nullable. */ - @JsonProperty(value = "sections") private List sections; /* * sectionGroup */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSectionGroup class. */ + /** + * Creates an instance of MicrosoftGraphSectionGroup class. + */ public MicrosoftGraphSectionGroup() { } /** * Get the sectionGroupsUrl property: The URL for the sectionGroups navigation property, which returns all the * section groups in the section group. Read-only. - * + * * @return the sectionGroupsUrl value. */ public String sectionGroupsUrl() { @@ -76,7 +76,7 @@ public String sectionGroupsUrl() { /** * Set the sectionGroupsUrl property: The URL for the sectionGroups navigation property, which returns all the * section groups in the section group. Read-only. - * + * * @param sectionGroupsUrl the sectionGroupsUrl value to set. * @return the MicrosoftGraphSectionGroup object itself. */ @@ -88,7 +88,7 @@ public MicrosoftGraphSectionGroup withSectionGroupsUrl(String sectionGroupsUrl) /** * Get the sectionsUrl property: The URL for the sections navigation property, which returns all the sections in the * section group. Read-only. - * + * * @return the sectionsUrl value. */ public String sectionsUrl() { @@ -98,7 +98,7 @@ public String sectionsUrl() { /** * Set the sectionsUrl property: The URL for the sections navigation property, which returns all the sections in the * section group. Read-only. - * + * * @param sectionsUrl the sectionsUrl value to set. * @return the MicrosoftGraphSectionGroup object itself. */ @@ -109,7 +109,7 @@ public MicrosoftGraphSectionGroup withSectionsUrl(String sectionsUrl) { /** * Get the parentNotebook property: notebook. - * + * * @return the parentNotebook value. */ public MicrosoftGraphNotebook parentNotebook() { @@ -118,7 +118,7 @@ public MicrosoftGraphNotebook parentNotebook() { /** * Set the parentNotebook property: notebook. - * + * * @param parentNotebook the parentNotebook value to set. * @return the MicrosoftGraphSectionGroup object itself. */ @@ -129,7 +129,7 @@ public MicrosoftGraphSectionGroup withParentNotebook(MicrosoftGraphNotebook pare /** * Get the parentSectionGroup property: sectionGroup. - * + * * @return the parentSectionGroup value. */ public MicrosoftGraphSectionGroup parentSectionGroup() { @@ -138,7 +138,7 @@ public MicrosoftGraphSectionGroup parentSectionGroup() { /** * Set the parentSectionGroup property: sectionGroup. - * + * * @param parentSectionGroup the parentSectionGroup value to set. * @return the MicrosoftGraphSectionGroup object itself. */ @@ -149,7 +149,7 @@ public MicrosoftGraphSectionGroup withParentSectionGroup(MicrosoftGraphSectionGr /** * Get the sectionGroups property: The section groups in the section. Read-only. Nullable. - * + * * @return the sectionGroups value. */ public List sectionGroups() { @@ -158,7 +158,7 @@ public List sectionGroups() { /** * Set the sectionGroups property: The section groups in the section. Read-only. Nullable. - * + * * @param sectionGroups the sectionGroups value to set. * @return the MicrosoftGraphSectionGroup object itself. */ @@ -169,7 +169,7 @@ public MicrosoftGraphSectionGroup withSectionGroups(List sections() { @@ -178,7 +178,7 @@ public List sections() { /** * Set the sections property: The sections in the section group. Read-only. Nullable. - * + * * @param sections the sections value to set. * @return the MicrosoftGraphSectionGroup object itself. */ @@ -189,17 +189,16 @@ public MicrosoftGraphSectionGroup withSections(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: sectionGroup. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSectionGroup object itself. */ @@ -208,57 +207,63 @@ public MicrosoftGraphSectionGroup withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSectionGroup withCreatedBy(MicrosoftGraphIdentitySet createdBy) { super.withCreatedBy(createdBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSectionGroup withDisplayName(String displayName) { super.withDisplayName(displayName); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSectionGroup withLastModifiedBy(MicrosoftGraphIdentitySet lastModifiedBy) { super.withLastModifiedBy(lastModifiedBy); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSectionGroup withLastModifiedDateTime(OffsetDateTime lastModifiedDateTime) { super.withLastModifiedDateTime(lastModifiedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSectionGroup withCreatedDateTime(OffsetDateTime createdDateTime) { super.withCreatedDateTime(createdDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSectionGroup withSelf(String self) { super.withSelf(self); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSectionGroup withId(String id) { super.withId(id); @@ -267,7 +272,7 @@ public MicrosoftGraphSectionGroup withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -286,4 +291,99 @@ public void validate() { sections().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("self", self()); + jsonWriter.writeStringField("createdDateTime", + createdDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(createdDateTime())); + jsonWriter.writeJsonField("createdBy", createdBy()); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeJsonField("lastModifiedBy", lastModifiedBy()); + jsonWriter.writeStringField("lastModifiedDateTime", + lastModifiedDateTime() == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastModifiedDateTime())); + jsonWriter.writeStringField("sectionGroupsUrl", this.sectionGroupsUrl); + jsonWriter.writeStringField("sectionsUrl", this.sectionsUrl); + jsonWriter.writeJsonField("parentNotebook", this.parentNotebook); + jsonWriter.writeJsonField("parentSectionGroup", this.parentSectionGroup); + jsonWriter.writeArrayField("sectionGroups", this.sectionGroups, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sections", this.sections, (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSectionGroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSectionGroup 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 MicrosoftGraphSectionGroup. + */ + public static MicrosoftGraphSectionGroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSectionGroup deserializedMicrosoftGraphSectionGroup = new MicrosoftGraphSectionGroup(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup.withId(reader.getString()); + } else if ("self".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup.withSelf(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup.withCreatedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("createdBy".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup.withCreatedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup.withDisplayName(reader.getString()); + } else if ("lastModifiedBy".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup + .withLastModifiedBy(MicrosoftGraphIdentitySet.fromJson(reader)); + } else if ("lastModifiedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup.withLastModifiedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("sectionGroupsUrl".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup.sectionGroupsUrl = reader.getString(); + } else if ("sectionsUrl".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup.sectionsUrl = reader.getString(); + } else if ("parentNotebook".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup.parentNotebook = MicrosoftGraphNotebook.fromJson(reader); + } else if ("parentSectionGroup".equals(fieldName)) { + deserializedMicrosoftGraphSectionGroup.parentSectionGroup + = MicrosoftGraphSectionGroup.fromJson(reader); + } else if ("sectionGroups".equals(fieldName)) { + List sectionGroups + = reader.readArray(reader1 -> MicrosoftGraphSectionGroup.fromJson(reader1)); + deserializedMicrosoftGraphSectionGroup.sectionGroups = sectionGroups; + } else if ("sections".equals(fieldName)) { + List sections + = reader.readArray(reader1 -> MicrosoftGraphOnenoteSection.fromJson(reader1)); + deserializedMicrosoftGraphSectionGroup.sections = sections; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSectionGroup.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSectionGroup; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSectionLinks.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSectionLinks.java index 34d2ace598690..b8b3ed9b9cc85 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSectionLinks.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSectionLinks.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** sectionLinks. */ +/** + * sectionLinks. + */ @Fluent -public final class MicrosoftGraphSectionLinks { +public final class MicrosoftGraphSectionLinks implements JsonSerializable { /* * externalLink */ - @JsonProperty(value = "oneNoteClientUrl") private MicrosoftGraphExternalLink oneNoteClientUrl; /* * externalLink */ - @JsonProperty(value = "oneNoteWebUrl") private MicrosoftGraphExternalLink oneNoteWebUrl; /* * sectionLinks */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSectionLinks class. */ + /** + * Creates an instance of MicrosoftGraphSectionLinks class. + */ public MicrosoftGraphSectionLinks() { } /** * Get the oneNoteClientUrl property: externalLink. - * + * * @return the oneNoteClientUrl value. */ public MicrosoftGraphExternalLink oneNoteClientUrl() { @@ -47,7 +50,7 @@ public MicrosoftGraphExternalLink oneNoteClientUrl() { /** * Set the oneNoteClientUrl property: externalLink. - * + * * @param oneNoteClientUrl the oneNoteClientUrl value to set. * @return the MicrosoftGraphSectionLinks object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphSectionLinks withOneNoteClientUrl(MicrosoftGraphExternalLin /** * Get the oneNoteWebUrl property: externalLink. - * + * * @return the oneNoteWebUrl value. */ public MicrosoftGraphExternalLink oneNoteWebUrl() { @@ -67,7 +70,7 @@ public MicrosoftGraphExternalLink oneNoteWebUrl() { /** * Set the oneNoteWebUrl property: externalLink. - * + * * @param oneNoteWebUrl the oneNoteWebUrl value to set. * @return the MicrosoftGraphSectionLinks object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphSectionLinks withOneNoteWebUrl(MicrosoftGraphExternalLink o /** * Get the additionalProperties property: sectionLinks. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: sectionLinks. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSectionLinks object itself. */ @@ -97,17 +99,9 @@ public MicrosoftGraphSectionLinks withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -118,4 +112,55 @@ public void validate() { oneNoteWebUrl().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("oneNoteClientUrl", this.oneNoteClientUrl); + jsonWriter.writeJsonField("oneNoteWebUrl", this.oneNoteWebUrl); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSectionLinks from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSectionLinks 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 MicrosoftGraphSectionLinks. + */ + public static MicrosoftGraphSectionLinks fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSectionLinks deserializedMicrosoftGraphSectionLinks = new MicrosoftGraphSectionLinks(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("oneNoteClientUrl".equals(fieldName)) { + deserializedMicrosoftGraphSectionLinks.oneNoteClientUrl + = MicrosoftGraphExternalLink.fromJson(reader); + } else if ("oneNoteWebUrl".equals(fieldName)) { + deserializedMicrosoftGraphSectionLinks.oneNoteWebUrl = MicrosoftGraphExternalLink.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSectionLinks.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSectionLinks; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSelectionLikelihoodInfo.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSelectionLikelihoodInfo.java index 7749e0cff2869..5732f95f09752 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSelectionLikelihoodInfo.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSelectionLikelihoodInfo.java @@ -5,21 +5,26 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** selectionLikelihoodInfo. */ +/** + * selectionLikelihoodInfo. + */ public final class MicrosoftGraphSelectionLikelihoodInfo extends ExpandableStringEnum { - /** Static value notSpecified for MicrosoftGraphSelectionLikelihoodInfo. */ + /** + * Static value notSpecified for MicrosoftGraphSelectionLikelihoodInfo. + */ public static final MicrosoftGraphSelectionLikelihoodInfo NOT_SPECIFIED = fromString("notSpecified"); - /** Static value high for MicrosoftGraphSelectionLikelihoodInfo. */ + /** + * Static value high for MicrosoftGraphSelectionLikelihoodInfo. + */ public static final MicrosoftGraphSelectionLikelihoodInfo HIGH = fromString("high"); /** * Creates a new instance of MicrosoftGraphSelectionLikelihoodInfo value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -28,18 +33,17 @@ public MicrosoftGraphSelectionLikelihoodInfo() { /** * Creates or finds a MicrosoftGraphSelectionLikelihoodInfo from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphSelectionLikelihoodInfo. */ - @JsonCreator public static MicrosoftGraphSelectionLikelihoodInfo fromString(String name) { return fromString(name, MicrosoftGraphSelectionLikelihoodInfo.class); } /** * Gets known MicrosoftGraphSelectionLikelihoodInfo values. - * + * * @return known MicrosoftGraphSelectionLikelihoodInfo values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSensitivity.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSensitivity.java index 8159120fcf8bb..a56c8e95e0c41 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSensitivity.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSensitivity.java @@ -5,26 +5,35 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** sensitivity. */ +/** + * sensitivity. + */ public final class MicrosoftGraphSensitivity extends ExpandableStringEnum { - /** Static value normal for MicrosoftGraphSensitivity. */ + /** + * Static value normal for MicrosoftGraphSensitivity. + */ public static final MicrosoftGraphSensitivity NORMAL = fromString("normal"); - /** Static value personal for MicrosoftGraphSensitivity. */ + /** + * Static value personal for MicrosoftGraphSensitivity. + */ public static final MicrosoftGraphSensitivity PERSONAL = fromString("personal"); - /** Static value private for MicrosoftGraphSensitivity. */ + /** + * Static value private for MicrosoftGraphSensitivity. + */ public static final MicrosoftGraphSensitivity PRIVATE = fromString("private"); - /** Static value confidential for MicrosoftGraphSensitivity. */ + /** + * Static value confidential for MicrosoftGraphSensitivity. + */ public static final MicrosoftGraphSensitivity CONFIDENTIAL = fromString("confidential"); /** * Creates a new instance of MicrosoftGraphSensitivity value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,18 +42,17 @@ public MicrosoftGraphSensitivity() { /** * Creates or finds a MicrosoftGraphSensitivity from its string representation. - * + * * @param name a name to look for. * @return the corresponding MicrosoftGraphSensitivity. */ - @JsonCreator public static MicrosoftGraphSensitivity fromString(String name) { return fromString(name, MicrosoftGraphSensitivity.class); } /** * Gets known MicrosoftGraphSensitivity values. - * + * * @return known MicrosoftGraphSensitivity values. */ public static Collection values() { diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphServicePlanInfo.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphServicePlanInfo.java index c828a18fd35d1..26b3d1d5123b9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphServicePlanInfo.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphServicePlanInfo.java @@ -5,22 +5,25 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.UUID; -/** servicePlanInfo. */ +/** + * servicePlanInfo. + */ @Fluent -public final class MicrosoftGraphServicePlanInfo { +public final class MicrosoftGraphServicePlanInfo implements JsonSerializable { /* * The object the service plan can be assigned to. Possible values:'User' - service plan can be assigned to * individual users.'Company' - service plan can be assigned to the entire tenant. */ - @JsonProperty(value = "appliesTo") private String appliesTo; /* @@ -30,34 +33,33 @@ public final class MicrosoftGraphServicePlanInfo { * example, Intune_O365 service plan)'PendingProvisioning' - Microsoft has added a new service to the product SKU * and it has not been activated in the tenant, yet. */ - @JsonProperty(value = "provisioningStatus") private String provisioningStatus; /* * The unique identifier of the service plan. */ - @JsonProperty(value = "servicePlanId") private UUID servicePlanId; /* * The name of the service plan. */ - @JsonProperty(value = "servicePlanName") private String servicePlanName; /* * servicePlanInfo */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphServicePlanInfo class. */ + /** + * Creates an instance of MicrosoftGraphServicePlanInfo class. + */ public MicrosoftGraphServicePlanInfo() { } /** * Get the appliesTo property: The object the service plan can be assigned to. Possible values:'User' - service plan * can be assigned to individual users.'Company' - service plan can be assigned to the entire tenant. - * + * * @return the appliesTo value. */ public String appliesTo() { @@ -67,7 +69,7 @@ public String appliesTo() { /** * Set the appliesTo property: The object the service plan can be assigned to. Possible values:'User' - service plan * can be assigned to individual users.'Company' - service plan can be assigned to the entire tenant. - * + * * @param appliesTo the appliesTo value to set. * @return the MicrosoftGraphServicePlanInfo object itself. */ @@ -82,7 +84,7 @@ public MicrosoftGraphServicePlanInfo withAppliesTo(String appliesTo) { * provisioned; awaiting service confirmation.'PendingActivation' - Service is provisioned but requires explicit * activation by administrator (for example, Intune_O365 service plan)'PendingProvisioning' - Microsoft has added a * new service to the product SKU and it has not been activated in the tenant, yet. - * + * * @return the provisioningStatus value. */ public String provisioningStatus() { @@ -95,7 +97,7 @@ public String provisioningStatus() { * provisioned; awaiting service confirmation.'PendingActivation' - Service is provisioned but requires explicit * activation by administrator (for example, Intune_O365 service plan)'PendingProvisioning' - Microsoft has added a * new service to the product SKU and it has not been activated in the tenant, yet. - * + * * @param provisioningStatus the provisioningStatus value to set. * @return the MicrosoftGraphServicePlanInfo object itself. */ @@ -106,7 +108,7 @@ public MicrosoftGraphServicePlanInfo withProvisioningStatus(String provisioningS /** * Get the servicePlanId property: The unique identifier of the service plan. - * + * * @return the servicePlanId value. */ public UUID servicePlanId() { @@ -115,7 +117,7 @@ public UUID servicePlanId() { /** * Set the servicePlanId property: The unique identifier of the service plan. - * + * * @param servicePlanId the servicePlanId value to set. * @return the MicrosoftGraphServicePlanInfo object itself. */ @@ -126,7 +128,7 @@ public MicrosoftGraphServicePlanInfo withServicePlanId(UUID servicePlanId) { /** * Get the servicePlanName property: The name of the service plan. - * + * * @return the servicePlanName value. */ public String servicePlanName() { @@ -135,7 +137,7 @@ public String servicePlanName() { /** * Set the servicePlanName property: The name of the service plan. - * + * * @param servicePlanName the servicePlanName value to set. * @return the MicrosoftGraphServicePlanInfo object itself. */ @@ -146,17 +148,16 @@ public MicrosoftGraphServicePlanInfo withServicePlanName(String servicePlanName) /** * Get the additionalProperties property: servicePlanInfo. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: servicePlanInfo. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphServicePlanInfo object itself. */ @@ -165,19 +166,69 @@ public MicrosoftGraphServicePlanInfo withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appliesTo", this.appliesTo); + jsonWriter.writeStringField("provisioningStatus", this.provisioningStatus); + jsonWriter.writeStringField("servicePlanId", Objects.toString(this.servicePlanId, null)); + jsonWriter.writeStringField("servicePlanName", this.servicePlanName); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphServicePlanInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphServicePlanInfo 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 MicrosoftGraphServicePlanInfo. + */ + public static MicrosoftGraphServicePlanInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphServicePlanInfo deserializedMicrosoftGraphServicePlanInfo + = new MicrosoftGraphServicePlanInfo(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appliesTo".equals(fieldName)) { + deserializedMicrosoftGraphServicePlanInfo.appliesTo = reader.getString(); + } else if ("provisioningStatus".equals(fieldName)) { + deserializedMicrosoftGraphServicePlanInfo.provisioningStatus = reader.getString(); + } else if ("servicePlanId".equals(fieldName)) { + deserializedMicrosoftGraphServicePlanInfo.servicePlanId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("servicePlanName".equals(fieldName)) { + deserializedMicrosoftGraphServicePlanInfo.servicePlanName = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphServicePlanInfo.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphServicePlanInfo; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphServicePrincipalInner.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphServicePrincipalInner.java index 246469e2f31f4..4b47dae792eef 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphServicePrincipalInner.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphServicePrincipalInner.java @@ -5,20 +5,23 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; /** * servicePrincipal - * - *

Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory + * + * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ @Fluent @@ -26,7 +29,6 @@ public final class MicrosoftGraphServicePrincipalInner extends MicrosoftGraphDir /* * true if the service principal account is enabled; otherwise, false. */ - @JsonProperty(value = "accountEnabled") private Boolean accountEnabled; /* @@ -34,89 +36,75 @@ public final class MicrosoftGraphServicePrincipalInner extends MicrosoftGraphDir * applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This * will let services like Microsoft 365 call the application in the context of a document the user is working on. */ - @JsonProperty(value = "addIns") private List addIns; /* * Used to retrieve service principals by subscription, identify resource group and full resource ids for managed * identities. */ - @JsonProperty(value = "alternativeNames") private List alternativeNames; /* * The appDescription property. */ - @JsonProperty(value = "appDescription") private String appDescription; /* * The display name exposed by the associated application. */ - @JsonProperty(value = "appDisplayName") private String appDisplayName; /* * The unique identifier for the associated application (its appId property). */ - @JsonProperty(value = "appId") private String appId; /* * Unique identifier of the applicationTemplate that the servicePrincipal was created from. Read-only. */ - @JsonProperty(value = "applicationTemplateId") private String applicationTemplateId; /* * Contains the tenant id where the application is registered. This is applicable only to service principals backed * by applications. */ - @JsonProperty(value = "appOwnerOrganizationId") private UUID appOwnerOrganizationId; /* * Specifies whether users or other service principals need to be granted an app role assignment for this service * principal before users can sign in or apps can get tokens. The default value is false. Not nullable. */ - @JsonProperty(value = "appRoleAssignmentRequired") private Boolean appRoleAssignmentRequired; /* * The roles exposed by the application which this service principal represents. For more information see the * appRoles property definition on the application entity. Not nullable. */ - @JsonProperty(value = "appRoles") private List appRoles; /* * The description property. */ - @JsonProperty(value = "description") private String description; /* * The display name for the service principal. */ - @JsonProperty(value = "displayName") private String displayName; /* * Home page or landing page of the application. */ - @JsonProperty(value = "homepage") private String homepage; /* * informationalUrl */ - @JsonProperty(value = "info") private MicrosoftGraphInformationalUrl info; /* * The collection of key credentials associated with the service principal. Not nullable. */ - @JsonProperty(value = "keyCredentials") private List keyCredentials; /* @@ -125,41 +113,35 @@ public final class MicrosoftGraphServicePrincipalInner extends MicrosoftGraphDir * IdP-initiated sign-on for applications configured with SAML-based single sign-on. The user launches the * application from Microsoft 365, the Azure AD My Apps, or the Azure AD SSO URL. */ - @JsonProperty(value = "loginUrl") private String loginUrl; /* * Specifies the URL that will be used by Microsoft's authorization service to logout an user using OpenId Connect * front-channel, back-channel or SAML logout protocols. */ - @JsonProperty(value = "logoutUrl") private String logoutUrl; /* * The notes property. */ - @JsonProperty(value = "notes") private String notes; /* - * Specifies the list of email addresses where Azure AD sends a notification when the active certificate is near - * the expiration date. This is only for the certificates used to sign the SAML token issued for Azure AD Gallery + * Specifies the list of email addresses where Azure AD sends a notification when the active certificate is near the + * expiration date. This is only for the certificates used to sign the SAML token issued for Azure AD Gallery * applications. */ - @JsonProperty(value = "notificationEmailAddresses") private List notificationEmailAddresses; /* * The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes * property on the application entity's api property. Not nullable. */ - @JsonProperty(value = "oauth2PermissionScopes") private List oauth2PermissionScopes; /* * The collection of password credentials associated with the service principal. Not nullable. */ - @JsonProperty(value = "passwordCredentials") private List passwordCredentials; /* @@ -167,36 +149,31 @@ public final class MicrosoftGraphServicePrincipalInner extends MicrosoftGraphDir * mode to launch the application from Microsoft 365 or the Azure AD My Apps. The supported values are password, * saml, external, and oidc. */ - @JsonProperty(value = "preferredSingleSignOnMode") private String preferredSingleSignOnMode; /* * The preferredTokenSigningKeyThumbprint property. */ - @JsonProperty(value = "preferredTokenSigningKeyThumbprint") private String preferredTokenSigningKeyThumbprint; /* * The URLs that user tokens are sent to for sign in with the associated application, or the redirect URIs that * OAuth 2.0 authorization codes and access tokens are sent to for the associated application. Not nullable. */ - @JsonProperty(value = "replyUrls") private List replyUrls; /* * samlSingleSignOnSettings */ - @JsonProperty(value = "samlSingleSignOnSettings") private MicrosoftGraphSamlSingleSignOnSettings samlSingleSignOnSettings; /* - * Contains the list of identifiersUris, copied over from the associated application. Additional values can be - * added to hybrid applications. These values can be used to identify the permissions exposed by this app within - * Azure AD. For example,Client apps can specify a resource URI which is based on the values of this property to - * acquire an access token, which is the URI returned in the 'aud' claim.The any operator is required for filter - * expressions on multi-valued properties. Not nullable. + * Contains the list of identifiersUris, copied over from the associated application. Additional values can be added + * to hybrid applications. These values can be used to identify the permissions exposed by this app within Azure AD. + * For example,Client apps can specify a resource URI which is based on the values of this property to acquire an + * access token, which is the URI returned in the 'aud' claim.The any operator is required for filter expressions on + * multi-valued properties. Not nullable. */ - @JsonProperty(value = "servicePrincipalNames") private List servicePrincipalNames; /* @@ -204,19 +181,16 @@ public final class MicrosoftGraphServicePrincipalInner extends MicrosoftGraphDir * internally. For a service principal that represents an application this is set as Application. For a service * principal that represent a managed identity this is set as ManagedIdentity. */ - @JsonProperty(value = "servicePrincipalType") private String servicePrincipalType; /* * The signInAudience property. */ - @JsonProperty(value = "signInAudience") private String signInAudience; /* * Custom strings that can be used to categorize and identify the service principal. Not nullable. */ - @JsonProperty(value = "tags") private List tags; /* @@ -225,109 +199,96 @@ public final class MicrosoftGraphServicePrincipalInner extends MicrosoftGraphDir * encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in * user. */ - @JsonProperty(value = "tokenEncryptionKeyId") private UUID tokenEncryptionKeyId; /* * Principals (users, groups, and service principals) that are assigned to this service principal. Read-only. */ - @JsonProperty(value = "appRoleAssignedTo") private List appRoleAssignedTo; /* * Applications that this service principal is assigned to. Read-only. Nullable. */ - @JsonProperty(value = "appRoleAssignments") private List appRoleAssignments; /* * The claimsMappingPolicies assigned to this service principal. */ - @JsonProperty(value = "claimsMappingPolicies") private List claimsMappingPolicies; /* * Directory objects created by this service principal. Read-only. Nullable. */ - @JsonProperty(value = "createdObjects") private List createdObjects; /* * The delegatedPermissionClassifications property. */ - @JsonProperty(value = "delegatedPermissionClassifications") private List delegatedPermissionClassifications; /* * Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific * SharePoint endpoints that other applications can discover and use in their experiences. */ - @JsonProperty(value = "endpoints") private List endpoints; /* * The homeRealmDiscoveryPolicies assigned to this service principal. */ - @JsonProperty(value = "homeRealmDiscoveryPolicies") private List homeRealmDiscoveryPolicies; /* * Roles that this service principal is a member of. HTTP Methods: GET Read-only. Nullable. */ - @JsonProperty(value = "memberOf") private List memberOf; /* * Delegated permission grants authorizing this service principal to access an API on behalf of a signed-in user. * Read-only. Nullable. */ - @JsonProperty(value = "oauth2PermissionGrants") private List oauth2PermissionGrants; /* * Directory objects that are owned by this service principal. Read-only. Nullable. */ - @JsonProperty(value = "ownedObjects") private List ownedObjects; /* * Directory objects that are owners of this servicePrincipal. The owners are a set of non-admin users or * servicePrincipals who are allowed to modify this object. Read-only. Nullable. */ - @JsonProperty(value = "owners") private List owners; /* * The tokenIssuancePolicies assigned to this service principal. */ - @JsonProperty(value = "tokenIssuancePolicies") private List tokenIssuancePolicies; /* * The tokenLifetimePolicies assigned to this service principal. */ - @JsonProperty(value = "tokenLifetimePolicies") private List tokenLifetimePolicies; /* * The transitiveMemberOf property. */ - @JsonProperty(value = "transitiveMemberOf") private List transitiveMemberOf; /* * Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory * entity types. */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphServicePrincipalInner class. */ + /** + * Creates an instance of MicrosoftGraphServicePrincipalInner class. + */ public MicrosoftGraphServicePrincipalInner() { } /** * Get the accountEnabled property: true if the service principal account is enabled; otherwise, false. - * + * * @return the accountEnabled value. */ public Boolean accountEnabled() { @@ -336,7 +297,7 @@ public Boolean accountEnabled() { /** * Set the accountEnabled property: true if the service principal account is enabled; otherwise, false. - * + * * @param accountEnabled the accountEnabled value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -350,7 +311,7 @@ public MicrosoftGraphServicePrincipalInner withAccountEnabled(Boolean accountEna * contexts. For example, applications that can render file streams may set the addIns property for its * 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a * document the user is working on. - * + * * @return the addIns value. */ public List addIns() { @@ -362,7 +323,7 @@ public List addIns() { * contexts. For example, applications that can render file streams may set the addIns property for its * 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a * document the user is working on. - * + * * @param addIns the addIns value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -374,7 +335,7 @@ public MicrosoftGraphServicePrincipalInner withAddIns(List /** * Get the alternativeNames property: Used to retrieve service principals by subscription, identify resource group * and full resource ids for managed identities. - * + * * @return the alternativeNames value. */ public List alternativeNames() { @@ -384,7 +345,7 @@ public List alternativeNames() { /** * Set the alternativeNames property: Used to retrieve service principals by subscription, identify resource group * and full resource ids for managed identities. - * + * * @param alternativeNames the alternativeNames value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -395,7 +356,7 @@ public MicrosoftGraphServicePrincipalInner withAlternativeNames(List alt /** * Get the appDescription property: The appDescription property. - * + * * @return the appDescription value. */ public String appDescription() { @@ -404,7 +365,7 @@ public String appDescription() { /** * Set the appDescription property: The appDescription property. - * + * * @param appDescription the appDescription value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -415,7 +376,7 @@ public MicrosoftGraphServicePrincipalInner withAppDescription(String appDescript /** * Get the appDisplayName property: The display name exposed by the associated application. - * + * * @return the appDisplayName value. */ public String appDisplayName() { @@ -424,7 +385,7 @@ public String appDisplayName() { /** * Set the appDisplayName property: The display name exposed by the associated application. - * + * * @param appDisplayName the appDisplayName value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -435,7 +396,7 @@ public MicrosoftGraphServicePrincipalInner withAppDisplayName(String appDisplayN /** * Get the appId property: The unique identifier for the associated application (its appId property). - * + * * @return the appId value. */ public String appId() { @@ -444,7 +405,7 @@ public String appId() { /** * Set the appId property: The unique identifier for the associated application (its appId property). - * + * * @param appId the appId value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -456,7 +417,7 @@ public MicrosoftGraphServicePrincipalInner withAppId(String appId) { /** * Get the applicationTemplateId property: Unique identifier of the applicationTemplate that the servicePrincipal * was created from. Read-only. - * + * * @return the applicationTemplateId value. */ public String applicationTemplateId() { @@ -466,7 +427,7 @@ public String applicationTemplateId() { /** * Set the applicationTemplateId property: Unique identifier of the applicationTemplate that the servicePrincipal * was created from. Read-only. - * + * * @param applicationTemplateId the applicationTemplateId value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -478,7 +439,7 @@ public MicrosoftGraphServicePrincipalInner withApplicationTemplateId(String appl /** * Get the appOwnerOrganizationId property: Contains the tenant id where the application is registered. This is * applicable only to service principals backed by applications. - * + * * @return the appOwnerOrganizationId value. */ public UUID appOwnerOrganizationId() { @@ -488,7 +449,7 @@ public UUID appOwnerOrganizationId() { /** * Set the appOwnerOrganizationId property: Contains the tenant id where the application is registered. This is * applicable only to service principals backed by applications. - * + * * @param appOwnerOrganizationId the appOwnerOrganizationId value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -501,7 +462,7 @@ public MicrosoftGraphServicePrincipalInner withAppOwnerOrganizationId(UUID appOw * Get the appRoleAssignmentRequired property: Specifies whether users or other service principals need to be * granted an app role assignment for this service principal before users can sign in or apps can get tokens. The * default value is false. Not nullable. - * + * * @return the appRoleAssignmentRequired value. */ public Boolean appRoleAssignmentRequired() { @@ -512,7 +473,7 @@ public Boolean appRoleAssignmentRequired() { * Set the appRoleAssignmentRequired property: Specifies whether users or other service principals need to be * granted an app role assignment for this service principal before users can sign in or apps can get tokens. The * default value is false. Not nullable. - * + * * @param appRoleAssignmentRequired the appRoleAssignmentRequired value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -524,7 +485,7 @@ public MicrosoftGraphServicePrincipalInner withAppRoleAssignmentRequired(Boolean /** * Get the appRoles property: The roles exposed by the application which this service principal represents. For more * information see the appRoles property definition on the application entity. Not nullable. - * + * * @return the appRoles value. */ public List appRoles() { @@ -534,7 +495,7 @@ public List appRoles() { /** * Set the appRoles property: The roles exposed by the application which this service principal represents. For more * information see the appRoles property definition on the application entity. Not nullable. - * + * * @param appRoles the appRoles value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -545,7 +506,7 @@ public MicrosoftGraphServicePrincipalInner withAppRoles(List keyCredentials() { @@ -636,12 +597,12 @@ public List keyCredentials() { /** * Set the keyCredentials property: The collection of key credentials associated with the service principal. Not * nullable. - * + * * @param keyCredentials the keyCredentials value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withKeyCredentials( - List keyCredentials) { + public MicrosoftGraphServicePrincipalInner + withKeyCredentials(List keyCredentials) { this.keyCredentials = keyCredentials; return this; } @@ -651,7 +612,7 @@ public MicrosoftGraphServicePrincipalInner withKeyCredentials( * authenticate. Azure AD uses the URL to launch the application from Microsoft 365 or the Azure AD My Apps. When * blank, Azure AD performs IdP-initiated sign-on for applications configured with SAML-based single sign-on. The * user launches the application from Microsoft 365, the Azure AD My Apps, or the Azure AD SSO URL. - * + * * @return the loginUrl value. */ public String loginUrl() { @@ -663,7 +624,7 @@ public String loginUrl() { * authenticate. Azure AD uses the URL to launch the application from Microsoft 365 or the Azure AD My Apps. When * blank, Azure AD performs IdP-initiated sign-on for applications configured with SAML-based single sign-on. The * user launches the application from Microsoft 365, the Azure AD My Apps, or the Azure AD SSO URL. - * + * * @param loginUrl the loginUrl value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -675,7 +636,7 @@ public MicrosoftGraphServicePrincipalInner withLoginUrl(String loginUrl) { /** * Get the logoutUrl property: Specifies the URL that will be used by Microsoft's authorization service to logout an * user using OpenId Connect front-channel, back-channel or SAML logout protocols. - * + * * @return the logoutUrl value. */ public String logoutUrl() { @@ -685,7 +646,7 @@ public String logoutUrl() { /** * Set the logoutUrl property: Specifies the URL that will be used by Microsoft's authorization service to logout an * user using OpenId Connect front-channel, back-channel or SAML logout protocols. - * + * * @param logoutUrl the logoutUrl value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -696,7 +657,7 @@ public MicrosoftGraphServicePrincipalInner withLogoutUrl(String logoutUrl) { /** * Get the notes property: The notes property. - * + * * @return the notes value. */ public String notes() { @@ -705,7 +666,7 @@ public String notes() { /** * Set the notes property: The notes property. - * + * * @param notes the notes value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -718,7 +679,7 @@ public MicrosoftGraphServicePrincipalInner withNotes(String notes) { * Get the notificationEmailAddresses property: Specifies the list of email addresses where Azure AD sends a * notification when the active certificate is near the expiration date. This is only for the certificates used to * sign the SAML token issued for Azure AD Gallery applications. - * + * * @return the notificationEmailAddresses value. */ public List notificationEmailAddresses() { @@ -729,7 +690,7 @@ public List notificationEmailAddresses() { * Set the notificationEmailAddresses property: Specifies the list of email addresses where Azure AD sends a * notification when the active certificate is near the expiration date. This is only for the certificates used to * sign the SAML token issued for Azure AD Gallery applications. - * + * * @param notificationEmailAddresses the notificationEmailAddresses value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -741,7 +702,7 @@ public MicrosoftGraphServicePrincipalInner withNotificationEmailAddresses(List oauth2PermissionScopes() { @@ -751,12 +712,12 @@ public List oauth2PermissionScopes() { /** * Set the oauth2PermissionScopes property: The delegated permissions exposed by the application. For more * information see the oauth2PermissionScopes property on the application entity's api property. Not nullable. - * + * * @param oauth2PermissionScopes the oauth2PermissionScopes value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withOauth2PermissionScopes( - List oauth2PermissionScopes) { + public MicrosoftGraphServicePrincipalInner + withOauth2PermissionScopes(List oauth2PermissionScopes) { this.oauth2PermissionScopes = oauth2PermissionScopes; return this; } @@ -764,7 +725,7 @@ public MicrosoftGraphServicePrincipalInner withOauth2PermissionScopes( /** * Get the passwordCredentials property: The collection of password credentials associated with the service * principal. Not nullable. - * + * * @return the passwordCredentials value. */ public List passwordCredentials() { @@ -774,12 +735,12 @@ public List passwordCredentials() { /** * Set the passwordCredentials property: The collection of password credentials associated with the service * principal. Not nullable. - * + * * @param passwordCredentials the passwordCredentials value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withPasswordCredentials( - List passwordCredentials) { + public MicrosoftGraphServicePrincipalInner + withPasswordCredentials(List passwordCredentials) { this.passwordCredentials = passwordCredentials; return this; } @@ -788,7 +749,7 @@ public MicrosoftGraphServicePrincipalInner withPasswordCredentials( * Get the preferredSingleSignOnMode property: Specifies the single sign-on mode configured for this application. * Azure AD uses the preferred single sign-on mode to launch the application from Microsoft 365 or the Azure AD My * Apps. The supported values are password, saml, external, and oidc. - * + * * @return the preferredSingleSignOnMode value. */ public String preferredSingleSignOnMode() { @@ -799,7 +760,7 @@ public String preferredSingleSignOnMode() { * Set the preferredSingleSignOnMode property: Specifies the single sign-on mode configured for this application. * Azure AD uses the preferred single sign-on mode to launch the application from Microsoft 365 or the Azure AD My * Apps. The supported values are password, saml, external, and oidc. - * + * * @param preferredSingleSignOnMode the preferredSingleSignOnMode value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -810,7 +771,7 @@ public MicrosoftGraphServicePrincipalInner withPreferredSingleSignOnMode(String /** * Get the preferredTokenSigningKeyThumbprint property: The preferredTokenSigningKeyThumbprint property. - * + * * @return the preferredTokenSigningKeyThumbprint value. */ public String preferredTokenSigningKeyThumbprint() { @@ -819,12 +780,12 @@ public String preferredTokenSigningKeyThumbprint() { /** * Set the preferredTokenSigningKeyThumbprint property: The preferredTokenSigningKeyThumbprint property. - * + * * @param preferredTokenSigningKeyThumbprint the preferredTokenSigningKeyThumbprint value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withPreferredTokenSigningKeyThumbprint( - String preferredTokenSigningKeyThumbprint) { + public MicrosoftGraphServicePrincipalInner + withPreferredTokenSigningKeyThumbprint(String preferredTokenSigningKeyThumbprint) { this.preferredTokenSigningKeyThumbprint = preferredTokenSigningKeyThumbprint; return this; } @@ -833,7 +794,7 @@ public MicrosoftGraphServicePrincipalInner withPreferredTokenSigningKeyThumbprin * Get the replyUrls property: The URLs that user tokens are sent to for sign in with the associated application, or * the redirect URIs that OAuth 2.0 authorization codes and access tokens are sent to for the associated * application. Not nullable. - * + * * @return the replyUrls value. */ public List replyUrls() { @@ -844,7 +805,7 @@ public List replyUrls() { * Set the replyUrls property: The URLs that user tokens are sent to for sign in with the associated application, or * the redirect URIs that OAuth 2.0 authorization codes and access tokens are sent to for the associated * application. Not nullable. - * + * * @param replyUrls the replyUrls value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -855,7 +816,7 @@ public MicrosoftGraphServicePrincipalInner withReplyUrls(List replyUrls) /** * Get the samlSingleSignOnSettings property: samlSingleSignOnSettings. - * + * * @return the samlSingleSignOnSettings value. */ public MicrosoftGraphSamlSingleSignOnSettings samlSingleSignOnSettings() { @@ -864,12 +825,12 @@ public MicrosoftGraphSamlSingleSignOnSettings samlSingleSignOnSettings() { /** * Set the samlSingleSignOnSettings property: samlSingleSignOnSettings. - * + * * @param samlSingleSignOnSettings the samlSingleSignOnSettings value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withSamlSingleSignOnSettings( - MicrosoftGraphSamlSingleSignOnSettings samlSingleSignOnSettings) { + public MicrosoftGraphServicePrincipalInner + withSamlSingleSignOnSettings(MicrosoftGraphSamlSingleSignOnSettings samlSingleSignOnSettings) { this.samlSingleSignOnSettings = samlSingleSignOnSettings; return this; } @@ -880,7 +841,7 @@ public MicrosoftGraphServicePrincipalInner withSamlSingleSignOnSettings( * permissions exposed by this app within Azure AD. For example,Client apps can specify a resource URI which is * based on the values of this property to acquire an access token, which is the URI returned in the 'aud' claim.The * any operator is required for filter expressions on multi-valued properties. Not nullable. - * + * * @return the servicePrincipalNames value. */ public List servicePrincipalNames() { @@ -893,7 +854,7 @@ public List servicePrincipalNames() { * permissions exposed by this app within Azure AD. For example,Client apps can specify a resource URI which is * based on the values of this property to acquire an access token, which is the URI returned in the 'aud' claim.The * any operator is required for filter expressions on multi-valued properties. Not nullable. - * + * * @param servicePrincipalNames the servicePrincipalNames value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -906,7 +867,7 @@ public MicrosoftGraphServicePrincipalInner withServicePrincipalNames(List tags() { @@ -959,7 +920,7 @@ public List tags() { /** * Set the tags property: Custom strings that can be used to categorize and identify the service principal. Not * nullable. - * + * * @param tags the tags value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -973,7 +934,7 @@ public MicrosoftGraphServicePrincipalInner withTags(List tags) { * When configured, Azure AD issues tokens for this application encrypted using the key specified by this property. * The application code that receives the encrypted token must use the matching private key to decrypt the token * before it can be used for the signed-in user. - * + * * @return the tokenEncryptionKeyId value. */ public UUID tokenEncryptionKeyId() { @@ -985,7 +946,7 @@ public UUID tokenEncryptionKeyId() { * When configured, Azure AD issues tokens for this application encrypted using the key specified by this property. * The application code that receives the encrypted token must use the matching private key to decrypt the token * before it can be used for the signed-in user. - * + * * @param tokenEncryptionKeyId the tokenEncryptionKeyId value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -997,7 +958,7 @@ public MicrosoftGraphServicePrincipalInner withTokenEncryptionKeyId(UUID tokenEn /** * Get the appRoleAssignedTo property: Principals (users, groups, and service principals) that are assigned to this * service principal. Read-only. - * + * * @return the appRoleAssignedTo value. */ public List appRoleAssignedTo() { @@ -1007,12 +968,12 @@ public List appRoleAssignedTo() { /** * Set the appRoleAssignedTo property: Principals (users, groups, and service principals) that are assigned to this * service principal. Read-only. - * + * * @param appRoleAssignedTo the appRoleAssignedTo value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withAppRoleAssignedTo( - List appRoleAssignedTo) { + public MicrosoftGraphServicePrincipalInner + withAppRoleAssignedTo(List appRoleAssignedTo) { this.appRoleAssignedTo = appRoleAssignedTo; return this; } @@ -1020,7 +981,7 @@ public MicrosoftGraphServicePrincipalInner withAppRoleAssignedTo( /** * Get the appRoleAssignments property: Applications that this service principal is assigned to. Read-only. * Nullable. - * + * * @return the appRoleAssignments value. */ public List appRoleAssignments() { @@ -1030,19 +991,19 @@ public List appRoleAssignments() { /** * Set the appRoleAssignments property: Applications that this service principal is assigned to. Read-only. * Nullable. - * + * * @param appRoleAssignments the appRoleAssignments value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withAppRoleAssignments( - List appRoleAssignments) { + public MicrosoftGraphServicePrincipalInner + withAppRoleAssignments(List appRoleAssignments) { this.appRoleAssignments = appRoleAssignments; return this; } /** * Get the claimsMappingPolicies property: The claimsMappingPolicies assigned to this service principal. - * + * * @return the claimsMappingPolicies value. */ public List claimsMappingPolicies() { @@ -1051,19 +1012,19 @@ public List claimsMappingPolicies() { /** * Set the claimsMappingPolicies property: The claimsMappingPolicies assigned to this service principal. - * + * * @param claimsMappingPolicies the claimsMappingPolicies value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withClaimsMappingPolicies( - List claimsMappingPolicies) { + public MicrosoftGraphServicePrincipalInner + withClaimsMappingPolicies(List claimsMappingPolicies) { this.claimsMappingPolicies = claimsMappingPolicies; return this; } /** * Get the createdObjects property: Directory objects created by this service principal. Read-only. Nullable. - * + * * @return the createdObjects value. */ public List createdObjects() { @@ -1072,19 +1033,19 @@ public List createdObjects() { /** * Set the createdObjects property: Directory objects created by this service principal. Read-only. Nullable. - * + * * @param createdObjects the createdObjects value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withCreatedObjects( - List createdObjects) { + public MicrosoftGraphServicePrincipalInner + withCreatedObjects(List createdObjects) { this.createdObjects = createdObjects; return this; } /** * Get the delegatedPermissionClassifications property: The delegatedPermissionClassifications property. - * + * * @return the delegatedPermissionClassifications value. */ public List delegatedPermissionClassifications() { @@ -1093,7 +1054,7 @@ public List delegatedPermission /** * Set the delegatedPermissionClassifications property: The delegatedPermissionClassifications property. - * + * * @param delegatedPermissionClassifications the delegatedPermissionClassifications value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -1106,7 +1067,7 @@ public MicrosoftGraphServicePrincipalInner withDelegatedPermissionClassification /** * Get the endpoints property: Endpoints available for discovery. Services like Sharepoint populate this property * with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. - * + * * @return the endpoints value. */ public List endpoints() { @@ -1116,7 +1077,7 @@ public List endpoints() { /** * Set the endpoints property: Endpoints available for discovery. Services like Sharepoint populate this property * with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. - * + * * @param endpoints the endpoints value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -1127,7 +1088,7 @@ public MicrosoftGraphServicePrincipalInner withEndpoints(List homeRealmDiscoveryPolicies() { @@ -1136,12 +1097,12 @@ public List homeRealmDiscoveryPolic /** * Set the homeRealmDiscoveryPolicies property: The homeRealmDiscoveryPolicies assigned to this service principal. - * + * * @param homeRealmDiscoveryPolicies the homeRealmDiscoveryPolicies value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withHomeRealmDiscoveryPolicies( - List homeRealmDiscoveryPolicies) { + public MicrosoftGraphServicePrincipalInner + withHomeRealmDiscoveryPolicies(List homeRealmDiscoveryPolicies) { this.homeRealmDiscoveryPolicies = homeRealmDiscoveryPolicies; return this; } @@ -1149,7 +1110,7 @@ public MicrosoftGraphServicePrincipalInner withHomeRealmDiscoveryPolicies( /** * Get the memberOf property: Roles that this service principal is a member of. HTTP Methods: GET Read-only. * Nullable. - * + * * @return the memberOf value. */ public List memberOf() { @@ -1159,7 +1120,7 @@ public List memberOf() { /** * Set the memberOf property: Roles that this service principal is a member of. HTTP Methods: GET Read-only. * Nullable. - * + * * @param memberOf the memberOf value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -1171,7 +1132,7 @@ public MicrosoftGraphServicePrincipalInner withMemberOf(List oauth2PermissionGrants() { @@ -1181,19 +1142,19 @@ public List oauth2PermissionGrants() { /** * Set the oauth2PermissionGrants property: Delegated permission grants authorizing this service principal to access * an API on behalf of a signed-in user. Read-only. Nullable. - * + * * @param oauth2PermissionGrants the oauth2PermissionGrants value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withOauth2PermissionGrants( - List oauth2PermissionGrants) { + public MicrosoftGraphServicePrincipalInner + withOauth2PermissionGrants(List oauth2PermissionGrants) { this.oauth2PermissionGrants = oauth2PermissionGrants; return this; } /** * Get the ownedObjects property: Directory objects that are owned by this service principal. Read-only. Nullable. - * + * * @return the ownedObjects value. */ public List ownedObjects() { @@ -1202,7 +1163,7 @@ public List ownedObjects() { /** * Set the ownedObjects property: Directory objects that are owned by this service principal. Read-only. Nullable. - * + * * @param ownedObjects the ownedObjects value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -1214,7 +1175,7 @@ public MicrosoftGraphServicePrincipalInner withOwnedObjects(List owners() { @@ -1224,7 +1185,7 @@ public List owners() { /** * Set the owners property: Directory objects that are owners of this servicePrincipal. The owners are a set of * non-admin users or servicePrincipals who are allowed to modify this object. Read-only. Nullable. - * + * * @param owners the owners value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -1235,7 +1196,7 @@ public MicrosoftGraphServicePrincipalInner withOwners(List tokenIssuancePolicies() { @@ -1244,19 +1205,19 @@ public List tokenIssuancePolicies() { /** * Set the tokenIssuancePolicies property: The tokenIssuancePolicies assigned to this service principal. - * + * * @param tokenIssuancePolicies the tokenIssuancePolicies value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withTokenIssuancePolicies( - List tokenIssuancePolicies) { + public MicrosoftGraphServicePrincipalInner + withTokenIssuancePolicies(List tokenIssuancePolicies) { this.tokenIssuancePolicies = tokenIssuancePolicies; return this; } /** * Get the tokenLifetimePolicies property: The tokenLifetimePolicies assigned to this service principal. - * + * * @return the tokenLifetimePolicies value. */ public List tokenLifetimePolicies() { @@ -1265,19 +1226,19 @@ public List tokenLifetimePolicies() { /** * Set the tokenLifetimePolicies property: The tokenLifetimePolicies assigned to this service principal. - * + * * @param tokenLifetimePolicies the tokenLifetimePolicies value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withTokenLifetimePolicies( - List tokenLifetimePolicies) { + public MicrosoftGraphServicePrincipalInner + withTokenLifetimePolicies(List tokenLifetimePolicies) { this.tokenLifetimePolicies = tokenLifetimePolicies; return this; } /** * Get the transitiveMemberOf property: The transitiveMemberOf property. - * + * * @return the transitiveMemberOf value. */ public List transitiveMemberOf() { @@ -1286,12 +1247,12 @@ public List transitiveMemberOf() { /** * Set the transitiveMemberOf property: The transitiveMemberOf property. - * + * * @param transitiveMemberOf the transitiveMemberOf value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ - public MicrosoftGraphServicePrincipalInner withTransitiveMemberOf( - List transitiveMemberOf) { + public MicrosoftGraphServicePrincipalInner + withTransitiveMemberOf(List transitiveMemberOf) { this.transitiveMemberOf = transitiveMemberOf; return this; } @@ -1299,10 +1260,9 @@ public MicrosoftGraphServicePrincipalInner withTransitiveMemberOf( /** * Get the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } @@ -1310,7 +1270,7 @@ public Map additionalProperties() { /** * Set the additionalProperties property: Represents an Azure Active Directory object. The directoryObject type is * the base type for many other directory entity types. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphServicePrincipalInner object itself. */ @@ -1319,22 +1279,18 @@ public MicrosoftGraphServicePrincipalInner withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphServicePrincipalInner withDeletedDateTime(OffsetDateTime deletedDateTime) { super.withDeletedDateTime(deletedDateTime); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphServicePrincipalInner withId(String id) { super.withId(id); @@ -1343,7 +1299,7 @@ public MicrosoftGraphServicePrincipalInner withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -1413,4 +1369,258 @@ public void validate() { transitiveMemberOf().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("deletedDateTime", + deletedDateTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deletedDateTime())); + jsonWriter.writeBooleanField("accountEnabled", this.accountEnabled); + jsonWriter.writeArrayField("addIns", this.addIns, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("alternativeNames", this.alternativeNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("appDescription", this.appDescription); + jsonWriter.writeStringField("appDisplayName", this.appDisplayName); + jsonWriter.writeStringField("appId", this.appId); + jsonWriter.writeStringField("applicationTemplateId", this.applicationTemplateId); + jsonWriter.writeStringField("appOwnerOrganizationId", Objects.toString(this.appOwnerOrganizationId, null)); + jsonWriter.writeBooleanField("appRoleAssignmentRequired", this.appRoleAssignmentRequired); + jsonWriter.writeArrayField("appRoles", this.appRoles, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("homepage", this.homepage); + jsonWriter.writeJsonField("info", this.info); + jsonWriter.writeArrayField("keyCredentials", this.keyCredentials, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("loginUrl", this.loginUrl); + jsonWriter.writeStringField("logoutUrl", this.logoutUrl); + jsonWriter.writeStringField("notes", this.notes); + jsonWriter.writeArrayField("notificationEmailAddresses", this.notificationEmailAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("oauth2PermissionScopes", this.oauth2PermissionScopes, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("passwordCredentials", this.passwordCredentials, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("preferredSingleSignOnMode", this.preferredSingleSignOnMode); + jsonWriter.writeStringField("preferredTokenSigningKeyThumbprint", this.preferredTokenSigningKeyThumbprint); + jsonWriter.writeArrayField("replyUrls", this.replyUrls, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("samlSingleSignOnSettings", this.samlSingleSignOnSettings); + jsonWriter.writeArrayField("servicePrincipalNames", this.servicePrincipalNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("servicePrincipalType", this.servicePrincipalType); + jsonWriter.writeStringField("signInAudience", this.signInAudience); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("tokenEncryptionKeyId", Objects.toString(this.tokenEncryptionKeyId, null)); + jsonWriter.writeArrayField("appRoleAssignedTo", this.appRoleAssignedTo, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("appRoleAssignments", this.appRoleAssignments, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("claimsMappingPolicies", this.claimsMappingPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("createdObjects", this.createdObjects, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("delegatedPermissionClassifications", this.delegatedPermissionClassifications, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("endpoints", this.endpoints, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("homeRealmDiscoveryPolicies", this.homeRealmDiscoveryPolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("memberOf", this.memberOf, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("oauth2PermissionGrants", this.oauth2PermissionGrants, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("ownedObjects", this.ownedObjects, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("owners", this.owners, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tokenIssuancePolicies", this.tokenIssuancePolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tokenLifetimePolicies", this.tokenLifetimePolicies, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("transitiveMemberOf", this.transitiveMemberOf, + (writer, element) -> writer.writeJson(element)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphServicePrincipalInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphServicePrincipalInner 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 MicrosoftGraphServicePrincipalInner. + */ + public static MicrosoftGraphServicePrincipalInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphServicePrincipalInner deserializedMicrosoftGraphServicePrincipalInner + = new MicrosoftGraphServicePrincipalInner(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.withId(reader.getString()); + } else if ("deletedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.withDeletedDateTime(reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); + } else if ("accountEnabled".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.accountEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("addIns".equals(fieldName)) { + List addIns + = reader.readArray(reader1 -> MicrosoftGraphAddIn.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.addIns = addIns; + } else if ("alternativeNames".equals(fieldName)) { + List alternativeNames = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphServicePrincipalInner.alternativeNames = alternativeNames; + } else if ("appDescription".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.appDescription = reader.getString(); + } else if ("appDisplayName".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.appDisplayName = reader.getString(); + } else if ("appId".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.appId = reader.getString(); + } else if ("applicationTemplateId".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.applicationTemplateId = reader.getString(); + } else if ("appOwnerOrganizationId".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.appOwnerOrganizationId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("appRoleAssignmentRequired".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.appRoleAssignmentRequired + = reader.getNullable(JsonReader::getBoolean); + } else if ("appRoles".equals(fieldName)) { + List appRoles + = reader.readArray(reader1 -> MicrosoftGraphAppRole.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.appRoles = appRoles; + } else if ("description".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.description = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.displayName = reader.getString(); + } else if ("homepage".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.homepage = reader.getString(); + } else if ("info".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.info + = MicrosoftGraphInformationalUrl.fromJson(reader); + } else if ("keyCredentials".equals(fieldName)) { + List keyCredentials + = reader.readArray(reader1 -> MicrosoftGraphKeyCredentialInner.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.keyCredentials = keyCredentials; + } else if ("loginUrl".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.loginUrl = reader.getString(); + } else if ("logoutUrl".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.logoutUrl = reader.getString(); + } else if ("notes".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.notes = reader.getString(); + } else if ("notificationEmailAddresses".equals(fieldName)) { + List notificationEmailAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphServicePrincipalInner.notificationEmailAddresses + = notificationEmailAddresses; + } else if ("oauth2PermissionScopes".equals(fieldName)) { + List oauth2PermissionScopes + = reader.readArray(reader1 -> MicrosoftGraphPermissionScope.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.oauth2PermissionScopes = oauth2PermissionScopes; + } else if ("passwordCredentials".equals(fieldName)) { + List passwordCredentials + = reader.readArray(reader1 -> MicrosoftGraphPasswordCredentialInner.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.passwordCredentials = passwordCredentials; + } else if ("preferredSingleSignOnMode".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.preferredSingleSignOnMode = reader.getString(); + } else if ("preferredTokenSigningKeyThumbprint".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.preferredTokenSigningKeyThumbprint + = reader.getString(); + } else if ("replyUrls".equals(fieldName)) { + List replyUrls = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphServicePrincipalInner.replyUrls = replyUrls; + } else if ("samlSingleSignOnSettings".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.samlSingleSignOnSettings + = MicrosoftGraphSamlSingleSignOnSettings.fromJson(reader); + } else if ("servicePrincipalNames".equals(fieldName)) { + List servicePrincipalNames = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphServicePrincipalInner.servicePrincipalNames = servicePrincipalNames; + } else if ("servicePrincipalType".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.servicePrincipalType = reader.getString(); + } else if ("signInAudience".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.signInAudience = reader.getString(); + } else if ("tags".equals(fieldName)) { + List tags = reader.readArray(reader1 -> reader1.getString()); + deserializedMicrosoftGraphServicePrincipalInner.tags = tags; + } else if ("tokenEncryptionKeyId".equals(fieldName)) { + deserializedMicrosoftGraphServicePrincipalInner.tokenEncryptionKeyId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("appRoleAssignedTo".equals(fieldName)) { + List appRoleAssignedTo + = reader.readArray(reader1 -> MicrosoftGraphAppRoleAssignment.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.appRoleAssignedTo = appRoleAssignedTo; + } else if ("appRoleAssignments".equals(fieldName)) { + List appRoleAssignments + = reader.readArray(reader1 -> MicrosoftGraphAppRoleAssignment.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.appRoleAssignments = appRoleAssignments; + } else if ("claimsMappingPolicies".equals(fieldName)) { + List claimsMappingPolicies + = reader.readArray(reader1 -> MicrosoftGraphClaimsMappingPolicy.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.claimsMappingPolicies = claimsMappingPolicies; + } else if ("createdObjects".equals(fieldName)) { + List createdObjects + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.createdObjects = createdObjects; + } else if ("delegatedPermissionClassifications".equals(fieldName)) { + List delegatedPermissionClassifications = reader + .readArray(reader1 -> MicrosoftGraphDelegatedPermissionClassification.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.delegatedPermissionClassifications + = delegatedPermissionClassifications; + } else if ("endpoints".equals(fieldName)) { + List endpoints + = reader.readArray(reader1 -> MicrosoftGraphEndpoint.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.endpoints = endpoints; + } else if ("homeRealmDiscoveryPolicies".equals(fieldName)) { + List homeRealmDiscoveryPolicies + = reader.readArray(reader1 -> MicrosoftGraphHomeRealmDiscoveryPolicyInner.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.homeRealmDiscoveryPolicies + = homeRealmDiscoveryPolicies; + } else if ("memberOf".equals(fieldName)) { + List memberOf + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.memberOf = memberOf; + } else if ("oauth2PermissionGrants".equals(fieldName)) { + List oauth2PermissionGrants + = reader.readArray(reader1 -> MicrosoftGraphOAuth2PermissionGrant.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.oauth2PermissionGrants = oauth2PermissionGrants; + } else if ("ownedObjects".equals(fieldName)) { + List ownedObjects + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.ownedObjects = ownedObjects; + } else if ("owners".equals(fieldName)) { + List owners + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.owners = owners; + } else if ("tokenIssuancePolicies".equals(fieldName)) { + List tokenIssuancePolicies + = reader.readArray(reader1 -> MicrosoftGraphTokenIssuancePolicy.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.tokenIssuancePolicies = tokenIssuancePolicies; + } else if ("tokenLifetimePolicies".equals(fieldName)) { + List tokenLifetimePolicies + = reader.readArray(reader1 -> MicrosoftGraphTokenLifetimePolicy.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.tokenLifetimePolicies = tokenLifetimePolicies; + } else if ("transitiveMemberOf".equals(fieldName)) { + List transitiveMemberOf + = reader.readArray(reader1 -> MicrosoftGraphDirectoryObjectInner.fromJson(reader1)); + deserializedMicrosoftGraphServicePrincipalInner.transitiveMemberOf = transitiveMemberOf; + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphServicePrincipalInner.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphServicePrincipalInner; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSettingSource.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSettingSource.java index 09848c599b39b..68f9120cc7a0a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSettingSource.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSettingSource.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** settingSource. */ +/** + * settingSource. + */ @Fluent -public final class MicrosoftGraphSettingSource { +public final class MicrosoftGraphSettingSource implements JsonSerializable { /* * Not yet documented */ - @JsonProperty(value = "displayName") private String displayName; /* * Not yet documented */ - @JsonProperty(value = "id") private String id; /* * settingSource */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSettingSource class. */ + /** + * Creates an instance of MicrosoftGraphSettingSource class. + */ public MicrosoftGraphSettingSource() { } /** * Get the displayName property: Not yet documented. - * + * * @return the displayName value. */ public String displayName() { @@ -47,7 +50,7 @@ public String displayName() { /** * Set the displayName property: Not yet documented. - * + * * @param displayName the displayName value to set. * @return the MicrosoftGraphSettingSource object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphSettingSource withDisplayName(String displayName) { /** * Get the id property: Not yet documented. - * + * * @return the id value. */ public String id() { @@ -67,7 +70,7 @@ public String id() { /** * Set the id property: Not yet documented. - * + * * @param id the id value to set. * @return the MicrosoftGraphSettingSource object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphSettingSource withId(String id) { /** * Get the additionalProperties property: settingSource. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: settingSource. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSettingSource object itself. */ @@ -97,19 +99,61 @@ public MicrosoftGraphSettingSource withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("id", this.id); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSettingSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSettingSource 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 MicrosoftGraphSettingSource. + */ + public static MicrosoftGraphSettingSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSettingSource deserializedMicrosoftGraphSettingSource = new MicrosoftGraphSettingSource(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedMicrosoftGraphSettingSource.displayName = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedMicrosoftGraphSettingSource.id = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSettingSource.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSettingSource; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSettingValue.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSettingValue.java index 08de97177d459..b93d01ed0b280 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSettingValue.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSettingValue.java @@ -5,40 +5,43 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** settingValue. */ +/** + * settingValue. + */ @Fluent -public final class MicrosoftGraphSettingValue { +public final class MicrosoftGraphSettingValue implements JsonSerializable { /* * Name of the setting (as defined by the groupSettingTemplate). */ - @JsonProperty(value = "name") private String name; /* * Value of the setting. */ - @JsonProperty(value = "value") private String value; /* * settingValue */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSettingValue class. */ + /** + * Creates an instance of MicrosoftGraphSettingValue class. + */ public MicrosoftGraphSettingValue() { } /** * Get the name property: Name of the setting (as defined by the groupSettingTemplate). - * + * * @return the name value. */ public String name() { @@ -47,7 +50,7 @@ public String name() { /** * Set the name property: Name of the setting (as defined by the groupSettingTemplate). - * + * * @param name the name value to set. * @return the MicrosoftGraphSettingValue object itself. */ @@ -58,7 +61,7 @@ public MicrosoftGraphSettingValue withName(String name) { /** * Get the value property: Value of the setting. - * + * * @return the value value. */ public String value() { @@ -67,7 +70,7 @@ public String value() { /** * Set the value property: Value of the setting. - * + * * @param value the value value to set. * @return the MicrosoftGraphSettingValue object itself. */ @@ -78,17 +81,16 @@ public MicrosoftGraphSettingValue withValue(String value) { /** * Get the additionalProperties property: settingValue. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: settingValue. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSettingValue object itself. */ @@ -97,19 +99,61 @@ public MicrosoftGraphSettingValue withAdditionalProperties(Map a return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("value", this.value); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSettingValue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSettingValue 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 MicrosoftGraphSettingValue. + */ + public static MicrosoftGraphSettingValue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSettingValue deserializedMicrosoftGraphSettingValue = new MicrosoftGraphSettingValue(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMicrosoftGraphSettingValue.name = reader.getString(); + } else if ("value".equals(fieldName)) { + deserializedMicrosoftGraphSettingValue.value = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSettingValue.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSettingValue; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphShared.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphShared.java index aaeb1797ead2a..b32f3b1cfc38b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphShared.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphShared.java @@ -5,53 +5,56 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** shared. */ +/** + * shared. + */ @Fluent -public final class MicrosoftGraphShared { +public final class MicrosoftGraphShared implements JsonSerializable { /* * identitySet */ - @JsonProperty(value = "owner") private MicrosoftGraphIdentitySet owner; /* * Indicates the scope of how the item is shared: anonymous, organization, or users. Read-only. */ - @JsonProperty(value = "scope") private String scope; /* * identitySet */ - @JsonProperty(value = "sharedBy") private MicrosoftGraphIdentitySet sharedBy; /* * The UTC date and time when the item was shared. Read-only. */ - @JsonProperty(value = "sharedDateTime") private OffsetDateTime sharedDateTime; /* * shared */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphShared class. */ + /** + * Creates an instance of MicrosoftGraphShared class. + */ public MicrosoftGraphShared() { } /** * Get the owner property: identitySet. - * + * * @return the owner value. */ public MicrosoftGraphIdentitySet owner() { @@ -60,7 +63,7 @@ public MicrosoftGraphIdentitySet owner() { /** * Set the owner property: identitySet. - * + * * @param owner the owner value to set. * @return the MicrosoftGraphShared object itself. */ @@ -72,7 +75,7 @@ public MicrosoftGraphShared withOwner(MicrosoftGraphIdentitySet owner) { /** * Get the scope property: Indicates the scope of how the item is shared: anonymous, organization, or users. * Read-only. - * + * * @return the scope value. */ public String scope() { @@ -82,7 +85,7 @@ public String scope() { /** * Set the scope property: Indicates the scope of how the item is shared: anonymous, organization, or users. * Read-only. - * + * * @param scope the scope value to set. * @return the MicrosoftGraphShared object itself. */ @@ -93,7 +96,7 @@ public MicrosoftGraphShared withScope(String scope) { /** * Get the sharedBy property: identitySet. - * + * * @return the sharedBy value. */ public MicrosoftGraphIdentitySet sharedBy() { @@ -102,7 +105,7 @@ public MicrosoftGraphIdentitySet sharedBy() { /** * Set the sharedBy property: identitySet. - * + * * @param sharedBy the sharedBy value to set. * @return the MicrosoftGraphShared object itself. */ @@ -113,7 +116,7 @@ public MicrosoftGraphShared withSharedBy(MicrosoftGraphIdentitySet sharedBy) { /** * Get the sharedDateTime property: The UTC date and time when the item was shared. Read-only. - * + * * @return the sharedDateTime value. */ public OffsetDateTime sharedDateTime() { @@ -122,7 +125,7 @@ public OffsetDateTime sharedDateTime() { /** * Set the sharedDateTime property: The UTC date and time when the item was shared. Read-only. - * + * * @param sharedDateTime the sharedDateTime value to set. * @return the MicrosoftGraphShared object itself. */ @@ -133,17 +136,16 @@ public MicrosoftGraphShared withSharedDateTime(OffsetDateTime sharedDateTime) { /** * Get the additionalProperties property: shared. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: shared. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphShared object itself. */ @@ -152,17 +154,9 @@ public MicrosoftGraphShared withAdditionalProperties(Map additio return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -173,4 +167,62 @@ public void validate() { sharedBy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("owner", this.owner); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeJsonField("sharedBy", this.sharedBy); + jsonWriter.writeStringField("sharedDateTime", + this.sharedDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sharedDateTime)); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphShared from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphShared 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 MicrosoftGraphShared. + */ + public static MicrosoftGraphShared fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphShared deserializedMicrosoftGraphShared = new MicrosoftGraphShared(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("owner".equals(fieldName)) { + deserializedMicrosoftGraphShared.owner = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("scope".equals(fieldName)) { + deserializedMicrosoftGraphShared.scope = reader.getString(); + } else if ("sharedBy".equals(fieldName)) { + deserializedMicrosoftGraphShared.sharedBy = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("sharedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphShared.sharedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphShared.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphShared; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharedInsight.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharedInsight.java index ad317c53d05d7..75caca9e6369e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharedInsight.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharedInsight.java @@ -5,65 +5,63 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -/** sharedInsight. */ +/** + * sharedInsight. + */ @Fluent public final class MicrosoftGraphSharedInsight extends MicrosoftGraphEntity { /* * sharingDetail */ - @JsonProperty(value = "lastShared") private MicrosoftGraphSharingDetail lastShared; /* * resourceReference */ - @JsonProperty(value = "resourceReference") private MicrosoftGraphResourceReference resourceReference; /* * resourceVisualization */ - @JsonProperty(value = "resourceVisualization") private MicrosoftGraphResourceVisualization resourceVisualization; /* * The sharingHistory property. */ - @JsonProperty(value = "sharingHistory") private List sharingHistory; /* * entity */ - @JsonProperty(value = "lastSharedMethod") private MicrosoftGraphEntity lastSharedMethod; /* * entity */ - @JsonProperty(value = "resource") private MicrosoftGraphEntity resource; /* * sharedInsight */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSharedInsight class. */ + /** + * Creates an instance of MicrosoftGraphSharedInsight class. + */ public MicrosoftGraphSharedInsight() { } /** * Get the lastShared property: sharingDetail. - * + * * @return the lastShared value. */ public MicrosoftGraphSharingDetail lastShared() { @@ -72,7 +70,7 @@ public MicrosoftGraphSharingDetail lastShared() { /** * Set the lastShared property: sharingDetail. - * + * * @param lastShared the lastShared value to set. * @return the MicrosoftGraphSharedInsight object itself. */ @@ -83,7 +81,7 @@ public MicrosoftGraphSharedInsight withLastShared(MicrosoftGraphSharingDetail la /** * Get the resourceReference property: resourceReference. - * + * * @return the resourceReference value. */ public MicrosoftGraphResourceReference resourceReference() { @@ -92,7 +90,7 @@ public MicrosoftGraphResourceReference resourceReference() { /** * Set the resourceReference property: resourceReference. - * + * * @param resourceReference the resourceReference value to set. * @return the MicrosoftGraphSharedInsight object itself. */ @@ -103,7 +101,7 @@ public MicrosoftGraphSharedInsight withResourceReference(MicrosoftGraphResourceR /** * Get the resourceVisualization property: resourceVisualization. - * + * * @return the resourceVisualization value. */ public MicrosoftGraphResourceVisualization resourceVisualization() { @@ -112,19 +110,19 @@ public MicrosoftGraphResourceVisualization resourceVisualization() { /** * Set the resourceVisualization property: resourceVisualization. - * + * * @param resourceVisualization the resourceVisualization value to set. * @return the MicrosoftGraphSharedInsight object itself. */ - public MicrosoftGraphSharedInsight withResourceVisualization( - MicrosoftGraphResourceVisualization resourceVisualization) { + public MicrosoftGraphSharedInsight + withResourceVisualization(MicrosoftGraphResourceVisualization resourceVisualization) { this.resourceVisualization = resourceVisualization; return this; } /** * Get the sharingHistory property: The sharingHistory property. - * + * * @return the sharingHistory value. */ public List sharingHistory() { @@ -133,7 +131,7 @@ public List sharingHistory() { /** * Set the sharingHistory property: The sharingHistory property. - * + * * @param sharingHistory the sharingHistory value to set. * @return the MicrosoftGraphSharedInsight object itself. */ @@ -144,7 +142,7 @@ public MicrosoftGraphSharedInsight withSharingHistory(List additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: sharedInsight. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSharedInsight object itself. */ @@ -203,15 +200,9 @@ public MicrosoftGraphSharedInsight withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public MicrosoftGraphSharedInsight withId(String id) { super.withId(id); @@ -220,7 +211,7 @@ public MicrosoftGraphSharedInsight withId(String id) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override @@ -245,4 +236,74 @@ public void validate() { resource().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeJsonField("lastShared", this.lastShared); + jsonWriter.writeJsonField("resourceReference", this.resourceReference); + jsonWriter.writeJsonField("resourceVisualization", this.resourceVisualization); + jsonWriter.writeArrayField("sharingHistory", this.sharingHistory, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("lastSharedMethod", this.lastSharedMethod); + jsonWriter.writeJsonField("resource", this.resource); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSharedInsight from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSharedInsight 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 MicrosoftGraphSharedInsight. + */ + public static MicrosoftGraphSharedInsight fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSharedInsight deserializedMicrosoftGraphSharedInsight = new MicrosoftGraphSharedInsight(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMicrosoftGraphSharedInsight.withId(reader.getString()); + } else if ("lastShared".equals(fieldName)) { + deserializedMicrosoftGraphSharedInsight.lastShared = MicrosoftGraphSharingDetail.fromJson(reader); + } else if ("resourceReference".equals(fieldName)) { + deserializedMicrosoftGraphSharedInsight.resourceReference + = MicrosoftGraphResourceReference.fromJson(reader); + } else if ("resourceVisualization".equals(fieldName)) { + deserializedMicrosoftGraphSharedInsight.resourceVisualization + = MicrosoftGraphResourceVisualization.fromJson(reader); + } else if ("sharingHistory".equals(fieldName)) { + List sharingHistory + = reader.readArray(reader1 -> MicrosoftGraphSharingDetail.fromJson(reader1)); + deserializedMicrosoftGraphSharedInsight.sharingHistory = sharingHistory; + } else if ("lastSharedMethod".equals(fieldName)) { + deserializedMicrosoftGraphSharedInsight.lastSharedMethod = MicrosoftGraphEntity.fromJson(reader); + } else if ("resource".equals(fieldName)) { + deserializedMicrosoftGraphSharedInsight.resource = MicrosoftGraphEntity.fromJson(reader); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSharedInsight.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSharedInsight; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharepointIds.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharepointIds.java index b63e3831718da..0b0c263cef071 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharepointIds.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharepointIds.java @@ -5,70 +5,68 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** sharepointIds. */ +/** + * sharepointIds. + */ @Fluent -public final class MicrosoftGraphSharepointIds { +public final class MicrosoftGraphSharepointIds implements JsonSerializable { /* * The unique identifier (guid) for the item's list in SharePoint. */ - @JsonProperty(value = "listId") private String listId; /* * An integer identifier for the item within the containing list. */ - @JsonProperty(value = "listItemId") private String listItemId; /* * The unique identifier (guid) for the item within OneDrive for Business or a SharePoint site. */ - @JsonProperty(value = "listItemUniqueId") private String listItemUniqueId; /* * The unique identifier (guid) for the item's site collection (SPSite). */ - @JsonProperty(value = "siteId") private String siteId; /* * The SharePoint URL for the site that contains the item. */ - @JsonProperty(value = "siteUrl") private String siteUrl; /* * The unique identifier (guid) for the tenancy. */ - @JsonProperty(value = "tenantId") private String tenantId; /* * The unique identifier (guid) for the item's site (SPWeb). */ - @JsonProperty(value = "webId") private String webId; /* * sharepointIds */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSharepointIds class. */ + /** + * Creates an instance of MicrosoftGraphSharepointIds class. + */ public MicrosoftGraphSharepointIds() { } /** * Get the listId property: The unique identifier (guid) for the item's list in SharePoint. - * + * * @return the listId value. */ public String listId() { @@ -77,7 +75,7 @@ public String listId() { /** * Set the listId property: The unique identifier (guid) for the item's list in SharePoint. - * + * * @param listId the listId value to set. * @return the MicrosoftGraphSharepointIds object itself. */ @@ -88,7 +86,7 @@ public MicrosoftGraphSharepointIds withListId(String listId) { /** * Get the listItemId property: An integer identifier for the item within the containing list. - * + * * @return the listItemId value. */ public String listItemId() { @@ -97,7 +95,7 @@ public String listItemId() { /** * Set the listItemId property: An integer identifier for the item within the containing list. - * + * * @param listItemId the listItemId value to set. * @return the MicrosoftGraphSharepointIds object itself. */ @@ -109,7 +107,7 @@ public MicrosoftGraphSharepointIds withListItemId(String listItemId) { /** * Get the listItemUniqueId property: The unique identifier (guid) for the item within OneDrive for Business or a * SharePoint site. - * + * * @return the listItemUniqueId value. */ public String listItemUniqueId() { @@ -119,7 +117,7 @@ public String listItemUniqueId() { /** * Set the listItemUniqueId property: The unique identifier (guid) for the item within OneDrive for Business or a * SharePoint site. - * + * * @param listItemUniqueId the listItemUniqueId value to set. * @return the MicrosoftGraphSharepointIds object itself. */ @@ -130,7 +128,7 @@ public MicrosoftGraphSharepointIds withListItemUniqueId(String listItemUniqueId) /** * Get the siteId property: The unique identifier (guid) for the item's site collection (SPSite). - * + * * @return the siteId value. */ public String siteId() { @@ -139,7 +137,7 @@ public String siteId() { /** * Set the siteId property: The unique identifier (guid) for the item's site collection (SPSite). - * + * * @param siteId the siteId value to set. * @return the MicrosoftGraphSharepointIds object itself. */ @@ -150,7 +148,7 @@ public MicrosoftGraphSharepointIds withSiteId(String siteId) { /** * Get the siteUrl property: The SharePoint URL for the site that contains the item. - * + * * @return the siteUrl value. */ public String siteUrl() { @@ -159,7 +157,7 @@ public String siteUrl() { /** * Set the siteUrl property: The SharePoint URL for the site that contains the item. - * + * * @param siteUrl the siteUrl value to set. * @return the MicrosoftGraphSharepointIds object itself. */ @@ -170,7 +168,7 @@ public MicrosoftGraphSharepointIds withSiteUrl(String siteUrl) { /** * Get the tenantId property: The unique identifier (guid) for the tenancy. - * + * * @return the tenantId value. */ public String tenantId() { @@ -179,7 +177,7 @@ public String tenantId() { /** * Set the tenantId property: The unique identifier (guid) for the tenancy. - * + * * @param tenantId the tenantId value to set. * @return the MicrosoftGraphSharepointIds object itself. */ @@ -190,7 +188,7 @@ public MicrosoftGraphSharepointIds withTenantId(String tenantId) { /** * Get the webId property: The unique identifier (guid) for the item's site (SPWeb). - * + * * @return the webId value. */ public String webId() { @@ -199,7 +197,7 @@ public String webId() { /** * Set the webId property: The unique identifier (guid) for the item's site (SPWeb). - * + * * @param webId the webId value to set. * @return the MicrosoftGraphSharepointIds object itself. */ @@ -210,17 +208,16 @@ public MicrosoftGraphSharepointIds withWebId(String webId) { /** * Get the additionalProperties property: sharepointIds. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: sharepointIds. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSharepointIds object itself. */ @@ -229,19 +226,76 @@ public MicrosoftGraphSharepointIds withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("listId", this.listId); + jsonWriter.writeStringField("listItemId", this.listItemId); + jsonWriter.writeStringField("listItemUniqueId", this.listItemUniqueId); + jsonWriter.writeStringField("siteId", this.siteId); + jsonWriter.writeStringField("siteUrl", this.siteUrl); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("webId", this.webId); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSharepointIds from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSharepointIds 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 MicrosoftGraphSharepointIds. + */ + public static MicrosoftGraphSharepointIds fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSharepointIds deserializedMicrosoftGraphSharepointIds = new MicrosoftGraphSharepointIds(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("listId".equals(fieldName)) { + deserializedMicrosoftGraphSharepointIds.listId = reader.getString(); + } else if ("listItemId".equals(fieldName)) { + deserializedMicrosoftGraphSharepointIds.listItemId = reader.getString(); + } else if ("listItemUniqueId".equals(fieldName)) { + deserializedMicrosoftGraphSharepointIds.listItemUniqueId = reader.getString(); + } else if ("siteId".equals(fieldName)) { + deserializedMicrosoftGraphSharepointIds.siteId = reader.getString(); + } else if ("siteUrl".equals(fieldName)) { + deserializedMicrosoftGraphSharepointIds.siteUrl = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedMicrosoftGraphSharepointIds.tenantId = reader.getString(); + } else if ("webId".equals(fieldName)) { + deserializedMicrosoftGraphSharepointIds.webId = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSharepointIds.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSharepointIds; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingDetail.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingDetail.java index 15d7443480464..ffdd71a433ced 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingDetail.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingDetail.java @@ -5,21 +5,25 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; -import java.util.HashMap; +import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; import java.util.Map; -/** sharingDetail. */ +/** + * sharingDetail. + */ @Fluent -public final class MicrosoftGraphSharingDetail { +public final class MicrosoftGraphSharingDetail implements JsonSerializable { /* * insightIdentity */ - @JsonProperty(value = "sharedBy") private MicrosoftGraphInsightIdentity sharedBy; /* @@ -27,39 +31,37 @@ public final class MicrosoftGraphSharingDetail { * format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would look like this: * 2014-01-01T00:00:00Z. Read-only. */ - @JsonProperty(value = "sharedDateTime") private OffsetDateTime sharedDateTime; /* * resourceReference */ - @JsonProperty(value = "sharingReference") private MicrosoftGraphResourceReference sharingReference; /* * The subject with which the document was shared. */ - @JsonProperty(value = "sharingSubject") private String sharingSubject; /* * Determines the way the document was shared, can be by a 'Link', 'Attachment', 'Group', 'Site'. */ - @JsonProperty(value = "sharingType") private String sharingType; /* * sharingDetail */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSharingDetail class. */ + /** + * Creates an instance of MicrosoftGraphSharingDetail class. + */ public MicrosoftGraphSharingDetail() { } /** * Get the sharedBy property: insightIdentity. - * + * * @return the sharedBy value. */ public MicrosoftGraphInsightIdentity sharedBy() { @@ -68,7 +70,7 @@ public MicrosoftGraphInsightIdentity sharedBy() { /** * Set the sharedBy property: insightIdentity. - * + * * @param sharedBy the sharedBy value to set. * @return the MicrosoftGraphSharingDetail object itself. */ @@ -81,7 +83,7 @@ public MicrosoftGraphSharingDetail withSharedBy(MicrosoftGraphInsightIdentity sh * Get the sharedDateTime property: The date and time the file was last shared. The timestamp represents date and * time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would * look like this: 2014-01-01T00:00:00Z. Read-only. - * + * * @return the sharedDateTime value. */ public OffsetDateTime sharedDateTime() { @@ -92,7 +94,7 @@ public OffsetDateTime sharedDateTime() { * Set the sharedDateTime property: The date and time the file was last shared. The timestamp represents date and * time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 would * look like this: 2014-01-01T00:00:00Z. Read-only. - * + * * @param sharedDateTime the sharedDateTime value to set. * @return the MicrosoftGraphSharingDetail object itself. */ @@ -103,7 +105,7 @@ public MicrosoftGraphSharingDetail withSharedDateTime(OffsetDateTime sharedDateT /** * Get the sharingReference property: resourceReference. - * + * * @return the sharingReference value. */ public MicrosoftGraphResourceReference sharingReference() { @@ -112,7 +114,7 @@ public MicrosoftGraphResourceReference sharingReference() { /** * Set the sharingReference property: resourceReference. - * + * * @param sharingReference the sharingReference value to set. * @return the MicrosoftGraphSharingDetail object itself. */ @@ -123,7 +125,7 @@ public MicrosoftGraphSharingDetail withSharingReference(MicrosoftGraphResourceRe /** * Get the sharingSubject property: The subject with which the document was shared. - * + * * @return the sharingSubject value. */ public String sharingSubject() { @@ -132,7 +134,7 @@ public String sharingSubject() { /** * Set the sharingSubject property: The subject with which the document was shared. - * + * * @param sharingSubject the sharingSubject value to set. * @return the MicrosoftGraphSharingDetail object itself. */ @@ -144,7 +146,7 @@ public MicrosoftGraphSharingDetail withSharingSubject(String sharingSubject) { /** * Get the sharingType property: Determines the way the document was shared, can be by a 'Link', 'Attachment', * 'Group', 'Site'. - * + * * @return the sharingType value. */ public String sharingType() { @@ -154,7 +156,7 @@ public String sharingType() { /** * Set the sharingType property: Determines the way the document was shared, can be by a 'Link', 'Attachment', * 'Group', 'Site'. - * + * * @param sharingType the sharingType value to set. * @return the MicrosoftGraphSharingDetail object itself. */ @@ -165,17 +167,16 @@ public MicrosoftGraphSharingDetail withSharingType(String sharingType) { /** * Get the additionalProperties property: sharingDetail. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: sharingDetail. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSharingDetail object itself. */ @@ -184,17 +185,9 @@ public MicrosoftGraphSharingDetail withAdditionalProperties(Map return this; } - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -205,4 +198,66 @@ public void validate() { sharingReference().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sharedBy", this.sharedBy); + jsonWriter.writeStringField("sharedDateTime", + this.sharedDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sharedDateTime)); + jsonWriter.writeJsonField("sharingReference", this.sharingReference); + jsonWriter.writeStringField("sharingSubject", this.sharingSubject); + jsonWriter.writeStringField("sharingType", this.sharingType); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSharingDetail from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSharingDetail 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 MicrosoftGraphSharingDetail. + */ + public static MicrosoftGraphSharingDetail fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSharingDetail deserializedMicrosoftGraphSharingDetail = new MicrosoftGraphSharingDetail(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sharedBy".equals(fieldName)) { + deserializedMicrosoftGraphSharingDetail.sharedBy = MicrosoftGraphInsightIdentity.fromJson(reader); + } else if ("sharedDateTime".equals(fieldName)) { + deserializedMicrosoftGraphSharingDetail.sharedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("sharingReference".equals(fieldName)) { + deserializedMicrosoftGraphSharingDetail.sharingReference + = MicrosoftGraphResourceReference.fromJson(reader); + } else if ("sharingSubject".equals(fieldName)) { + deserializedMicrosoftGraphSharingDetail.sharingSubject = reader.getString(); + } else if ("sharingType".equals(fieldName)) { + deserializedMicrosoftGraphSharingDetail.sharingType = reader.getString(); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSharingDetail.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSharingDetail; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingInvitation.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingInvitation.java index c6fa52abba0de..025be35e7cd70 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingInvitation.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingInvitation.java @@ -5,52 +5,53 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** sharingInvitation. */ +/** + * sharingInvitation. + */ @Fluent -public final class MicrosoftGraphSharingInvitation { +public final class MicrosoftGraphSharingInvitation implements JsonSerializable { /* * The email address provided for the recipient of the sharing invitation. Read-only. */ - @JsonProperty(value = "email") private String email; /* * identitySet */ - @JsonProperty(value = "invitedBy") private MicrosoftGraphIdentitySet invitedBy; /* * The redeemedBy property. */ - @JsonProperty(value = "redeemedBy") private String redeemedBy; /* * If true the recipient of the invitation needs to sign in in order to access the shared item. Read-only. */ - @JsonProperty(value = "signInRequired") private Boolean signInRequired; /* * sharingInvitation */ - @JsonIgnore private Map additionalProperties; + private Map additionalProperties; - /** Creates an instance of MicrosoftGraphSharingInvitation class. */ + /** + * Creates an instance of MicrosoftGraphSharingInvitation class. + */ public MicrosoftGraphSharingInvitation() { } /** * Get the email property: The email address provided for the recipient of the sharing invitation. Read-only. - * + * * @return the email value. */ public String email() { @@ -59,7 +60,7 @@ public String email() { /** * Set the email property: The email address provided for the recipient of the sharing invitation. Read-only. - * + * * @param email the email value to set. * @return the MicrosoftGraphSharingInvitation object itself. */ @@ -70,7 +71,7 @@ public MicrosoftGraphSharingInvitation withEmail(String email) { /** * Get the invitedBy property: identitySet. - * + * * @return the invitedBy value. */ public MicrosoftGraphIdentitySet invitedBy() { @@ -79,7 +80,7 @@ public MicrosoftGraphIdentitySet invitedBy() { /** * Set the invitedBy property: identitySet. - * + * * @param invitedBy the invitedBy value to set. * @return the MicrosoftGraphSharingInvitation object itself. */ @@ -90,7 +91,7 @@ public MicrosoftGraphSharingInvitation withInvitedBy(MicrosoftGraphIdentitySet i /** * Get the redeemedBy property: The redeemedBy property. - * + * * @return the redeemedBy value. */ public String redeemedBy() { @@ -99,7 +100,7 @@ public String redeemedBy() { /** * Set the redeemedBy property: The redeemedBy property. - * + * * @param redeemedBy the redeemedBy value to set. * @return the MicrosoftGraphSharingInvitation object itself. */ @@ -111,7 +112,7 @@ public MicrosoftGraphSharingInvitation withRedeemedBy(String redeemedBy) { /** * Get the signInRequired property: If true the recipient of the invitation needs to sign in in order to access the * shared item. Read-only. - * + * * @return the signInRequired value. */ public Boolean signInRequired() { @@ -121,7 +122,7 @@ public Boolean signInRequired() { /** * Set the signInRequired property: If true the recipient of the invitation needs to sign in in order to access the * shared item. Read-only. - * + * * @param signInRequired the signInRequired value to set. * @return the MicrosoftGraphSharingInvitation object itself. */ @@ -132,17 +133,16 @@ public MicrosoftGraphSharingInvitation withSignInRequired(Boolean signInRequired /** * Get the additionalProperties property: sharingInvitation. - * + * * @return the additionalProperties value. */ - @JsonAnyGetter public Map additionalProperties() { return this.additionalProperties; } /** * Set the additionalProperties property: sharingInvitation. - * + * * @param additionalProperties the additionalProperties value to set. * @return the MicrosoftGraphSharingInvitation object itself. */ @@ -151,17 +151,9 @@ public MicrosoftGraphSharingInvitation withAdditionalProperties(Map(); - } - additionalProperties.put(key, value); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -169,4 +161,62 @@ public void validate() { invitedBy().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("email", this.email); + jsonWriter.writeJsonField("invitedBy", this.invitedBy); + jsonWriter.writeStringField("redeemedBy", this.redeemedBy); + jsonWriter.writeBooleanField("signInRequired", this.signInRequired); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MicrosoftGraphSharingInvitation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MicrosoftGraphSharingInvitation 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 MicrosoftGraphSharingInvitation. + */ + public static MicrosoftGraphSharingInvitation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MicrosoftGraphSharingInvitation deserializedMicrosoftGraphSharingInvitation + = new MicrosoftGraphSharingInvitation(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("email".equals(fieldName)) { + deserializedMicrosoftGraphSharingInvitation.email = reader.getString(); + } else if ("invitedBy".equals(fieldName)) { + deserializedMicrosoftGraphSharingInvitation.invitedBy = MicrosoftGraphIdentitySet.fromJson(reader); + } else if ("redeemedBy".equals(fieldName)) { + deserializedMicrosoftGraphSharingInvitation.redeemedBy = reader.getString(); + } else if ("signInRequired".equals(fieldName)) { + deserializedMicrosoftGraphSharingInvitation.signInRequired + = reader.getNullable(JsonReader::getBoolean); + } else { + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.readUntyped()); + } + } + deserializedMicrosoftGraphSharingInvitation.additionalProperties = additionalProperties; + + return deserializedMicrosoftGraphSharingInvitation; + }); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingLink.java b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingLink.java index 1da7686c53559..5c263e7b9ae16 100644 --- a/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingLink.java +++ b/sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/models/MicrosoftGraphSharingLink.java @@ -5,67 +5,66 @@ package com.azure.resourcemanager.authorization.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; import java.util.Map; -/** sharingLink. */ +/** + * sharingLink. + */ @Fluent -public final class MicrosoftGraphSharingLink { +public final class MicrosoftGraphSharingLink implements JsonSerializable { /* * identity */ - @JsonProperty(value = "application") private MicrosoftGraphIdentity application; /* * If true then the user can only use this link to view the item on the web, and cannot use it to download the * contents of the item. Only for OneDrive for Business and SharePoint. */ - @JsonProperty(value = "preventsDownload") private Boolean preventsDownload; /* * The scope of the link represented by this permission. Value anonymous indicates the link is usable by anyone, * organization indicates the link is only usable for users signed into the same tenant. */ - @JsonProperty(value = "scope") private String scope; /* * The type of the link created. */ - @JsonProperty(value = "type") private String type; /* * For embed links, this property contains the HTML code for an